:root {
  --bg: #0b0f1a;
  --bg-alt: #0f1422;
  --panel: #121a2b;
  --muted: #8793a7;
  --text: #e7edf7;
  --accent: #33d69f;
  --accent-2: #3b82f6;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --success: #10b981;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
  background: linear-gradient(180deg, var(--bg), var(--bg-alt));
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 0 1.25rem;
  margin: 0 auto;
}

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(15, 20, 34, 0.7);
  border-bottom: 1px solid rgba(135,147,167,0.15);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  color: var(--text);
  opacity: .85;
  padding: .4rem .6rem;
  border-radius: .5rem;
}

.nav-links a:hover {
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.1rem;
  border-radius: .8rem;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform .05s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #21b67f);
  color: #0b141f;
  box-shadow: 0 10px 30px rgba(51,214,159,.35);
}

.btn-primary:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--accent-2), #2563eb);
  color: #eaf2ff;
  box-shadow: 0 10px 30px rgba(59,130,246,.25);
}

.btn-outline {
  background: transparent;
  border-color: rgba(135,147,167,0.35);
  color: var(--text);
}

.hero {
  padding: 4rem 0 2rem;
  background:
    radial-gradient(800px 400px at 80% -50%, rgba(59,130,246,.15), transparent 60%),
    radial-gradient(700px 500px at -20% 0%, rgba(51,214,159,.18), transparent 60%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}

.kicker {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
  opacity: .9;
}

.hero h1 {
  font-size: clamp(2rem, 2.6vw + 1rem, 3rem);
  line-height: 1.15;
  margin: .6rem 0 1rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.panel {
  background: linear-gradient(180deg, rgba(18,26,43,1), rgba(18,26,43,.88));
  border: 1px solid rgba(135,147,167,0.15);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.vin-form {
  padding: 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: .8rem;
  border: 1px dashed rgba(135,147,167,0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: center;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.input {
  width: 100%;
  padding: .9rem 1rem;
  background: #0c1321;
  border: 1px solid rgba(135,147,167,0.25);
  border-radius: .7rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.input::placeholder {
  color: rgba(231,237,247,.5);
}

.input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(59,130,246,.15);
}

.helper {
  margin-top: .5rem;
  font-size: .9rem;
  color: var(--muted);
}

.error {
  margin-top: .5rem;
  font-size: .9rem;
  color: #fee2e2;
  background: #7f1d1d;
  border: 1px solid #ef4444;
  padding: .5rem .75rem;
  border-radius: .5rem;
}

.result-wrapper {
  margin-top: 1rem;
}

.result-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: #0c1425;
  border: 1px solid rgba(135,147,167,0.18);
  border-radius: .8rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .75rem 1rem;
}

@media (max-width: 560px) {
  .result-grid {
    grid-template-columns: 1fr;
  }
}

.kv {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(135,147,167,0.14);
  border-radius: .6rem;
  padding: .6rem .75rem;
}

.kv .k {
  color: var(--muted);
  font-size: .85rem;
}

.kv .v {
  font-weight: 600;
}

.warning-cta {
  background: rgba(245, 158, 11, .09);
  border: 1px solid rgba(245, 158, 11, .35);
  color: #fde68a;
  padding: .75rem .85rem;
  border-radius: .6rem;
  font-weight: 600;
}

.section {
  padding: 3rem 0;
}

.section h2 {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem);
  margin: 0 0 1rem;
}

.subtle {
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem;
}

@media (max-width: 840px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  background: #0c1425;
  border: 1px solid rgba(135,147,167,0.18);
  border-radius: .8rem;
  padding: 1rem;
}

.step .num {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 999rem;
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.35);
  color: #bfdbfe;
  font-weight: 700;
  margin-bottom: .5rem;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}

@media (max-width: 840px) {
  .benefits {
    grid-template-columns: 1fr;
  }
}

.benefit {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: .75rem;
  align-items: start;
  background: #0c1425;
  border: 1px solid rgba(135,147,167,0.18);
  border-radius: .8rem;
  padding: 1rem;
}

.badge {
  display: inline-block;
  padding: .25rem .5rem;
  border: 1px solid rgba(135,147,167,0.35);
  background: rgba(255,255,255,.03);
  border-radius: .5rem;
  font-size: .8rem;
  color: var(--muted);
}

.sample-report {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  background: #0c1425;
  border: 1px solid rgba(135,147,167,0.18);
  border-radius: .8rem;
  padding: 1rem;
}

@media (max-width: 700px) {
  .sample-report {
    grid-template-columns: 1fr;
  }
}

/* Image card for homepage illustration */
.image-card {
  margin-top: 1rem;
  background: #0c1425;
  border: 1px solid rgba(135,147,167,0.18);
  border-radius: .8rem;
  overflow: hidden;
}
.image-card img {
  display: block;
  width: 100%;
  height: auto;
}

/* Center/narrow variant for hero-adjacent illustration */
.image-center {
  max-width: 720px;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .image-center { max-width: 840px; }
}
html[data-theme="light"] .image-card {
  background: #ffffff;
  border-color: rgba(2,6,23,.12);
}

footer.site-footer {
  margin-top: 2rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(135,147,167,0.18);
  background: rgba(12,20,37,.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
}

hr.hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(135,147,167,0.18), transparent);
  margin: 2rem 0;
}

/* Utilities */
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}

@media (max-width: 840px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.95);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
  padding: .75rem 1rem;
  border-radius: .6rem;
  border: 1px solid transparent;
}

.alert-info {
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.4);
  color: #dbeafe;
}

.alert-success {
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.45);
  color: #d1fae5;
}

.alert-danger {
  background: rgba(244,63,94,.12);
  border-color: rgba(244,63,94,.48);
  color: #ffe4e6;
}

/* FAQ */
.faq {
  display: grid;
  gap: .75rem;
}

.faq-item {
  background: #0c1425;
  border: 1px solid rgba(135,147,167,0.18);
  border-radius: .8rem;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  text-align: left;
  padding: .9rem 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-a {
  display: none;
  padding: .75rem 1rem 1rem;
  color: var(--muted);
}

.faq-item.open .faq-a {
  display: block;
}

.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* THEME OVERRIDES */
/* Light theme (default) applied when html[data-theme="light"] is set.
   We override dark-specific surfaces to clean whites while keeping accents. */
html[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #ffffff;
  --panel: #ffffff;
  --muted: #475569;   /* slate-600 */
  --text: #0b1220;    /* near-slate-900 */
  --shadow: 0 10px 20px rgba(2,6,23,.08);
}

html[data-theme="light"] body {
  background: linear-gradient(180deg, var(--bg), var(--bg-alt));
  color: var(--text);
}

html[data-theme="light"] header.site-header {
  background: rgba(255,255,255,.85);
  border-bottom-color: rgba(2,6,23,.08);
}

html[data-theme="light"] .nav-links a:hover {
  background: rgba(2,6,23,.06);
}

html[data-theme="light"] .panel {
  background: var(--panel);
  border-color: rgba(2,6,23,.12);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .vin-form {
  background: rgba(0,0,0,0.02);
  border-color: rgba(2,6,23,.12);
}

html[data-theme="light"] .input {
  background: #ffffff;
  border-color: rgba(2,6,23,.18);
  color: var(--text);
}

html[data-theme="light"] .input::placeholder { color: rgba(2,6,23,.45); }

html[data-theme="light"] .result-card,
html[data-theme="light"] .kv,
html[data-theme="light"] .step,
html[data-theme="light"] .benefit,
html[data-theme="light"] .sample-report {
  background: #ffffff;
  border-color: rgba(2,6,23,.12);
}

html[data-theme="light"] .warning-cta {
  color: #92400e;
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.35);
}

html[data-theme="light"] footer.site-footer {
  background: rgba(2,6,23,.04);
  border-top-color: rgba(2,6,23,.08);
}

html[data-theme="light"] .alert-info {
  background: rgba(59,130,246,.10);
  border-color: rgba(59,130,246,.25);
  color: #1e3a8a;
}
html[data-theme="light"] .alert-success {
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.25);
  color: #065f46;
}
html[data-theme="light"] .alert-danger {
  background: rgba(244,63,94,.10);
  border-color: rgba(244,63,94,.25);
  color: #991b1b;
}

/* Light theme fixes for FAQ visibility */
html[data-theme="light"] .faq-item {
  background: #ffffff;
  border-color: rgba(2,6,23,.12);
}
html[data-theme="light"] .faq-q {
  color: #0b1220;
}

/* Mobile-specific layout fixes */
@media (max-width: 640px) {
  body { overflow-x: hidden; }

  header.site-header .navbar {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
  }

  .brand {
    justify-content: center;
    width: 100%;
  }

  .nav-links {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem .75rem;
  }

  .nav-links a,
  .nav-links .btn,
  .nav-links button.btn {
    padding: .6rem .85rem;
  }

  .hero {
    padding: 2.5rem 0 1.25rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
