/* =================================================================
   Apex Auto Electrical — site styles
   Palette: white surface + crimson red accent
   ================================================================= */

:root {
  --red:        #c8102e;
  --red-dark:   #9b0c24;
  --red-light:  #e63950;
  --red-glow:   rgba(200, 16, 46, 0.35);
  --red-50:     #fff1f3;
  --red-100:    #ffd9de;

  --ink:        #0a0a0c;
  --ink-2:      #14141a;
  --ink-3:      #1f1f28;
  --line:       rgba(0, 0, 0, 0.08);
  --line-strong:rgba(0, 0, 0, 0.16);
  --line-on-dark: rgba(255, 255, 255, 0.10);

  --paper:      #ffffff;
  --paper-2:    #f6f6f8;
  --paper-3:    #ececf0;

  --text:       #0a0a0c;
  --text-mute:  #4a4a55;
  --text-soft:  #6c6c78;
  --text-on-dark: #f4f4f6;
  --text-on-dark-mute: #b4b4bc;

  --warn:   #f59e0b;
  --ok:     #16a34a;
  --danger: #dc2626;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.14);
  --shadow-glow: 0 12px 40px var(--red-glow);

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--red); color: #fff; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.025em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p  { margin: 0 0 1em; color: var(--text-mute); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Helpers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}
.eyebrow::before { content:""; width:24px; height:2px; background: var(--red); }

.lead { font-size: 1.125rem; color: var(--text-mute); max-width: 60ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color:#fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink); }
.btn-dark { background: var(--ink); color:#fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-sm { padding: 0.55rem 0.95rem; font-size: 0.9rem; }

.tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: var(--red-50);
  color: var(--red-dark);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.muted { color: var(--text-soft); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}
.brand .mark { width: 32px; height: 32px; }
.brand .mark svg { width: 100%; height: 100%; }
.brand b { color: var(--red); }
.nav-links {
  display: flex; gap: 1.5rem; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  font-weight: 500; color: var(--text);
  position: relative; padding: 0.25rem 0;
}
.nav-links a:hover { color: var(--red); }
.nav-links a.cta { color: var(--red); font-weight: 600; }
.nav-cta { display: flex; gap: 0.6rem; align-items: center; }

.nav-toggle { display:none; width:42px; height:42px; align-items:center; justify-content:center; border-radius: 10px; }
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 880px) {
  .nav-links { display:none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 1rem var(--gutter);
    border-bottom: 1px solid var(--line); align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 400px at 85% 0%, var(--red-50), transparent 60%),
    radial-gradient(700px 350px at 0% 100%, var(--red-50), transparent 60%);
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 strong { color: var(--red); font-weight: 700; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-trust { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem; color: var(--text-mute); font-size: 0.9rem; }
.hero-trust span { display: inline-flex; gap: 0.4rem; align-items: center; }
.hero-trust svg { width: 16px; height: 16px; color: var(--red); }
.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { order: -1; }
}

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 2.5rem; }
.section-head .eyebrow { justify-content: center; }
.section-head p { margin-top: 0.5rem; }

/* ---------- Service grid ---------- */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.svc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.svc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.svc-card .img {
  aspect-ratio: 4/3;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.svc-card .img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.svc-card:hover .img img { transform: scale(1.04); }
.svc-card .body { padding: 1.1rem 1.2rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.svc-card h3 { margin-bottom: 0.3rem; font-size: 1.15rem; }
.svc-card .desc { font-size: 0.95rem; color: var(--text-mute); flex: 1; }
.svc-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; gap: 0.5rem; }
.svc-card .price { font-family: var(--font-display); font-weight: 700; color: var(--red); font-size: 1.15rem; }
.svc-card .turn { font-size: 0.78rem; color: var(--text-soft); }

/* ---------- Process / steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background: #fff;
  position: relative;
}
.step .num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--red); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-family: var(--font-display);
  margin-bottom: 0.8rem;
}
.step h4 { margin-bottom: 0.35rem; }
.step p { font-size: 0.93rem; }

/* ---------- Banner / dark callout ---------- */
.callout {
  background: linear-gradient(135deg, var(--ink), var(--ink-2));
  color: var(--text-on-dark);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
  position: relative; overflow: hidden;
}
.callout h2 { color: #fff; }
.callout p { color: var(--text-on-dark-mute); }
.callout::after {
  content: "";
  position: absolute; right: -80px; top: -80px; width: 280px; height: 280px;
  background: radial-gradient(circle, var(--red) 0%, transparent 70%);
  opacity: 0.25;
}
@media (max-width: 760px) { .callout { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 1.1rem; }
.field label { display:block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-50);
}
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { font-size: 0.82rem; color: var(--text-soft); margin-top: 0.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

.checkbox { display: flex; align-items: flex-start; gap: 0.6rem; }
.checkbox input { width: auto; margin-top: 0.25rem; }

.warn-box {
  background: #fff8e8;
  border: 1px solid #f5d77a;
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.4rem;
  font-size: 0.95rem;
  color: #6a4a00;
}
.warn-box strong { color: #4a3300; }

.success-box {
  background: #ecfdf3;
  border: 1px solid #a7e8c0;
  border-left: 4px solid var(--ok);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  color: #0d4f25;
}

.error-box {
  background: #fff1f2;
  border: 1px solid #fbbac0;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  color: #7f1822;
}

/* ---------- Product page ---------- */
.product {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem);
}
@media (max-width: 880px) { .product { grid-template-columns: 1fr; } }
.product .img { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.product .img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.product .price-row {
  display: flex; align-items: baseline; gap: 1rem; margin: 1rem 0 1.5rem;
}
.product .price {
  font-family: var(--font-display); font-weight: 800;
  font-size: 2.2rem; color: var(--red);
}
.product .turn { color: var(--text-soft); }
.product ul { padding-left: 1.2rem; color: var(--text-mute); }
.product ul li { margin-bottom: 0.4rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--text-on-dark);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.site-footer h5 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.8rem; }
.site-footer a { color: var(--text-on-dark-mute); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
  padding-bottom: 2rem; border-bottom: 1px solid var(--line-on-dark);
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-bottom { display:flex; justify-content: space-between; padding-top: 1.5rem; font-size: 0.85rem; color: var(--text-on-dark-mute); flex-wrap: wrap; gap: 0.5rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; font-family: var(--font-display); font-weight: 800; color:#fff; }
.footer-brand .mark { width: 32px; height: 32px; color: var(--red); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 2rem 0; }
.center { text-align: center; }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ---------- Admin ---------- */
.admin-shell { min-height: 100vh; background: var(--paper-2); }
.admin-bar {
  background: var(--ink); color:#fff; padding: 0.85rem 0;
}
.admin-bar .container { display: flex; justify-content: space-between; align-items: center; }
.admin-bar .brand { color:#fff; }
.admin-bar a { color: var(--text-on-dark-mute); margin-left: 1rem; }
.admin-bar a:hover { color:#fff; }
.admin-bar a.active { color:#fff; }

.admin-tabs {
  display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem;
}
.admin-tabs button {
  padding: 0.7rem 1.2rem; border-bottom: 2px solid transparent; color: var(--text-mute); font-weight: 500;
}
.admin-tabs button.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }

.table {
  width: 100%; border-collapse: collapse; background:#fff;
  border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden;
}
.table th, .table td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: top; }
.table th { background: var(--paper-2); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-soft); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--paper-2); }

.badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.74rem; font-weight: 600;
}
.badge-new { background: var(--red-50); color: var(--red-dark); }
.badge-progress { background: #fff3d6; color: #92580a; }
.badge-done { background: #e6f6ec; color: #14592e; }
.badge-cancel { background: #efeff2; color: #555; }
.badge-pending { background: #efeff2; color: #555; }
.badge-paid { background: #e6f6ec; color: #14592e; }

.modal-back {
  position: fixed; inset: 0; background: rgba(8,8,12,0.55);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 1rem;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 700px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--line); display:flex; justify-content: space-between; align-items: center; }
.modal header h3 { margin: 0; }
.modal .body { padding: 1.5rem; }
.modal .foot { padding: 1rem 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 0.75rem; }
.modal .close { font-size: 1.4rem; padding: 0.25rem 0.6rem; border-radius: 8px; }
.modal .close:hover { background: var(--paper-2); }

.toolbar { display:flex; gap: 0.75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar h2 { margin: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; }
.kpi .label { font-size: 0.78rem; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.kpi .value { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; color: var(--ink); margin-top: 0.25rem; }
.kpi .value.red { color: var(--red); }

/* Login */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem var(--gutter);
  background:
    radial-gradient(800px 400px at 50% 0%, var(--red-50), transparent 60%),
    var(--paper);
}
.login-card {
  background:#fff; border:1px solid var(--line); border-radius: var(--radius-lg);
  padding: 2.2rem 2rem; width: 100%; max-width: 420px; box-shadow: var(--shadow-md);
}
.login-card .brand { margin-bottom: 1.5rem; font-size: 1.2rem; }
