/* Layout: centered logo header, then one narrow column (progress bar, big question, full-width answer rows). */
:root {
  --brand: #d71920;
  --brand-dark: #b0141a;
  --brand-soft: #fff5f5;
  --brand-tint: #fde3e4;
  --ink: #17202a;
  --muted: #5b6470;
  --line: #c9ced4;
  --line-soft: #e4e7eb;
  --track: #e2e4e7;
  --bg: #ffffff;
  --card: #ffffff;
  --field: #ffffff;
  --on-brand: #ffffff;
  --danger: #b91c1c;
  --danger-tint: #fee2e2;
  --ok: #15803d;
  --ok-tint: #dcfce7;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --footer-bg: #17202a;
  --footer-ink: #c3c9d0;
  --footer-link: #eef1f4;
  --footer-dim: #8d96a0;
  --backdrop: rgba(17, 24, 39, 0.55);
  --disabled: #a3a9b1;
  --radius: 8px;
  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #f0444a; --brand-dark: #ff6b70; --brand-soft: #2a1516; --brand-tint: #3d1a1c;
    --ink: #eef1f4; --muted: #a4adb7; --line: #3b434c; --line-soft: #2a3038; --track: #2f363e;
    --bg: #12161b; --card: #181d23; --field: #181d23; --on-brand: #ffffff;
    --danger: #f87171; --danger-tint: #3b1a1a; --ok: #4ade80; --ok-tint: #12301e;
    --warn-bg: #2b2412; --warn-line: #5c4a16;
    --footer-bg: #0b0e12; --footer-ink: #a4adb7; --footer-link: #e3e7eb; --footer-dim: #77808a;
    --backdrop: rgba(0, 0, 0, 0.65); --disabled: #4b5563;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #f0444a; --brand-dark: #ff6b70; --brand-soft: #2a1516; --brand-tint: #3d1a1c;
  --ink: #eef1f4; --muted: #a4adb7; --line: #3b434c; --line-soft: #2a3038; --track: #2f363e;
  --bg: #12161b; --card: #181d23; --field: #181d23; --on-brand: #ffffff;
  --danger: #f87171; --danger-tint: #3b1a1a; --ok: #4ade80; --ok-tint: #12301e;
  --warn-bg: #2b2412; --warn-line: #5c4a16;
  --footer-bg: #0b0e12; --footer-ink: #a4adb7; --footer-link: #e3e7eb; --footer-dim: #77808a;
  --backdrop: rgba(0, 0, 0, 0.65); --disabled: #4b5563;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); }

/* ---------- Header: centered logo ---------- */
.site-header {
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 16px;
  display: flex;
  justify-content: center;
}
.logo { display: inline-flex; color: var(--ink); text-decoration: none; }
.logo svg { height: 54px; width: auto; max-width: 100%; display: block; }

main { flex: 1; }

/* ---------- Quiz ---------- */
.quiz {
  max-width: 932px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}
.intro {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 28px;
}

.progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.progress-bar {
  height: 11px;
  background: var(--track);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 56px;
}
.progress-bar .fill {
  height: 100%;
  width: 0;
  min-width: 18px;
  background: var(--brand);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.step { display: none; animation: fade 0.3s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero h1, .step h2, .page h1 { text-wrap: balance; }
.step h2 {
  font-size: clamp(1.7rem, 4.2vw, 2.9rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 auto 48px;
  max-width: 680px;
  text-align: center;
  letter-spacing: -0.01em;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.option {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: var(--radius);
  padding: 22px 24px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.option::before {
  content: "";
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--field);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.option:hover { border-color: var(--brand); color: var(--ink); }
.option:hover::before { border-color: var(--brand); }
.option.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.option.selected::before { border-color: var(--brand); box-shadow: inset 0 0 0 9px var(--field), inset 0 0 0 30px var(--brand); }
.option:focus-visible, .btn:focus-visible, select:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

label.field-label {
  display: block;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 8px;
}
select, input, textarea {
  width: 100%;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-family: inherit;
  background: var(--field);
  color: var(--ink);
  margin-bottom: 20px;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); }

.btn {
  display: inline-block;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  padding: 18px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { background: var(--disabled); cursor: not-allowed; }
.btn.secondary {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px;
  margin-top: 12px;
}
.btn.secondary:hover { color: var(--brand); background: transparent; }

.error { color: var(--danger); font-size: 1rem; margin: -10px 0 14px; min-height: 1em; }

.trust {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 36px;
  color: var(--muted);
  font-size: 0.95rem;
}
.trust span::before { content: "✓ "; color: var(--brand); font-weight: 700; }

/* ---------- Loading ---------- */
.loading { text-align: center; padding: 10px 0; }
.spinner {
  width: 64px;
  height: 64px;
  border: 6px solid var(--track);
  border-top-color: var(--brand);
  border-radius: 50%;
  margin: 0 auto 28px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps { list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 1.15rem; }
.loading-steps li { padding: 6px 0; opacity: 0.35; transition: opacity 0.3s; }
.loading-steps li.done { opacity: 1; color: var(--ink); }
.loading-steps li.done::before { content: "✓ "; color: var(--brand); font-weight: 700; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card);
  border-radius: 14px;
  max-width: 460px;
  width: 100%;
  padding: 36px 26px 26px;
  text-align: center;
  position: relative;
  border-top: 6px solid var(--brand);
  animation: pop 0.35s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .badge {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 2.3rem;
}
.modal .badge.ok { background: var(--brand-tint); }
.modal .badge.no { background: var(--danger-tint); }
.modal h3 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 10px; }
.modal p { color: var(--muted); margin: 0 0 20px; font-size: 1.05rem; }
.modal .close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: 0;
  font-size: 1.7rem;
  color: var(--muted);
  cursor: pointer;
}
.modal .summary {
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 1rem;
  margin-bottom: 22px;
}
.modal .summary div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.modal .summary b { color: var(--ink); text-align: right; }

/* ---------- Content pages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 48px 16px 64px; font-size: 1.08rem; }
.page h1 { margin-top: 0; font-size: 2.2rem; line-height: 1.2; }
.page h2 { font-size: 1.3rem; margin-top: 30px; }
.page .updated { color: var(--muted); font-size: 0.95rem; }
.page .card { border: 1px solid var(--line-soft); border-radius: 12px; padding: 24px; background: var(--card); }
.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.98rem;
  margin-bottom: 20px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); font-size: 0.95rem; }
.site-footer .wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.site-footer a { color: var(--footer-link); text-decoration: none; margin-right: 18px; }
.site-footer a:hover { text-decoration: underline; }
.disclaimer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px 26px;
  color: var(--footer-dim);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .site-header .wrap { padding: 18px 16px; }
  .logo svg { height: 40px; }
  .quiz { padding-top: 32px; }
  .progress-bar { margin-bottom: 36px; }
  .step h2 { margin-bottom: 32px; }
  .options { gap: 14px; }
  .option { padding: 16px; font-size: 1.12rem; gap: 14px; }
  .option::before { width: 36px; height: 36px; }
  .option.selected::before { box-shadow: inset 0 0 0 6px var(--field), inset 0 0 0 30px var(--brand); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Consent checkbox (quote page) ---------- */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 4px 0 20px;
  cursor: pointer;
}
.consent input {
  width: 22px;
  height: 22px;
  flex: none;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--brand);
}
.consent span { min-width: 0; }
