/* ════════════════════════════════════════════════════════════
   DESIGN SYSTEM — CarDeal365 (2026 redesign)
   Two-token surface rhythm (bg-a / bg-b), one accent gradient,
   consistent card + label treatment across every section.

   Extracted from the homepage's inline <style> so other pages can
   share it. Homepage-only pieces (hero dashboard mock, AI panel
   mocks, product tabs, pricing rows) were intentionally left out.

   Sections lay out on an alternating rhythm:
     style="background:var(--bg-a)"  /  style="background:var(--bg-b)"
   and the closing CTA band uses id="cta" (it paints itself).

   NOTE: index.html still carries its own inline copy of these
   rules. Changes made here should be mirrored there until the
   homepage is migrated onto this file.
   ════════════════════════════════════════════════════════════ */

/* ── DARK (default) ── */
:root {
  --bg-body: #050b17;
  --bg-a: #050b17;
  --bg-b: #081020;
  --bg-trust: #060d1b;
  --bg-footer: #030710;

  --text-base: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --card-bg: rgba(148, 163, 184, 0.05);
  --card-border: rgba(148, 163, 184, 0.13);
  --card-hover-border: rgba(37, 99, 235, 0.5);
  --card-hover-shadow: 0 18px 48px rgba(59, 130, 246, 0.16), 0 4px 12px rgba(0, 0, 0, 0.4);

  --glass-bg: rgba(15, 26, 46, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);

  --label-bg: rgba(37, 99, 235, 0.12);
  --label-border: rgba(37, 99, 235, 0.3);
  --label-color: #93c5fd;

  --btn-grad: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --btn-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
  --btn-hover-shadow: 0 8px 30px rgba(37, 99, 235, 0.5);

  --outline-border: rgba(255, 255, 255, 0.18);
  --outline-hover-border: rgba(37, 99, 235, 0.6);
  --outline-hover-bg: rgba(37, 99, 235, 0.1);

  --nav-hover: #93c5fd;
  --grad-text: #60a5fa;
  --grad-text-alt: linear-gradient(120deg, #34d399 0%, #60a5fa 100%);

  --divider-line: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.14) 40%, rgba(148, 163, 184, 0.14) 60%, transparent);
  --dot-color: rgba(148, 163, 184, 0.06);

  --num-color: rgba(148, 163, 184, 0.22);
  --scrollbar-track: #050b17;
  --scrollbar-thumb: #1e3054;
  --scrollbar-hover: #3b82f6;
  --theme-transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ── LIGHT ── */
[data-theme="light"] {
  --bg-body: #ffffff;
  --bg-a: #ffffff;
  --bg-b: #f5f7fc;
  --bg-trust: #f5f7fc;
  --bg-footer: #0b1222;

  --text-base: #0b1c39;
  --text-muted: #46587c;
  --text-subtle: #64748b;

  --card-bg: #ffffff;
  --card-border: #e3e9f5;
  --card-hover-border: rgba(37, 99, 235, 0.45);
  --card-hover-shadow: 0 18px 48px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(15, 40, 90, 0.06);

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: #dde5f3;

  --label-bg: rgba(37, 99, 235, 0.07);
  --label-border: rgba(37, 99, 235, 0.22);
  --label-color: #2563eb;

  --btn-grad: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --btn-shadow: 0 4px 18px rgba(37, 99, 235, 0.28);
  --btn-hover-shadow: 0 10px 32px rgba(37, 99, 235, 0.4);

  --outline-border: #cbd7ec;
  --outline-hover-border: rgba(37, 99, 235, 0.55);
  --outline-hover-bg: rgba(37, 99, 235, 0.06);

  --nav-hover: #2563eb;
  --grad-text: #2563eb;
  --grad-text-alt: linear-gradient(120deg, #059669 0%, #2563eb 100%);

  --divider-line: linear-gradient(90deg, transparent, #e3e9f5 40%, #e3e9f5 60%, transparent);
  --dot-color: rgba(37, 99, 235, 0.06);

  --num-color: rgba(37, 99, 235, 0.16);
  --scrollbar-track: #eef2fa;
  --scrollbar-thumb: #c3d1ea;
  --scrollbar-hover: #2563eb;
}

/* ── BASE ── */
*, *::before, *::after { transition: var(--theme-transition); }
.reveal, .feature-card, svg, img {
  transition: opacity 0.7s ease, transform 0.7s ease, background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
body {
  background-color: var(--bg-body);
  font-family: 'Inter', sans-serif;
  color: var(--text-base);
}

/* ── LIGHT: TAILWIND TEXT-UTILITY REMAP ── */
[data-theme="light"] .text-white:not(.btn-primary) { color: #0b1c39 !important; }
[data-theme="light"] .text-slate-200 { color: #26365c !important; }
[data-theme="light"] .text-slate-300 { color: #3a4c74 !important; }
[data-theme="light"] .text-slate-400 { color: #46587c !important; }
[data-theme="light"] .text-slate-500 { color: #5d6f96 !important; }
[data-theme="light"] .text-slate-600 { color: #46587c !important; }
[data-theme="light"] .text-brand-400 { color: #2563eb !important; }[data-theme="light"] .text-accent-400 { color: #047857 !important; }
[data-theme="light"] .text-amber-400 { color: #b45309 !important; }
[data-theme="light"] .text-blue-300 { color: #2563eb !important; }
[data-theme="light"] .text-blue-400 { color: #2563eb !important; }

/* Buttons keep white text in both themes */
.btn-primary, .btn-primary * { color: #ffffff !important; }

/* Footer stays dark in both themes */
[data-theme="light"] footer .text-white { color: #ffffff !important; }
[data-theme="light"] footer .text-slate-400 { color: #94a3b8 !important; }
[data-theme="light"] footer .text-slate-500 { color: #94a3b8 !important; }
[data-theme="light"] footer .text-slate-600 { color: #64748b !important; }

/* ── GLASS ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}
.glass-light {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .glass-light {
  background: #ffffff;
  border: 1px solid #dde5f3;
}

/* ── GRADIENT TEXT ── */
.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-green {
  background: var(--grad-text-alt);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--btn-grad);
  transition: all 0.3s ease;
  box-shadow: var(--btn-shadow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--btn-hover-shadow); }
.btn-outline {
  border: 1px solid var(--outline-border);
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.btn-outline:hover {
  border-color: var(--outline-hover-border);
  background: var(--outline-hover-bg);
  transform: translateY(-2px);
}

/* ── CARDS ── */
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.4s ease;
}
.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
}
[data-theme="light"] .feature-card {
  box-shadow: 0 1px 3px rgba(15, 40, 90, 0.05), 0 4px 20px rgba(15, 40, 90, 0.04);
}

/* Icon chip inside cards */
.icon-chip {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chip-blue   { background: rgba(59, 130, 246, 0.12);  border: 1px solid rgba(59, 130, 246, 0.25); }
.chip-orange { background: rgba(249, 115, 22, 0.12);  border: 1px solid rgba(249, 115, 22, 0.25); }
.chip-green  { background: rgba(52, 211, 153, 0.1);   border: 1px solid rgba(52, 211, 153, 0.25); }
.chip-amber  { background: rgba(251, 191, 36, 0.1);   border: 1px solid rgba(251, 191, 36, 0.25); }
[data-theme="light"] .chip-blue   { background: #eaf1fe; border-color: #c8dbfa; }
[data-theme="light"] .chip-orange { background: #fff1e6; border-color: #fcd9b6; }
[data-theme="light"] .chip-green  { background: #e7f8f1; border-color: #bfead8; }
[data-theme="light"] .chip-amber  { background: #fdf5e3; border-color: #f3ddab; }

/* Small feature tag pills under module cards */
.tag-pill {
  display: inline-flex; align-items: center;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--text-subtle);
  white-space: nowrap;
}
[data-theme="light"] .tag-pill { background: #f1f4fb; border-color: #e3e9f5; color: #5d6f96; }

/* ── SECTION LABEL (eyebrow) ── */
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--label-bg);
  border: 1px solid var(--label-border);
  color: var(--label-color);
  padding: 6px 16px; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── STEP NUMBER ── */
.step-num {
  font-size: 3.4rem; font-weight: 900; line-height: 1;
  color: var(--num-color);
  letter-spacing: -0.03em;
}

/* ── CHECK LIST ── */
.check-li { display: flex; align-items: flex-start; gap: 10px; }
.check-li svg { flex-shrink: 0; margin-top: 2px; }

/* ── NAV ── */
.nav-link { transition: color 0.2s ease; position: relative; }
.nav-link::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 2px; border-radius: 2px;
  background: var(--nav-hover);
  transition: width 0.22s ease;
}
.nav-link:hover { color: var(--nav-hover) !important; }
.nav-link:hover::after { width: 100%; }
[data-theme="light"] .nav-link { color: #33455f; }
[data-theme="light"] .nav-link[style*="color:#fb923c"] { color: #c2410c !important; }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 220px; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s;
  padding-top: 10px; z-index: 100;
}
.nav-dropdown-card {
  background: #0c1427 !important;
  border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 14px;
  padding: 6px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  transform: translateY(-6px); transition: transform 0.2s ease;
}
[data-theme="light"] .nav-dropdown-card {
  background: #ffffff !important;
  border: 1px solid #e3e9f5;
  box-shadow: 0 16px 48px rgba(15, 40, 90, 0.16);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
}
.nav-dropdown:hover .nav-dropdown-card { transform: translateY(0); }
.nav-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-radius: 8px; font-size: 0.82rem; font-weight: 500; color: #94a3b8 !important;
  transition: background 0.15s, color 0.15s; white-space: nowrap; text-decoration: none;
}
.nav-dropdown-item:hover { background: rgba(59, 130, 246, 0.15); color: #e2e8f0 !important; }
[data-theme="light"] .nav-dropdown-item { color: #46587c !important; }
[data-theme="light"] .nav-dropdown-item:hover { background: #eaf1fe; color: #0b1c39 !important; }
.nav-dropdown-item .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

[data-theme="light"] #mobile-menu {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #e3e9f5;
}

/* ── REVEAL ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ── SECTION DIVIDER + DOT GRID ── */
.section-divide { position: relative; }
.section-divide::before {
  content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: var(--divider-line); pointer-events: none;
}
.grid-dots {
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 40px; height: 22px;
  background: rgba(37, 99, 235, 0.3);
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: 999px; position: relative; cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease; flex-shrink: 0;
}
.theme-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #60a5fa;
  transition: transform 0.3s ease, background 0.3s ease;
}
[data-theme="light"] .theme-toggle { background: rgba(37, 99, 235, 0.12); border-color: rgba(37, 99, 235, 0.3); }
[data-theme="light"] .theme-toggle::after { transform: translateX(18px); background: #2563eb; }
.icon-sun, .icon-moon { width: 16px; height: 16px; flex-shrink: 0; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }

/* ── LOGO SWITCHING ── */
.logo-dark { display: block; }
.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: block; }

/* ── FAQ ── */
.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.faq-item:hover { border-color: var(--card-hover-border); }
.faq-btn { color: var(--text-base); }
.faq-icon { color: var(--label-color); transition: transform 0.35s ease; }
.faq-body {
  max-height: 0; overflow: hidden; opacity: 0; padding-bottom: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding-bottom 0.4s ease;
}
.faq-body.open { max-height: 600px; opacity: 1; padding-bottom: 1.25rem; }
[data-theme="light"] .faq-item { background: #ffffff; box-shadow: 0 2px 8px rgba(15, 40, 90, 0.04); }

/* ── CTA (stays blue with white text in both themes) ── */
#cta { background: #071224; }
[data-theme="light"] #cta { background: linear-gradient(135deg, #1047a3 0%, #1768d1 45%, #1a72d4 100%); }
#cta h2, #cta h2 * { color: #ffffff !important; }
#cta .text-white, #cta .text-slate-300, #cta .text-slate-400, #cta .text-slate-500 { color: rgba(255, 255, 255, 0.92) !important; }
#cta .cta-sub { color: rgba(255, 255, 255, 0.75) !important; }
#cta .section-label {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}
#cta .glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
#cta h3 { color: #ffffff !important; }
#cta label { color: rgba(255, 255, 255, 0.8) !important; }
#cta input, #cta select {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  color: #ffffff !important;
}
#cta input::placeholder { color: rgba(255, 255, 255, 0.45) !important; }
#cta .cta-step {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
#cta .cta-step div { color: rgba(255, 255, 255, 0.85) !important; }
#cta .cta-step p { color: rgba(255, 255, 255, 0.75) !important; }
[data-theme="light"] #cta .btn-primary {
  background: linear-gradient(135deg, #ff6a00 0%, #e05000 100%);
  box-shadow: 0 4px 24px rgba(255, 106, 0, 0.45);
}
[data-theme="light"] #cta .btn-primary:hover { box-shadow: 0 10px 40px rgba(255, 106, 0, 0.6); }
#cta .trust-sig { color: rgba(255, 255, 255, 0.65) !important; }
#cta .trust-sig svg * { stroke: rgba(255, 255, 255, 0.6); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }
