/* Home insurance quiz - Comparisons.org (v1). HTML + CSS only. Mobile first. */

:root {
  --green: #047857;
  --green-dark: #065f46;
  --mint: #ecfdf5;
  --red: #dc2626;
  --ink: #0f172a;
  --muted: #475569;
  --soft: #64748b;
  --line: #e2e5e8;
  --bg: #f2f4f7;
  --white: #fff;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
svg { display: block; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.step-radio { top: 0; left: 0; }
.nowrap { white-space: nowrap; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header (approved component) ---------- */
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}
.brand-row__brand { flex: 0 1 181px; min-width: 0; }
.brand-row__logo { width: 181px; height: auto; mix-blend-mode: multiply; }
.disclosure-link {
  flex: none;
  font-size: 11px;
  line-height: 16px;
  color: var(--soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.disclosure-link:hover { color: var(--green); }
/* Advertiser Disclosure: step 1 only */
.page:has(.step-radio:not(#s1):checked) .disclosure-link { visibility: hidden; }

/* ---------- Main / quiz ---------- */
.main { padding: 8px 16px 0; }
/* From step 2 on, the quiz fills the screen so the footer is never above the fold. */
.page:has(.step-radio:not(#s1):checked) .main { min-height: calc(100svh - 59px); }

.quiz {
  max-width: 560px;
  margin: 0 auto;
  padding-top: 12px;
  text-align: center;
}

/* Hero (step 1 only) */
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}
.hero__title {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero__sub {
  margin-top: 10px;
  font-size: 16px;
  color: var(--muted);
  text-wrap: balance;
}
.tags {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.tags li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 12.5px;
  font-weight: 600;
}
.tags svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Progress (step 2 on) */
.progress { display: none; margin-bottom: 20px; text-align: left; }
.page:has(.step-radio:not(#s1):checked) .progress { display: block; }
.page:has(.step-radio:not(#s1):checked) .hero { display: none; }
.progress__row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}
.progress__pct { color: var(--soft); }
.progress .p { display: none; }
.page:has(#s2:checked) .p2,
.page:has(#s3:checked) .p3,
.page:has(#s4:checked) .p4,
.page:has(#s5:checked) .p5,
.page:has(#s6:checked) .p6 { display: inline; }
.progress__bar {
  display: block;
  margin-top: 8px;
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.progress__fill {
  display: block;
  height: 100%;
  width: 17%;
  border-radius: inherit;
  background: var(--green);
  transition: width 300ms ease;
}
.page:has(#s2:checked) .progress__fill { width: 33.33%; }
.page:has(#s3:checked) .progress__fill { width: 50%; }
.page:has(#s4:checked) .progress__fill { width: 66.67%; }
.page:has(#s5:checked) .progress__fill { width: 83.33%; }
.page:has(#s6:checked) .progress__fill { width: 100%; }

/* Steps */
.step { display: none; animation: stepIn 250ms ease-out; }
.page:has(#s1:checked) .step--1,
.page:has(#s2:checked) .step--2,
.page:has(#s3:checked) .step--3,
.page:has(#s4:checked) .step--4,
.page:has(#s5:checked) .step--5,
.page:has(#s6:checked) .step--6 { display: block; }
.page:has(#s1:checked) .step--1 { margin-top: 28px; }
@keyframes stepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.q__title {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.q__sub { margin-top: 6px; font-size: 15px; color: var(--muted); }

/* Answer options */
.options {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}
.options--2 { grid-template-columns: 1fr 1fr; }
.option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 150ms, background-color 150ms, box-shadow 150ms;
  -webkit-tap-highlight-color: transparent;
}
/* hover only on real mouse devices: on phones the tap spot would look "pre-selected" on the next step */
@media (hover: hover) {
  .option:hover { border-color: var(--green); background: var(--mint); }
}
.option:active { transform: scale(0.98); }
.option--full { grid-column: 1 / -1; }

/* Icon cards (steps 1, 2, 4) */
.options--icon .option {
  flex-direction: column;
  gap: 10px;
  min-height: 132px;
  font-size: 19px;
}
.option__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
}
.option__icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.option__icon--no { background: #fef2f2; color: var(--red); }
/* Property types (8): compact row cards so all 8 + Back fit on a small phone */
.options--sm { gap: 10px; }
.options--sm .option {
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  min-height: 64px;
  padding: 10px 12px;
  font-size: 15px;
  text-align: left;
  line-height: 1.2;
}
.options--sm .option__icon { flex: none; width: 38px; height: 38px; }
.options--sm .option__icon svg { width: 22px; height: 22px; }
.option { min-width: 0; }
/* Very narrow phones (320px): icon above the text so "Manufactured" fits */
@media (max-width: 359px) {
  .options--sm .option { flex-direction: column; justify-content: center; gap: 6px; min-height: 76px; padding: 8px 6px; text-align: center; }
  .options--sm .option__icon { width: 32px; height: 32px; }
  .options--sm .option__icon svg { width: 19px; height: 19px; }
}

/* Credit rows */
.option--row { justify-content: space-between; padding: 12px 18px; }
.option--row strong { font-weight: 700; }
.option--row span { font-size: 15px; font-weight: 500; color: var(--muted); }

/* Back */
.q__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 18px;
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--soft);
  cursor: pointer;
}
.q__back:hover { color: var(--ink); }
.q__back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ZIP */
.zip { margin-top: 20px; display: grid; gap: 12px; }
.zip__field { position: relative; display: block; }
.zip__field svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--soft);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.zip__input {
  width: 100%;
  height: 58px;
  padding: 0 16px 0 48px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.zip__input::placeholder { color: #a7b0bd; font-weight: 500; }
.zip__input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15); }

/* CTA */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: var(--white);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms;
}
.cta:hover { background: var(--green-dark); }

/* Trust row (all steps) */
.trust {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--soft);
}
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 16px; height: 16px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Content under the quiz (step 1 only) ---------- */
.page:has(.step-radio:not(#s1):checked) .below { display: none; }
.below { max-width: 560px; margin: 48px auto 0; }
.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--soft);
  text-align: center;
}
.partners__grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.partners__slot {
  display: grid;
  place-items: center;
  height: 72px;
  padding: 0 6px;
}
/* Wordmarks fill the slot width; the stacked Liberty Mutual logo is capped by height so all 4 look balanced */
.partners__slot img { width: 100%; height: auto; max-height: 40px; object-fit: contain; }
.partners__slot .partners__logo--tall { max-height: 60px; }
.partners__slot .partners__logo--bold { max-height: 27px; } /* Allstate: heavy wordmark, slightly smaller to match the others */

.block {
  margin-top: 24px;
  padding: 24px 20px;
  border-radius: 18px;
  background: var(--white);
}
.block__title { font-size: 22px; line-height: 1.25; font-weight: 800; text-wrap: balance; }
.block p { margin-top: 12px; font-size: 16px; color: var(--muted); }
.checks { margin-top: 14px; display: grid; gap: 12px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; color: var(--ink); }
.checks__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--green);
}
.checks__icon svg { width: 14px; height: 14px; fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.closing {
  margin-top: 40px;
  padding: 24px 20px 28px;
  border-radius: 18px;
  background: var(--mint);
  text-align: center;
}
/* IMAGE PLACEHOLDER - replace with <img> (width/height + loading="lazy") */
.closing__title { font-size: 24px; line-height: 1.25; font-weight: 800; text-wrap: balance; }
.closing__sub { margin: 8px 0 20px; font-size: 16px; color: var(--muted); }

/* ---------- Footer (approved component) - 200px below the content (more than the 150px default, per request) ---------- */
.footer {
  margin-top: 200px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer__inner { max-width: 820px; padding-top: 32px; padding-bottom: 32px; text-align: center; }
.footer__lead { font-size: 15px; font-weight: 600; color: var(--soft); }
.footer__copy { margin-top: 16px; font-size: 12px; color: var(--muted); }
.footer__legal { margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.footer__links {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  font-size: 14px;
}
.footer__links a { color: var(--green); text-decoration: none; }
.footer__links a:hover { text-decoration: underline; }

/* ---------- Advertiser Disclosure dialog (approved component) ---------- */
#disclosure-toggle { position: fixed; top: 0; left: 0; }
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.page:has(#disclosure-toggle:checked) .modal { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); cursor: pointer; }
.modal__box {
  position: relative;
  width: 100%;
  max-width: 520px;
  padding: 28px 28px 24px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.45);
}
.modal__title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.modal__box p { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.modal__close { position: absolute; top: 10px; right: 14px; font-size: 26px; line-height: 1; color: var(--soft); cursor: pointer; }
.modal__close:hover { color: var(--ink); }

/* ---------- Loading (after the ZIP step, shown with :target) ---------- */
.loading { display: none; text-align: center; padding-top: 40px; scroll-margin-top: 200px; /* keep the header in view */ }
.page:has(#loading:target) .loading { display: block; }
.page:has(#loading:target) .quiz,
.page:has(#loading:target) .below,
.page:has(#loading:target) .disclosure-link { display: none; }
/* footer never above the fold */
.page:has(#loading:target) .main { min-height: calc(100svh - 59px); }
.spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border: 5px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
.loading__title { margin-top: 20px; font-size: 22px; font-weight: 800; }
.loading__list { margin: 20px auto 0; display: grid; gap: 12px; width: fit-content; text-align: left; }
.loading__list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--muted);
  opacity: 0;
  animation: fadeIn 300ms ease-out forwards;
}
.loading__list li:nth-child(1) { animation-delay: 0s; }
.loading__list li:nth-child(2) { animation-delay: 0.8s; }
.loading__list li:nth-child(3) { animation-delay: 1.6s; }
.loading__list .checks__icon { margin-top: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { to { opacity: 1; } }

/* ---------- >=640px ---------- */
@media (min-width: 640px) {
  .hero__title { font-size: 36px; }
  .q__title { font-size: 28px; }
  .partners__grid { grid-template-columns: repeat(4, 1fr); }
  .block, .closing { padding: 32px; }
}

/* ---------- >=1024px ---------- */
@media (min-width: 1024px) {
  .brand-row { padding: 14px 30px; }
  .main { padding-top: 24px; }
  .hero__title { font-size: 40px; }
  .quiz, .below { max-width: 640px; }
}

@media (prefers-reduced-motion: reduce) {
  .step, .option, .progress__fill { animation: none; transition: none; }
}
