/* The candidacy self-check on the complex-condition pages under /lp/
   (multiple-sclerosis first). Its script is scripts/lp-selfcheck.js; both
   were in lp.css and lp.js until 2026-10-01, when those went with the old
   condition stack, and come back here as one shared pair so each complex
   page loads the same copy. Tokens (--accent, --wash, --tint, --ease,
   --shadow-sm, --ink, --ink-muted, --font-display) come from celva-home.css,
   which every such page loads; the self-check's own colours are the --sc-*
   tokens on .lp-selfcheck below. On a wide screen the result panel sticks
   under the page's header, whose height a page script may publish as
   --hc-nav-h (72px when it does not). */
.lp-selfcheck {
  --sc-line: rgba(11, 29, 58, .12); --sc-panel: #F4F7FB; --sc-ring: #DCE3EC; --sc-meter: #E2E8F0;
  --sc-gold: #C99A2E; --sc-gold-soft: #FBF4E4; --sc-gold-line: #E6CF95; --sc-gold-ring: #EADFC4; --sc-gold-icon: #9A7420; --sc-gold-ink: #7A5A16;
  border: 1px solid var(--sc-line); border-radius: 16px; background: #fff; padding: clamp(24px, 3vw, 36px); box-shadow: var(--shadow-sm); }
.lp-selfcheck__label { margin: 0 0 12px; font-size: .9375rem; font-weight: 600; color: var(--ink); }
.lp-selfcheck__list + .lp-selfcheck__label { margin-top: 26px; }
.lp-selfcheck__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

/* A statement: a drawn box, its icon, its words. The real checkbox stays in
   the label (so a tap anywhere ticks it and a screen reader reads it) but is
   hidden; the box beside it draws its check when ticked. */
.lp-selfcheck__item { position: relative; display: flex; gap: 14px; align-items: center; padding: 12px 16px; border: 1px solid rgba(11, 29, 58, .1); border-radius: 12px; cursor: pointer; transition: border-color .3s var(--ease), background .3s var(--ease); }
@media (hover: hover) { .lp-selfcheck__item:hover { border-color: rgba(45, 110, 177, .45); } }
.lp-selfcheck__item:has(input[type="checkbox"]:checked) { border-color: var(--accent); background: var(--wash); }
.lp-selfcheck__item input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
/* the statement's words: the label's last child (a page may nest a pill, a
   sparkline or a second line inside it) */
.lp-selfcheck__item > span:last-child { font-size: 1rem; line-height: 1.5; color: var(--ink); }
.lp-selfcheck__sub { display: block; margin-top: 2px; font-size: .875rem; line-height: 1.45; color: var(--ink-muted); }
/* the unticked border is the only sign a statement is a checkbox: .55 of
   --ink on white is 3.8:1, over WCAG 1.4.11's 3:1 */
.lp-selfcheck__box { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid rgba(11, 29, 58, .55); background: #fff; transition: background .2s ease, border-color .2s ease; }
.lp-selfcheck__box svg { width: 16px; height: 16px; }
.lp-selfcheck__box path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .3s ease .05s; }
.lp-selfcheck__item:has(input[type="checkbox"]:checked) .lp-selfcheck__box { background: var(--accent); border-color: var(--accent); }
.lp-selfcheck__item:has(input[type="checkbox"]:checked) .lp-selfcheck__box path { stroke-dashoffset: 0; }
.lp-selfcheck__item:has(input[type="checkbox"]:focus-visible) .lp-selfcheck__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-selfcheck__ico { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: var(--wash); color: var(--accent); }
.lp-selfcheck__ico svg { width: 20px; height: 20px; }
.lp-selfcheck__ico svg * { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lp-selfcheck__ico svg .lp-selfcheck__dot { fill: currentColor; stroke: none; }
.lp-selfcheck__item:has(input[type="checkbox"]:checked) .lp-selfcheck__ico { background: #fff; }
/* what means not yet, or no: the gold the page uses for "not yet" */
.lp-selfcheck__list--stop .lp-selfcheck__item { border-left: 3px solid var(--sc-gold-line); }
.lp-selfcheck__list--stop .lp-selfcheck__ico { background: var(--sc-gold-soft); color: var(--sc-gold-icon); }
.lp-selfcheck__list--stop .lp-selfcheck__item:has(input[type="checkbox"]:checked) { border-color: var(--sc-gold); background: var(--sc-gold-soft); }
.lp-selfcheck__list--stop .lp-selfcheck__item:has(input[type="checkbox"]:checked) .lp-selfcheck__box { background: var(--sc-gold-icon); border-color: var(--sc-gold-icon); }

/* The answer: a ring that fills a fifth per statement that fits, the
   read-out, then what to do. Beside the list on a wide screen, held in view
   while the reader ticks; under it on a narrow one. Once a "not yet" item is
   ticked the ring empties, a clock takes its centre and the panel turns gold. */
.lp-selfcheck__panel { margin-top: 22px; padding: clamp(20px, 2.4vw, 26px); border-radius: 14px; background: var(--sc-panel); transition: background .3s ease; }
@media (min-width: 1000px) {
  .lp-selfcheck--split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 0 clamp(24px, 3vw, 40px); align-items: start; }
  .lp-selfcheck__panel { position: sticky; top: calc(var(--hc-nav-h, 72px) + 76px); margin-top: 0; }
}
.lp-selfcheck[data-state="stop"] .lp-selfcheck__panel { background: var(--sc-gold-soft); }
.lp-selfcheck__ring { position: relative; width: 132px; height: 132px; margin: 0 auto; }
.lp-selfcheck__ring > svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lp-selfcheck__seg { fill: none; stroke: var(--sc-ring); stroke-width: 10; stroke-dasharray: 55.83 258.33; transition: stroke .35s ease; }
.lp-selfcheck[data-count="1"] .lp-selfcheck__seg:nth-child(-n+1),
.lp-selfcheck[data-count="2"] .lp-selfcheck__seg:nth-child(-n+2),
.lp-selfcheck[data-count="3"] .lp-selfcheck__seg:nth-child(-n+3),
.lp-selfcheck[data-count="4"] .lp-selfcheck__seg:nth-child(-n+4),
.lp-selfcheck[data-count="5"] .lp-selfcheck__seg:nth-child(-n+5)
 { stroke: var(--accent); }
/* :nth-child(n) matches the specificity of the count rules above, so the ring empties */
.lp-selfcheck[data-state="stop"] .lp-selfcheck__seg:nth-child(n) { stroke: var(--sc-gold-ring); }
.lp-selfcheck__n, .lp-selfcheck__clock { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.lp-selfcheck__n b { font-family: var(--font-display); font-size: 2.5rem; font-weight: 400; line-height: 1; color: var(--ink); }
.lp-selfcheck__n small { margin-top: 2px; font-size: .8125rem; color: var(--ink-muted); }
.lp-selfcheck__clock { opacity: 0; color: var(--sc-gold); transition: opacity .25s ease; }
.lp-selfcheck__clock svg { width: 46px; height: 46px; }
.lp-selfcheck__clock svg * { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lp-selfcheck[data-state="stop"] .lp-selfcheck__n { opacity: 0; }
.lp-selfcheck[data-state="stop"] .lp-selfcheck__clock { opacity: 1; }
.lp-selfcheck__n { transition: opacity .25s ease; }
.lp-selfcheck__read { margin: 22px 0 0; padding: 16px 18px; border-radius: 12px; background: var(--tint); font-size: .98rem; line-height: 1.6; color: var(--ink); }
.lp-selfcheck__panel .lp-selfcheck__read { margin: 16px 0 0; padding: 0; background: none; text-align: center; }
.lp-selfcheck__read[hidden] { display: none; }
/* what each answer hands on: the two things to have ready, or the way back
   up to what a not yet looks like */
.lp-selfcheck__ready, .lp-selfcheck__why { display: none; }
.lp-selfcheck[data-state="most"] .lp-selfcheck__ready { display: grid; }
.lp-selfcheck[data-state="stop"] .lp-selfcheck__why { display: flex; }
.lp-selfcheck__ready { list-style: none; margin: 12px 0 0; padding: 0; gap: 8px; }
.lp-selfcheck__ready li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; font-size: .9375rem; color: var(--ink); }
.lp-selfcheck__ready .lp-selfcheck__ico { width: 30px; height: 30px; border-radius: 8px; }
.lp-selfcheck__ready .lp-selfcheck__ico svg { width: 18px; height: 18px; }
/* a 44px tap target sized to its words and centred; the margins take back
   most of the 9 to 10px it adds above and below, so the gaps read as
   before. Underlined like the page's other text links, so not the
   site-wide a border too */
.lp-selfcheck__why { align-items: center; justify-content: center; gap: 6px; width: fit-content; min-height: 44px; margin: 3px auto -9px; font-size: .9375rem; font-weight: 500; color: var(--sc-gold-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; border-bottom: 0; }
.lp-selfcheck__actions { margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.lp-selfcheck__panel .lp-selfcheck__actions { margin-top: 18px; flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
.lp-selfcheck__note { margin: 0; font-size: .9375rem; color: var(--ink-muted); }
.lp-selfcheck__panel .lp-selfcheck__note { font-size: .875rem; }
.lp-selfcheck__panel .btn { justify-content: center; padding-inline: 18px; text-align: center; text-wrap: balance; }

/* the meter: one segment per statement that fits, all empty once a stop item is ticked */
.lp-selfcheck__meter { display: flex; gap: 8px; margin: 24px 0 0; }
.lp-selfcheck__meter i { flex: 1 1 0; height: 8px; border-radius: 999px; background: var(--sc-meter); transition: background .3s ease; }
.lp-selfcheck[data-count="1"] .lp-selfcheck__meter i:nth-child(-n+1),
.lp-selfcheck[data-count="2"] .lp-selfcheck__meter i:nth-child(-n+2),
.lp-selfcheck[data-count="3"] .lp-selfcheck__meter i:nth-child(-n+3),
.lp-selfcheck[data-count="4"] .lp-selfcheck__meter i:nth-child(-n+4),
.lp-selfcheck[data-count="5"] .lp-selfcheck__meter i:nth-child(-n+5) { background: var(--accent); }
/* :nth-child(n) matches the count rules' specificity, so a stop empties the meter */
.lp-selfcheck[data-state="stop"] .lp-selfcheck__meter i:nth-child(n) { background: var(--sc-meter); }


@media (max-width: 620px) {
  .lp-selfcheck { padding: 18px 14px; }
  .lp-selfcheck__item { gap: 10px; padding: 12px; }
  .lp-selfcheck__ico { width: 28px; height: 28px; border-radius: 8px; }
  .lp-selfcheck__ico svg { width: 17px; height: 17px; }
  .lp-selfcheck__item > span:last-child { font-size: .9688rem; }
}
/* On a narrow screen the answer sits under eight statements, so a pill
   follows the reader down the list with the count (or "Not yet"). */
.lp-selfcheck__mini { display: none; }
@media (max-width: 999px) {
  .lp-selfcheck__mini { position: sticky; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 16px; border-radius: 999px; background: #fff; border: 1px solid rgba(11, 29, 58, .12); box-shadow: 0 8px 24px rgba(11, 29, 58, .12); font-size: .9375rem; color: var(--ink); }
  .lp-selfcheck__meter--mini { flex: 1 1 auto; margin: 0; gap: 5px; }
  .lp-selfcheck__meter--mini i { height: 6px; }
  /* Tabbing scrolls the 1px checkbox into view; without this margin it lands
     at the viewport's foot, the box and its focus ring under the pill */
  .lp-selfcheck__item input[type="checkbox"] { scroll-margin-bottom: 96px; }
  .lp-selfcheck__mini-t { white-space: nowrap; }
  .lp-selfcheck__mini-stop { display: none; white-space: nowrap; font-weight: 600; color: var(--sc-gold-ink); }
  .lp-selfcheck[data-state="stop"] .lp-selfcheck__mini-t { display: none; }
  .lp-selfcheck[data-state="stop"] .lp-selfcheck__mini-stop { display: inline; }
}

/* Windows High Contrast forces the box to Canvas and would leave the white
   tick invisible, so a ticked box looked unticked: the box keeps its own
   system colours, filled with Highlight once ticked */
@media (forced-colors: active) {
  .lp-selfcheck__box { forced-color-adjust: none; background: Canvas; border-color: CanvasText; }
  .lp-selfcheck__box path { stroke: HighlightText; }
  .lp-selfcheck__item:has(input[type="checkbox"]:checked) .lp-selfcheck__box,
  .lp-selfcheck__list--stop .lp-selfcheck__item:has(input[type="checkbox"]:checked) .lp-selfcheck__box { background: Highlight; border-color: Highlight; }
  .lp-selfcheck__item:has(input[type="checkbox"]:focus-visible) .lp-selfcheck__box { outline-color: CanvasText; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-selfcheck__item, .lp-selfcheck__meter i, .lp-selfcheck__box, .lp-selfcheck__box path, .lp-selfcheck__seg, .lp-selfcheck__panel, .lp-selfcheck__n, .lp-selfcheck__clock { transition: none !important; }
}
@media print {
  .lp-selfcheck__item { break-inside: avoid; }
  .lp-selfcheck__panel { position: static; }
  .lp-selfcheck__mini { display: none !important; }
}
