/*
 * Quiz design system: HealthForMoms palette taken from healthformoms.com —
 * periwinkle canvas, white cards, #6987F1 brand blue — on a compact quiz
 * layout (segmented progress, bordered option cards, benefit checkmarks).
 */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'DM Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url('fonts/dm-sans-latin-normal.woff2') format('woff2-variations');
}

:root {
  /* HealthForMoms palette, measured from healthformoms.com. Brand blue is the
     single accent (counter, CTA, progress, card borders) and the pale
     periwinkle canvas replaces flat white. */
  --bg: #e4eaff;            /* page canvas  */
  --surface: #ffffff;       /* cards, inputs */
  --brand: #6987f1;         /* HealthForMoms blue: accents, CTA, progress */
  --brand-soft: rgba(105, 135, 241, .35);
  --brand-mid: rgba(105, 135, 241, .6);
  --ink: #364153;           /* body copy */
  --navy: #101828;          /* question headings */
  --navy-deep: #6987f1;     /* progress fill + primary button */
  --green: #6987f1;         /* legacy alias for --brand, kept for older rules */
  --slate: #7d8aa6;         /* progress caption */
  --muted: #4a5565;         /* secondary text, PREV */
  --track: rgba(255, 255, 255, .75);
  --field: rgba(105, 135, 241, .4);
  --hair: rgba(105, 135, 241, .22);

  --sans: 'Inter Variable', Inter, ui-sans-serif, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: 'DM Sans Variable', 'DM Sans', 'Inter Variable', Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 0;
  flex: 1;
}

/* ---------------------------------------------------------------- progress */

.counter {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  text-align: center;
  margin: 0 0 12px;
}

.segments {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}
.segments i {
  display: block;
  width: 15px;
  height: 4px;
  border-radius: 9999px;
  background: var(--track);
  transition: background-color .35s ease;
}
.segments i.on { background: var(--navy-deep); }

.caption {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  margin: 0 0 32px;
}

/* ---------------------------------------------------------------- question */

.badge {
  display: block;
  width: fit-content;
  margin: 0 auto 18px;
  padding: 9px 18px;
  border-radius: 9999px;
  border: 1px solid var(--brand-soft);
  background: rgba(105, 135, 241, .12);
  color: var(--green);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1.q {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--navy);
  text-align: center;
  margin: 0 0 14px;
  text-wrap: balance;
}

.help {
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 auto 28px;
  max-width: 34rem;
}

.lead {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 26px;
}

/* ----------------------------------------------------------------- answers */

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

.card,
.row {
  position: relative;
  display: flex;
  cursor: pointer;
  border: 2px solid var(--brand-soft);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .3s ease, background-color .3s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.card:hover,
.row:hover { border-color: var(--brand-mid); background: rgba(105, 135, 241, .06); }
.card:active,
.row:active { transform: scale(.985); }

.card {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px 18px;
  text-align: center;
  min-height: 168px;
}
.card svg { width: 34px; height: 34px; color: var(--green); stroke-width: 1.75; }
.card span {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}

.list { display: grid; gap: 14px; }

.row {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}
.row span {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}
.row .dot {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--brand-soft);
  transition: border-color .25s ease, background-color .25s ease;
}

/* chosen state — brief confirmation before advancing */
.card.sel, .row.sel { border-color: var(--brand); background: rgba(105, 135, 241, .12); }
.row.sel .dot { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 3px #fff; }

/* ------------------------------------------------------------------ fields */

.fields { display: grid; gap: 18px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field label {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.field input,
.field select {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-family: var(--sans);
  font-size: 17px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--field);
  border-radius: 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236987f1'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.17l3.71-3.94a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 22px;
  padding-right: 44px;
}
.field input::placeholder { color: #94a3b8; }
.field input:focus,
.field select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(105, 135, 241, .22); }
.field.bad input,
.field.bad select { border-color: #dc2626; }

.err {
  margin: 8px 2px 0;
  font-size: 14px;
  color: #dc2626;
}

.secure {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}
.secure svg { width: 16px; height: 16px; color: var(--green); }

/* consent */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent .box {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  margin-top: 1px;
  border: 2px solid var(--brand-soft);
  border-radius: 7px;
  background: var(--surface);
  display: grid;
  place-items: center;
  transition: border-color .2s ease, background-color .2s ease;
}
.consent .box svg { width: 15px; height: 15px; color: #fff; opacity: 0; transition: opacity .15s ease; }
.consent input:checked + .box { background: var(--green); border-color: var(--green); }
.consent input:checked + .box svg { opacity: 1; }
.consent.bad .box { border-color: #dc2626; }

/* ----------------------------------------------------------------- actions */

.actions { display: flex; margin-top: 30px; }

.prev, .cta {
  border: 0;
  cursor: pointer;
  height: 64px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color .2s ease, opacity .2s ease;
}
.prev {
  flex: 1;
  background: rgba(255, 255, 255, .65);
  color: var(--muted);
}
.prev:hover { background: #fff; }
.prev svg { width: 18px; height: 18px; }
.cta {
  flex: 1.35;
  background: var(--navy-deep);
  color: #fff;
  padding: 0 18px;
}
.cta:hover { background: #5573e6; }
.actions.only-cta .cta { flex: 1; }

.note {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin: 18px 0 0;
}

/* ------------------------------------------------------------ benefit list */

.benefits {
  list-style: none;
  margin: 34px 0 0;
  padding: 22px 4px 0;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.benefits li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.benefits svg { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px; color: var(--brand); }

.badges {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 22px 0 34px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.badges span { display: inline-flex; align-items: center; gap: 8px; }
.badges svg { width: 17px; height: 17px; color: var(--navy); }

/* ------------------------------------------------------------------ footer */

footer {
  border-top: 1px solid var(--hair);
  padding: 26px 20px 40px;
  text-align: center;
  background: rgba(255, 255, 255, .55);
}
.brand {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--navy);
  margin-bottom: 12px;
}
.brand em { font-style: normal; color: var(--brand); }
.foot-secure {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; color: var(--slate); margin-bottom: 12px;
}
.foot-secure svg { width: 16px; height: 16px; }
.foot-links { font-size: 15px; color: var(--muted); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot-links i { font-style: normal; color: var(--brand-soft); margin: 0 12px; }
.legal {
  max-width: 620px;
  margin: 20px auto 0;
  font-size: 11px;
  line-height: 1.6;
  color: #9aa7b8;
}

/* --------------------------------------------------------------- spinner */

.spinner {
  width: 72px; height: 72px;
  margin: 8px auto 0;
  border-radius: 50%;
  border: 5px solid rgba(105, 135, 241, .25);
  border-top-color: var(--green);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- transitions */

.step { animation: rise 600ms cubic-bezier(.33, 1, .68, 1) both; }
@keyframes rise {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: none;             opacity: 1; }
}

/* -------------------------------------------------------------- result page */

.result { text-align: center; padding-top: 10px; }
.result .mark {
  width: 84px; height: 84px; margin: 0 auto 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(105, 135, 241, .16);
  color: var(--brand);
}
.result .mark svg { width: 40px; height: 40px; }
.result.neutral .mark { background: rgba(148, 163, 184, .15); color: var(--slate); }
.result p { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 34rem; margin: 0 auto; }

/* ---------------------------------------------------------------- >= 768px */

@media (min-width: 768px) {
  .shell { padding-top: 40px; }
  h1.q { font-size: 36px; }
  .segments i { width: 22px; }
  .card { min-height: 190px; }
  .card svg { width: 40px; height: 40px; }
  .card span, .row span { font-size: 18px; }
  .benefits li { font-size: 16px; }
  .benefits svg { width: 20px; height: 20px; }
  .row { padding: 22px 24px; }
}

@media (min-width: 1024px) {
  h1.q { font-size: 44.8px; }
}

/* ---------------------------------------------------- long-form section */

/* The original page's own blocks, rendered with their own stylesheet. They
   expect the font custom properties the Perspective app set on <main>. */
.lf {
  --font-family: 'Twemoji Country Flags', 'Roboto';
  --heading-font-family: 'Twemoji Country Flags', 'Roboto';
  --brand-body-font-weight: inherit;
  --brand-heading-font-weight: inherit;
  font-family: 'Roboto', var(--sans);
  background: #fff;
  border-top: 1px solid var(--hair);
  margin-top: 40px;
}
.lf[hidden] { display: none !important; }

/* ------------------------------------------------- progress alternatives */

/* 'bar' — one continuous track */
.pbar {
  height: 8px;
  border-radius: 9999px;
  background: var(--track);
  overflow: hidden;
  max-width: 420px;
  margin: 0 auto 12px;
}
.pbar span {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: var(--brand);
  transition: width .45s cubic-bezier(.33, 1, .68, 1);
}

/* 'steps' — numbered dots, ticked once passed */
.pdots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.pdots i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  color: var(--slate);
  background: var(--track);
  border: 1.5px solid transparent;
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.pdots i.done { background: var(--brand); color: #fff; }
.pdots i.done svg { width: 13px; height: 13px; stroke-width: 3; }
.pdots i.now {
  background: #fff;
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(105, 135, 241, .18);
}

/* 'ring' — circular percentage with the step number inside */
.pring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand) calc(var(--pct) * 1%), var(--track) 0);
  transition: background .45s ease;
}
.pring-in {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  align-content: center;
  line-height: 1;
}
.pring-in b {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
}
.pring-in small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 2px;
}

/* --------------------------------------------------- carrier scan (check) */

.carriers {
  list-style: none;
  margin: 4px auto 0;
  padding: 0;
  max-width: 460px;
  display: grid;
  gap: 10px;
}
.carriers li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border: 2px solid var(--brand-soft);
  border-radius: 14px;
  background: var(--surface);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.33, 1, .68, 1), border-color .3s ease;
}
.carriers li.in { opacity: 1; transform: none; }
.carriers li.ok { border-color: var(--brand); }

.carriers .cname {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.carriers .cstate {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}
/* spinner and value occupy the same cell so the row never reflows */
.carriers .cspin,
.carriers .cval { grid-area: 1 / 1; }

.carriers .cspin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(105, 135, 241, .25);
  border-top-color: var(--brand);
  animation: spin 700ms linear infinite;
  transition: opacity .2s ease;
}
.carriers .cval {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  color: var(--brand);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .25s ease, transform .25s cubic-bezier(.33, 1, .68, 1);
}
.carriers li.ok .cspin { opacity: 0; }
.carriers li.ok .cval { opacity: 1; transform: none; }

.cnote {
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--slate);
  margin: 18px auto 0;
  max-width: 34rem;
}
