/* ============================================================
   Attune - assessment.css
   Styles for the self-assessment.
   Calm pacing: one question per screen, generous air, quiet
   progress. Reuses tokens.css + base.css for the shell.
   ============================================================ */

/* ---------- minimal header for the focused flow ---------- */
.assess-bar .wrap { justify-content: space-between; }
.assess-links { display: flex; align-items: center; gap: 1.4rem; }
.assess-bar .leave { color: var(--muted); text-decoration: none; font-size: .95rem; }
.assess-bar .leave:hover { color: var(--accent); }

/* ---------- stage ---------- */
.stage {
  max-width: 40rem; margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) clamp(1.4rem, 5vw, 3rem) 5rem;
  min-height: 60vh;
}

/* gentle screen transitions */
.screen { display: none; }
.screen[hidden] { display: none !important; }
.screen.active { display: block; }
.screen.fading { opacity: 0; }
.screen { transition: opacity .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .screen { transition: none; }
  .screen.fading { opacity: 1; }
}

/* ---------- intro ---------- */
.intro h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: 1.4rem; line-height: 1.14; }
.intro p { font-size: clamp(1.08rem, 1rem + 0.35vw, 1.24rem); margin: 0 0 1.6rem; max-width: 34rem; }
.intro .assessment-name { color: var(--highlight-deep); font-size: .88rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .8rem; }
.intro .meta { color: var(--muted); font-size: .98rem; margin-top: 1rem; }
.intro .portal-note { color: var(--muted); font-size: .9rem; line-height: 1.5; margin-top: -.7rem; }
.intro .begin { margin-top: 1.4rem; }

/* ---------- progress (quiet, never a timer) ---------- */
.progress { margin-bottom: 2.6rem; }
.progress .track { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress .fill { height: 100%; width: 0; background: var(--accent-soft); transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .progress .fill { transition: none; } }
.progress .label { margin-top: .7rem; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- question ---------- */
.question-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.q-prompt {
  font-family: var(--font-display); color: var(--ink); font-weight: 500;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.22;
  letter-spacing: -0.01em; margin: 0 0 .7rem;
}
/* Focused programmatically on each new question (assessment.js) as a
   route-announcement cue for screen readers - needs a visible ring
   regardless of :focus-visible's keyboard-only heuristic. */
.q-prompt:focus { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.q-help { color: var(--ink-soft); font-size: 1rem; margin: 0 0 1.9rem; max-width: 32rem; }

.options { display: flex; flex-direction: column; gap: .7rem; margin: 0; }
.option {
  font-family: var(--font-body); font-size: 1.06rem; color: var(--ink);
  text-align: left; background: var(--card);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1rem 1.15rem; cursor: pointer; line-height: 1.4;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.option:hover { border-color: var(--accent-soft); }
.option[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 16%, var(--paper));
  box-shadow: inset 3px 0 0 var(--accent);
}
.option .mark { color: var(--accent); margin-right: .5rem; opacity: 0; }
.option[aria-pressed="true"] .mark { opacity: 1; }

/* free-text (optional final question) */
.q-text {
  width: 100%; min-height: 7rem; resize: vertical;
  font-family: var(--font-body); font-size: 1.05rem; color: var(--ink); line-height: 1.6;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 4px; padding: 1rem 1.15rem;
}
.q-text:focus { border-color: var(--accent); }

/* ---------- actions ---------- */
.q-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.4rem; }
.q-actions .left { display: flex; gap: 1.4rem; align-items: center; }
.btn-back { background: none; border: 0; color: var(--muted); font-family: var(--font-body); font-size: 1rem; cursor: pointer; padding: .4em 0; }
.btn-back:hover { color: var(--ink-soft); }
.btn-skip { background: none; border: 0; color: var(--muted); font-family: var(--font-body); font-size: .98rem; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; padding: .4em 0; }
.btn-skip:hover { color: var(--accent); }
.btn-primary[disabled] { opacity: .4; cursor: default; pointer-events: none; }

/* ---------- safety interstitial ---------- */
.safety .framing { color: var(--muted); font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .6rem; }
.safety h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); margin: 0 0 .9rem; line-height: 1.16; }
.safety h1:focus { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.safety-lead { font-size: clamp(1.08rem, 1rem + 0.3vw, 1.22rem); max-width: 34rem; margin: 0 0 1.8rem; }
.safety-crisis { margin-top: 0; }
.safety-actions { margin: 1.6rem 0; }
.safety-reassure { color: var(--ink-soft); max-width: 34rem; margin: 1.8rem 0 2.2rem; }
.safety-continue { display: flex; align-items: center; gap: 1.6rem; }

/* ---------- result ---------- */
.result h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); margin-bottom: .5rem; line-height: 1.16; }
.result .framing { color: var(--muted); font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 2rem; }

.result-pathway {
  border: 1px solid var(--line); border-left: 4px solid var(--accent-soft);
  border-radius: 4px; padding: 1.25rem 1.4rem; margin: 1.5rem 0 2rem;
  background: var(--card);
}
.result-pathway p { margin: 0; line-height: 1.65; }
.result-pathway p + p { margin-top: 1rem; }
.pathway-urgent { border-left-color: #9b3f3f; background: color-mix(in srgb, #f3dddd 40%, var(--paper)); }
.pathway-medical { border-left-color: #9b6a32; background: color-mix(in srgb, #f2e6d5 45%, var(--paper)); }
.pathway-likely { border-left-color: var(--accent); background: var(--sage); }

.pattern {
  background: var(--sage); border: 1px solid color-mix(in srgb, var(--accent-soft) 35%, transparent);
  border-radius: 4px; padding: 1.5rem 1.6rem; margin: 0 0 2.2rem;
}
.pattern .lead { font-family: var(--font-display); font-style: italic; color: var(--ink); font-size: 1.3rem; line-height: 1.35; margin: 0 0 .6rem; }
.pattern .also { color: var(--ink-soft); font-size: 1rem; margin: 0; }

.result .block { margin: 0 0 1.7rem; }
.result .block.lead-p { font-size: clamp(1.08rem, 1rem + 0.3vw, 1.22rem); }
.result h2 { font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-family: var(--font-body); font-weight: 500; margin: 2.4rem 0 1rem; }
.result strong { color: var(--ink); font-weight: 500; }

.support-note {
  border-left: 2px solid var(--accent-soft); padding: .2rem 0 .2rem 1.4rem;
  margin: 0 0 1.7rem; color: var(--ink); font-family: var(--font-display); font-size: 1.18rem; line-height: 1.45;
}

.routes { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.4rem; }
.route {
  font-family: var(--font-body); font-size: 1.04rem; text-decoration: none; cursor: pointer;
  border-radius: 3px; padding: .8em 1.4em; border: 1px solid var(--accent); color: var(--accent);
  background: none; transition: background .2s ease, color .2s ease;
}
.route:hover { background: color-mix(in srgb, var(--accent-soft) 16%, var(--paper)); color: var(--accent-deep); }
.route.primary { background: var(--accent); color: var(--paper); }
.route.primary:hover { background: var(--accent-deep); color: var(--paper); }

.inquiry-optin {
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1.4rem 1.6rem; margin: 2.2rem 0 0;
  background: var(--card);
}
.inquiry-optin .inquiry-lead { font-family: var(--font-display); color: var(--ink); font-size: 1.15rem; margin: 0 0 .5rem; }
.inquiry-optin .inquiry-body { color: var(--ink-soft); font-size: .98rem; line-height: 1.55; margin: 0 0 1.1rem; }

.compare-later { margin-top: 1.5rem; color: var(--ink-soft); }
.result-controls { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2.2rem; }
.saved-note { margin-top: 1rem; color: var(--muted); font-size: .95rem; }
.startover { background: none; border: 0; color: var(--muted); font-family: var(--font-body); font-size: .95rem; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; padding: .3em 0; }
.startover:hover { color: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
