:root {
  --bg: #f8fafc;
  --bg-soft: #eef2f7;
  --panel: #ffffff;
  --panel-border: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --accent: #0f766e;
  --good: #0f766e;
  --warn: #b45309;
  --bad: #b91c1c;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  --radius: 20px;
  --radius-sm: 14px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

.page-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 24px 0 40px;
  position: relative;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px 18px;
  margin-bottom: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: white;
  background: linear-gradient(135deg, var(--brand), #60a5fa);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 0.98rem;
}

.brand-text span,
.topnav a,
.eyebrow,
.stat-label,
.progress-meta,
.footer {
  color: var(--muted);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 32px;
  padding: 34px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  margin: 0 0 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(2.5rem, 5vw, 4.9rem);
  line-height: 0.96;
  margin-bottom: 18px;
  max-width: 12ch;
}

h2,
h3 {
  font-family: "Space Grotesk", "Manrope", sans-serif;
}

.lede {
  font-size: 1.08rem;
  line-height: 1.7;
  color: #334155;
  max-width: 66ch;
  margin-bottom: 24px;
}

.hero-actions,
.form-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--brand-strong);
  color: white;
}

.button-secondary {
  background: white;
  border-color: rgba(37, 99, 235, 0.14);
  color: var(--text);
}

.trust-list,
.checklist,
.source-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.trust-list li,
.checklist li,
.source-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.trust-list li::before,
.checklist li::before,
.source-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.hero-card {
  display: none;
}

.content-grid,
.explain-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.content-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
}

.explain-grid {
  grid-template-columns: 1fr;
}

.panel {
  border-radius: 28px;
  padding: 28px;
}

.panel-header {
  margin-bottom: 22px;
}

.panel-header p:last-child {
  color: var(--muted);
  line-height: 1.65;
}

.scan-form {
  display: grid;
  gap: 18px;
}

.scan-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(37, 99, 235, 0.14);
  background:
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow:
    0 18px 38px rgba(15, 23, 42, 0.05),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
}

.scan-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.05), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 35%);
}

.scan-panel > * {
  position: relative;
  z-index: 1;
}

.progress-wrap {
  padding: 20px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 10px 24px rgba(37, 99, 235, 0.04);
}

.wizard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.wizard-step {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(135deg, #1d4ed8, #2563eb 58%, #3b82f6);
  box-shadow:
    0 10px 24px rgba(37, 99, 235, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.wizard-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #dbe7f5;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 56%, #0f766e 100%);
  transition: width 260ms ease;
}

.question-stack {
  min-height: 320px;
}

.question {
  margin: 0;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: #ffffff;
  box-shadow:
    0 12px 28px rgba(37, 99, 235, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.question[hidden] {
  display: none;
}

.question.is-active {
  animation: stepFade 180ms ease-out;
}

.question legend {
  padding: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
}

.choices {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.choices label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.10);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  line-height: 1.45;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.choices label:hover {
  border-color: rgba(37, 99, 235, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.05);
}

.choices label.is-selected {
  border-color: rgba(37, 99, 235, 0.45);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, rgba(255, 255, 255, 0.94) 100%);
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.10) inset,
    0 10px 24px rgba(37, 99, 235, 0.06);
}

.choices input {
  margin-top: 3px;
  accent-color: var(--brand-strong);
  flex: none;
}

.wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
}

.wizard-nav .button {
  min-width: 128px;
}

.wizard-nav .button-primary {
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.18);
}

.wizard-nav .button-secondary {
  background: rgba(255, 255, 255, 0.92);
}

#next-step,
#submit-scan {
  margin-left: auto;
}

#submit-scan[hidden],
#next-step[hidden] {
  display: none;
}

@keyframes stepFade {
  from {
    opacity: 0.2;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: white;
  margin-bottom: 14px;
}

.result-score {
  font-size: 1.55rem;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 12px;
}

.result-text {
  color: #334155;
  line-height: 1.7;
  margin-bottom: 0;
}

.result-actions {
  margin-top: 16px;
}

.info-panel h2,
.faq-panel h2,
.sources-panel h2,
.result-panel h2,
.promo-panel h2,
.scan-panel h2 {
  margin-bottom: 12px;
  line-height: 1.15;
}

.promo-panel {
  margin-bottom: 24px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(15, 118, 110, 0.06)),
    #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.promo-panel p {
  max-width: 74ch;
}

.promo-actions {
  margin-top: 18px;
}

.promo-panel .button-primary {
  min-width: 220px;
}

.note {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: #f0fdfa;
  color: #134e4a;
  line-height: 1.65;
}

.faq-list {
  display: grid;
  gap: 12px;
}

details {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: white;
  padding: 0 18px;
}

summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 700;
}

details p {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.source-list a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 4px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer a {
  color: var(--brand);
}

.low-risk {
  border-color: rgba(15, 118, 110, 0.18);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.08) inset;
}

.mid-risk {
  border-color: rgba(180, 83, 9, 0.18);
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.08) inset;
}

.high-risk {
  border-color: rgba(185, 28, 28, 0.18);
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.08) inset;
}

.low-risk .result-badge,
.mid-risk .result-badge,
.high-risk .result-badge {
  background: white;
}

.low-risk .result-score {
  color: #0f766e;
}

.mid-risk .result-score {
  color: #b45309;
}

.high-risk .result-score {
  color: #b91c1c;
}

.low-risk .result-badge {
  color: #0f766e;
}

.mid-risk .result-badge {
  color: #b45309;
}

.high-risk .result-badge {
  color: #b91c1c;
}

.is-good {
  color: var(--good);
}

.is-warn {
  color: var(--warn);
}

.is-bad {
  color: var(--bad);
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .topbar,
  .footer {
    flex-direction: column;
  }

  .hero,
  .content-grid,
  .explain-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    border-radius: 28px;
    align-items: flex-start;
  }

  .topnav {
    justify-content: flex-start;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 22px;
  }

  h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max));
    padding-top: 10px;
  }

  .topbar {
    padding: 18px;
    margin-bottom: 18px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    border-radius: 24px;
  }

  .hero {
    gap: 18px;
  }

  .choices label {
    padding: 10px 12px;
  }

  .wizard-top,
  .wizard-nav,
  .progress-meta,
  .hero-actions,
  .result-actions,
  .footer {
    flex-direction: column;
  }

  .wizard-nav .button {
    width: 100%;
    min-width: 0;
  }

  #next-step,
  #submit-scan {
    margin-left: 0;
  }

  .progress-meta,
  .hero-actions,
  .result-actions {
    gap: 10px;
  }

  .button {
    width: 100%;
  }
}
