/* CP Coverage landing pages: shared base (PLAN section 4, QUIZ-SPEC sections 12 and 13).
   Owns tokens, reset, type, layout helpers, the quiz and its form controls, buttons, header,
   footer, sticky mobile CTA, focus styles, reduced motion and the build-note tag.
   A variant's skin.css may only override the tokens in the first :root block and add classes
   prefixed with its variant id. It never restyles .quiz-*, .site-footer or .sticky-cta. */

/* ---------- Tokens a skin may override (defaults are v1's values) ---------- */
:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --text: #14171C;
  --text-muted: #5A6170;
  --border: rgb(20 23 28 / 0.10);
  --accent: #0F5C8C;
  --accent-600: #0B4A71;
  --accent-50: #E8F1F7;
  --on-accent: #FFFFFF;
  --focus: var(--accent);
  --progress-fill: var(--accent);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);
  --display-weight: 700;
  --display-tracking: -0.02em;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgb(20 23 28 / 0.05), 0 6px 16px rgb(20 23 28 / 0.06);
  --space-section: 64px;
}

/* ---------- Fixed base values (not skin tokens) ---------- */
:root {
  --danger: #B42318;
  --input-border: color-mix(in srgb, var(--text) 50%, var(--surface));
  --control-border: color-mix(in srgb, var(--text) 24%, var(--surface));
  --track: color-mix(in srgb, var(--text) 10%, var(--surface));
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --icon-checkbox: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E");
  --icon-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ol, ul, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.15em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- Type (scale 1.25: 13 14 16 20 25 31 39 49) ---------- */
h1, .h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  line-height: 1.25;
}
h1, .h1 { font-size: 31px; line-height: 1.15; text-wrap: balance; }
.eyebrow {
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.lead { max-width: 60ch; margin-top: 12px; font-size: 17px; line-height: 1.5; color: var(--text-muted); }
.small, .trust-line, .carrier-tiles, .quiz-note { font-size: 14px; line-height: 1.5; }
@media (min-width: 768px) { h1, .h1 { font-size: 39px; } }
@media (min-width: 1024px) {
  h1, .h1 { font-size: 49px; line-height: 1.1; }
  .lead { font-size: 20px; }
}

/* ---------- Page layout helpers ---------- */
.container { box-sizing: content-box; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  min-height: 48px;
  padding: 6px max(16px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid var(--border);
}
.site-header__brand { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: var(--display-tracking); }
.site-header__note { font-size: 14px; color: var(--text-muted); }

/* Section rhythm: half the gap on each side, so neighbours sit one --space-section apart at 768+ and
   0.75 of it under 768 (48px with the default token, the rhythm every brief asks for at 390). */
.hero { box-sizing: content-box; max-width: 1120px; margin-inline: auto; padding: 24px 16px calc(var(--space-section) * 0.375); }
.hero--stacked { text-align: center; }
.hero--stacked .lead { margin-inline: auto; }
.hero > .quiz, .hero__quiz { margin-top: 24px; }
.hero .trust-line { margin-top: 16px; color: var(--text-muted); }
.hero__aside { margin-top: 24px; }
@media (min-width: 768px) {
  .container { padding-inline: 24px; }
  .hero { padding: 48px 24px calc(var(--space-section) / 2); }
}
@media (min-width: 1024px) {
  .hero { padding-top: 64px; }
  .hero--split {
    display: grid;
    grid-template-columns: minmax(0, 600px) minmax(0, 520px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "copy quiz" "aside quiz";
    justify-content: space-between;
    align-items: start;
    column-gap: 48px;
  }
  .hero--split > .hero__copy { grid-area: copy; }
  /* margin 0: auto inline margins on a grid item would shrink the card to its content width */
  .hero--split > .quiz, .hero--split > .hero__quiz { grid-area: quiz; margin: 0; }
  .hero--split > .hero__aside { grid-area: aside; }
}

.section { box-sizing: content-box; max-width: 720px; margin-inline: auto; padding: calc(var(--space-section) * 0.375) 16px; }
.section > * + * { margin-top: 16px; }
.section > .section__title + * { margin-top: 20px; }
.section__title { font-size: 25px; line-height: 1.2; }
@media (min-width: 768px) { .section { padding: calc(var(--space-section) / 2) 24px; } }
@media (min-width: 1024px) { .section__title { font-size: 31px; } }

.steps { counter-reset: mp-step; display: grid; gap: 20px; }
.steps > li {
  counter-increment: mp-step;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 16px;
  font-size: 17px;
  line-height: 1.5;
}
.steps > li::before {
  content: counter(mp-step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: -5px;
  border: 1px solid var(--control-border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon-plus) center / 20px no-repeat;
  mask: var(--icon-plus) center / 20px no-repeat;
  transition: transform 180ms ease-out;
}
.faq details[open] > summary::after { transform: rotate(45deg); }
.faq details > :not(summary) { padding-bottom: 16px; }

.carrier-tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.carrier-tiles > li {
  display: grid;
  place-items: center;
  width: 120px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
}

.build-note {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: #FFE58A;
  color: #4A3B00;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.6;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 0.1em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.site-footer {
  padding: 32px max(16px, calc((100% - 1120px) / 2)) 48px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}
.site-footer p + p { margin-top: 8px; }
.site-footer strong { color: var(--text); }
.site-footer__links a { margin-right: 12px; color: var(--text); }

/* ---------- Quiz card ---------- */
.quiz {
  position: relative;
  max-width: 520px;
  margin-inline: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  scroll-margin-top: 16px;
}
@media (min-width: 768px) { .quiz { padding: 32px; } }
@media (min-width: 1024px) {
  .quiz--wide { max-width: 880px; }
  .quiz--wide .quiz-screen:not(.quiz-screen--tiles) { max-width: 520px; margin-inline: auto; }
}
.quiz-screen.is-entering { animation: quiz-in 180ms ease-out both; }
@keyframes quiz-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.quiz-topbar { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: -8px 0 12px; }
.quiz-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  margin-left: -8px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.quiz-back::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon-chevron) center / 20px no-repeat;
  mask: var(--icon-chevron) center / 20px no-repeat;
}
.quiz-progress { flex: 1; display: grid; justify-items: end; gap: 6px; }
.quiz-progress__text { font-size: 14px; line-height: 1.2; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.quiz-progress__bar { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.quiz-progress__bar > span { display: block; width: var(--pct, 0%); height: 100%; border-radius: inherit; background: var(--progress-fill); }

.quiz-question { font-size: 20px; line-height: 1.3; }
.quiz-sub { margin-top: 6px; font-size: 16px; line-height: 1.5; color: var(--text-muted); }
.quiz-message { margin-top: 8px; font-size: 16px; line-height: 1.6; }
@media (min-width: 768px) { .quiz-question { font-size: 25px; } }

/* Text fields */
.quiz-field { margin-top: 16px; }
.quiz-field + .quiz-field { margin-top: 12px; }
.quiz-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text-muted); }
.quiz-input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: max(16px, 1.0625rem);
  line-height: 1.2;
  -webkit-appearance: none;
  appearance: none;
}
.quiz-input:focus { border-color: var(--focus); }
.quiz-input[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }

/* Option buttons and tiles */
.quiz-options { display: grid; gap: 8px; margin-top: 16px; }
.quiz-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 48px 12px 16px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.quiz-option:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.quiz-option.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-50); }
.quiz-option.is-selected::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  background: var(--focus);
  -webkit-mask: var(--icon-check) center / 20px no-repeat;
  mask: var(--icon-check) center / 20px no-repeat;
}
@media (hover: hover) { .quiz-option:hover { border-color: var(--accent); } }
.quiz-option__icon {
  flex: none;
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--icon) center / 24px no-repeat;
  mask: var(--icon) center / 24px no-repeat;
}
/* Tile icons (beneficiary screen only, when it is the first step): 24px, 1.75 stroke, currentColor. */
.quiz-option[data-value="spouse"] .quiz-option__icon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='13' r='5.25'/%3E%3Ccircle cx='15' cy='13' r='5.25'/%3E%3Cpath d='M10.5 4.5h3L12 6.5z'/%3E%3C/svg%3E"); }
.quiz-option[data-value="children"] .quiz-option__icon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='6.5' r='2.25'/%3E%3Cpath d='M12 9v6M8.5 11.5h7M12 15l-2.75 5M12 15l2.75 5'/%3E%3C/svg%3E"); }
.quiz-option[data-value="family"] .quiz-option__icon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 11 12 4l8.5 7'/%3E%3Cpath d='M6 9.5V20h12V9.5'/%3E%3Cpath d='M10 20v-5.5h4V20'/%3E%3C/svg%3E"); }
.quiz-option[data-value="other"] .quiz-option__icon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7'/%3E%3C/svg%3E"); }
@media (min-width: 768px) { .quiz-options { gap: 10px; } }
@media (min-width: 1024px) {
  .quiz--wide .quiz-options--tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .quiz--wide .quiz-options--tiles .quiz-option {
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    min-height: 120px;
    padding: 28px 12px 16px;
    text-align: center;
  }
  .quiz--wide .quiz-options--tiles .quiz-option.is-selected::after { top: 10px; right: 10px; margin-top: 0; }
}

/* Buttons */
.quiz-actions { margin-top: 20px; }
.quiz-next, .quiz-submit, .sticky-cta__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 8px 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.quiz-next:active, .quiz-submit:active, .sticky-cta__button:active { background: var(--accent-600); }
@media (hover: hover) {
  .quiz-next:hover, .quiz-submit:hover, .sticky-cta__button:hover { background: var(--accent-600); }
}
.quiz-note { margin-top: 12px; color: var(--text-muted); text-align: center; }
.quiz-restart {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 12px 0 0 -4px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Errors: text plus a warning glyph, never color alone */
.quiz-error { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; color: var(--danger); font-size: 16px; font-weight: 500; line-height: 1.4; }
.quiz-error svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Consent: 24px box with a 44px hit area (transparent border), 15px label */
.quiz-consent {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 8px;
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--accent-50);
}
.quiz-consent input[type="checkbox"] {
  width: 44px;
  height: 44px;
  margin: -10px;
  border: 10px solid transparent;
  border-radius: 14px;
  background: var(--surface) padding-box;
  box-shadow: inset 0 0 0 2px var(--text-muted);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.quiz-consent input[type="checkbox"]:checked { background: var(--focus) var(--icon-checkbox) center / 16px no-repeat padding-box; box-shadow: inset 0 0 0 2px var(--focus); }
.quiz-consent input[type="checkbox"][aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
.quiz-consent input[type="checkbox"]:focus-visible { outline: 3px solid var(--focus); outline-offset: -7px; }
.quiz-consent__text { font-size: 16px; line-height: 1.4; }
.quiz-consent label { font-size: 15px; line-height: 1.5; color: var(--text); cursor: pointer; }
.quiz-consent .quiz-error, .quiz-consent > .build-note { grid-column: 2; margin-top: 0; }
.quiz-consent > .build-note { justify-self: start; }

/* ---------- Sticky mobile CTA (engine adds it; under 768px only) ---------- */
.sticky-cta { display: none; }
@media (max-width: 767.98px) {
  body.has-sticky-cta { padding-bottom: 88px; }
  .sticky-cta {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: block;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 -4px 16px rgb(20 23 28 / 0.08);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 180ms ease-out, visibility 0s linear 180ms;
  }
  .sticky-cta.is-visible { transform: none; visibility: visible; transition: transform 180ms ease-out, visibility 0s; }
}

/* ---------- Reduced motion: no screen transition, no slide, no rotation ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
