/* InstantVehicleReports — premium light design.
   Palette: warm cream surfaces, deep slate ink, deep-emerald accent, amber highlights.
   The vibe is "professional and expensive" without going cold-corporate. */

:root {
  --bg: #faf7f1;            /* warm cream */
  --bg-2: #f3ece0;          /* slightly warmer */
  --bg-3: #ede4d4;
  --panel: #ffffff;
  --panel-2: #fbf6ec;
  --ink: #0f1f2e;           /* deep slate */
  --ink-dim: #44505c;
  --ink-mute: #8a8377;
  --line: #e6dfd2;
  --line-strong: #d3c9b6;
  --accent: #0a4a3f;        /* deep emerald */
  --accent-2: #0f6655;       /* lighter emerald */
  --accent-3: #b45309;       /* amber for badges */
  --accent-ink: #faf7f1;
  --good: #047857;
  --warn: #b45309;
  --bad:  #9f1239;
  --shadow-sm: 0 1px 2px rgba(15, 31, 46, .05);
  --shadow:    0 8px 24px rgba(15, 31, 46, .08);
  --shadow-lg: 0 18px 50px rgba(15, 31, 46, .12);
  --radius: 14px;
  --radius-lg: 22px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a1410;
  --bg-2: #0f1d18;
  --bg-3: #14271f;
  --panel: #14271f;
  --panel-2: #1a3329;
  --ink: #f5f0e1;
  --ink-dim: #b3a896;
  --ink-mute: #6f6555;
  --line: #233d34;
  --line-strong: #335247;
  --accent: #5eead4;
  --accent-2: #2dd4bf;
  --accent-3: #fbbf24;
  --accent-ink: #0a1410;
  --good: #34d399;
  --warn: #fbbf24;
  --bad:  #fb7185;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow:    0 8px 22px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* Auto-respect device preference. Users can override via the theme toggle
   (which sets <html data-theme="dark|light"> and persists in localStorage). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a1410; --bg-2: #0f1d18; --panel: #14271f; --panel-2: #1a3329;
    --ink: #f5f0e1; --ink-dim: #b3a896; --ink-mute: #6f6555;
    --line: #233d34; --line-strong: #335247;
    --accent: #5eead4; --accent-2: #2dd4bf; --accent-3: #fbbf24;
    --accent-ink: #0a1410;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s, color .25s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1200px, 92%); margin: 0 auto; }

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .4em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
h3 { font-size: 1.2rem; }

.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(10, 74, 63, .07);
  border: 1px solid rgba(10, 74, 63, .18);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 1.4rem;
}
.muted { color: var(--ink-dim); }
.small { font-size: .9rem; }
.micro { font-size: .78rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 11px;
  border: 1px solid transparent;
  font: 600 .96rem 'Inter', sans-serif;
  cursor: pointer;
  transition: transform .15s ease, background .15s, box-shadow .2s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 4px 12px rgba(10, 74, 63, .2);
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 8px 20px rgba(10, 74, 63, .28);
}
.btn-ghost {
  background: var(--panel); color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--ink-mute); }
.btn-lg { padding: 16px 26px; font-size: 1.02rem; border-radius: 13px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; }
.footer .brand-logo { height: 40px; }
[data-theme="dark"] .brand-logo { content: url(/logo-dark.svg); filter: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 11px; }
.brand-mark::after { content: "IVR"; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--ink-dim); font-weight: 500; font-size: .95rem; transition: color .15s; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 11px; cursor: pointer; color: var(--ink-dim);
  transition: background .15s, color .15s;
}
.theme-toggle:hover { color: var(--ink); background: var(--bg-2); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: .85rem; color: var(--ink-dim);
}
@media (max-width: 720px) { .nav-links { display: none; } }

/* Hero */
.hero { padding: 96px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }
.lede { color: var(--ink-dim); font-size: 1.12rem; max-width: 56ch; margin: 18px 0 36px; line-height: 1.65; }

.hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 30px 22px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative; padding: 11px 0 11px 30px;
  border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: .98rem;
}
.check-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 15px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
}
.check-list li::after {
  content: "✓"; position: absolute; left: 5px; top: 11px;
  font-size: .72rem; color: var(--accent-ink); font-weight: 800;
}

/* Sections */
section { padding: 96px 0; }
section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: 56px; max-width: 640px; margin-left: auto; margin-right: auto; }
.section-head h2 { margin-top: 8px; }
.section-head p { color: var(--ink-dim); font-size: 1.05rem; margin-top: 12px; }

/* Pricing tiers — premium feel with breathing room */
.tier-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 920px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .tier-grid { grid-template-columns: 1fr; } }
.tier {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px 28px;
  text-align: center;
  position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.tier:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.tier.featured {
  border: 2px solid var(--accent);
  box-shadow: 0 12px 32px rgba(10, 74, 63, .15);
}
.tier-label {
  font-size: .82rem; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: .12em; font-weight: 600;
}
.tier-credits {
  font-family: 'Sora', sans-serif; font-size: 2.6rem; font-weight: 800;
  color: var(--accent); margin: 8px 0 4px;
  letter-spacing: -0.02em;
}
.tier-credits-suffix { font-size: .95rem; color: var(--ink-dim); font-weight: 500; }
.tier-price { font-size: 1.75rem; font-weight: 700; margin: 18px 0 4px; color: var(--ink); letter-spacing: -0.01em; }
.tier-price small { font-size: .85rem; color: var(--ink-dim); font-weight: 500; }
.tier-each { color: var(--ink-mute); font-size: .85rem; margin-bottom: 22px; }
.tier-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent-3); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  padding: 5px 14px; border-radius: 999px;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(180, 83, 9, .25);
}
.tier .btn { width: 100%; }

/* Auth + dashboard */
.auth-shell {
  min-height: calc(100vh - 100px);
  display: grid; place-items: center;
  padding: 56px 16px;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 40px 36px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.8rem; margin-bottom: 8px; letter-spacing: -0.02em; }
.auth-card .lede { font-size: 1rem; margin: 0 0 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-dim); margin-bottom: 8px; letter-spacing: .02em; }
.field input {
  width: 100%; padding: 13px 16px; border-radius: 11px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line-strong);
  font: 500 1rem 'Inter', sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(10, 74, 63, .1); }
.opt-in {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 16px 0 6px;
  font-size: .88rem; color: var(--ink-dim); cursor: pointer; line-height: 1.5;
}
.opt-in input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: 0 0 18px; }
.auth-card .btn { width: 100%; margin-top: 18px; }
.auth-foot { text-align: center; margin-top: 22px; font-size: .92rem; color: var(--ink-dim); }
.error-box {
  background: rgba(159, 18, 57, .08); border: 1px solid rgba(159, 18, 57, .35);
  color: var(--bad); padding: 11px 16px; border-radius: 11px; margin-bottom: 14px;
  font-size: .92rem;
}
.success-box {
  background: rgba(4, 120, 87, .08); border: 1px solid rgba(4, 120, 87, .35);
  color: var(--good); padding: 11px 16px; border-radius: 11px; margin-bottom: 14px;
  font-size: .92rem;
}

/* Dashboard */
.dash-shell { padding: 56px 0 96px; }
.dash-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 28px; }
@media (max-width: 920px) { .dash-grid { grid-template-columns: 1fr; } }
.balance-card {
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
  color: var(--accent-ink);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.balance-card .label { font-size: .82rem; opacity: .85; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.balance-card .credits { font-family: 'Sora', sans-serif; font-size: 3.4rem; font-weight: 800; margin: 8px 0 10px; line-height: 1; letter-spacing: -0.02em; }
.balance-card .sub { font-size: .92rem; opacity: .9; margin-bottom: 22px; line-height: 1.55; }
.balance-card .btn { background: var(--bg); color: var(--accent); width: 100%; border-color: transparent; }
.balance-card .btn:hover { background: #fff; }

.run-vin-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.vin-row {
  display: flex; gap: 8px;
  background: var(--bg-2); padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 13px; margin-top: 12px;
}
.vin-row input {
  flex: 1; min-width: 0;
  background: transparent; color: var(--ink);
  border: 0; outline: 0;
  font: 600 1.05rem 'Inter', sans-serif;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 14px;
}
.vin-row input::placeholder { color: var(--ink-mute); letter-spacing: .04em; font-weight: 500; }

.history-card {
  margin-top: 28px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.history-table { width: 100%; border-collapse: collapse; }
.history-table th, .history-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
.history-table th { color: var(--ink-dim); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.history-table a { color: var(--accent); font-weight: 600; }
.history-empty { text-align: center; color: var(--ink-dim); padding: 28px; font-size: .94rem; }

/* Report page */
.report-shell { padding: 48px 0 96px; }
.report-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px; box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.report-head .vin { font-family: 'Sora', sans-serif; font-size: 1.5rem; letter-spacing: .04em; }
.report-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.report-section {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.report-section h3 { margin-top: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: .94rem; }
.report-table th { color: var(--ink-dim); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.flag {
  display: inline-block; padding: 5px 13px; border-radius: 999px; font-size: .76rem; font-weight: 700;
}
.flag-clean { background: rgba(4, 120, 87, .12);  color: var(--good); border: 1px solid rgba(4, 120, 87, .35); }
.flag-warn  { background: rgba(180, 83, 9, .12);  color: var(--warn); border: 1px solid rgba(180, 83, 9, .35); }
.flag-bad   { background: rgba(159, 18, 57, .12); color: var(--bad);  border: 1px solid rgba(159, 18, 57, .35); }

/* Specs mascot peeking out of hero card */
.mascot-peek {
  position: absolute;
  top: -68px;
  right: -22px;
  width: 148px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(10, 74, 63, .28));
  transform: rotate(8deg);
  transition: transform .25s ease;
}
.hero-card:hover .mascot-peek { transform: rotate(0deg) translateY(-4px); }
@media (max-width: 540px) { .mascot-peek { width: 110px; top: -50px; right: -8px; } }

/* Footer */
.footer { background: var(--bg-2); padding: 56px 0 32px; border-top: 1px solid var(--line); margin-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-mute); margin-bottom: 14px; }
.footer a { display: block; color: var(--ink-dim); padding: 5px 0; font-size: .94rem; }
.footer a:hover { color: var(--ink); text-decoration: none; }
.disclaimer { padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink-mute); font-size: .82rem; line-height: 1.6; }

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin: 28px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
