/* QuestionFlow (public/js/questionFlow.js). Brand colour comes from --pharmacy-primary. */
.qf {
  --qf-brand: var(--pharmacy-primary, #064e3b);
  --qf-tint: color-mix(in srgb, var(--qf-brand) 9%, #fff);
  --qf-line: #e4e7ec;
  --qf-text: #0f172a;
  --qf-muted: #5a6a80; /* 5.1:1 on #f5f6f8 */
  --qf-ctl-border: #8392a6; /* 3.2:1 on white (WCAG 1.4.11) */
  --qf-danger: #b91c1c;
  --qf-bg: var(--qf-page-bg, #f5f6f8);
  container: qf / inline-size;
  width: 100%;
  color: var(--qf-text);
  font-family: inherit;
}
.qf *, .qf *::before, .qf *::after { box-sizing: border-box; }
.qf button { font: inherit; cursor: pointer; }
.qf__wrap { max-width: 640px; margin: 0 auto; padding: 4px 0 8px; }

.qf__prog { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-size: 12.5px; color: var(--qf-muted); font-weight: 600; }
.qf__bar { flex: 1; height: 6px; background: var(--qf-line); border-radius: 99px; overflow: hidden; }
.qf__bar span { display: block; height: 100%; background: var(--qf-brand); transition: width .35s ease; }

.qf__q { animation: qf-in .32s cubic-bezier(.2, .8, .2, 1) both; }
.qf__q--back { animation-name: qf-back; }
@keyframes qf-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes qf-back { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

.qf__text, .qf__step-title { font-size: 22px; line-height: 1.3; font-weight: 650; letter-spacing: -.015em; margin: 0 0 6px; }
.qf__text:focus, .qf__step-title:focus { outline: none; } /* focus moves here for screen readers; no visible ring on a heading */
.qf__req { color: var(--qf-danger); }
.qf__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qf__help, .qf__step-sub { color: var(--qf-muted); font-size: 14px; margin: 0 0 20px; }
.qf__gap { height: 14px; }

.qf__opts { display: grid; gap: 10px; }
.qf__opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; color: inherit; border: 1.5px solid var(--qf-line); border-radius: 14px; padding: 14px 16px; font-size: 15.5px; font-weight: 550; min-height: 56px; transition: border-color .12s, background .12s, transform .08s; }
.qf__opt:hover { border-color: var(--qf-ctl-border); }
.qf__opt:active { transform: scale(.99); }
.qf__opt:focus-visible, .qf__prev:focus-visible, .qf__ok:focus-visible, .qf__link:focus-visible, .qf__input:focus-visible { outline: 3px solid var(--qf-brand); outline-offset: 2px; }
.qf__opt.is-on { border-color: var(--qf-brand); background: var(--qf-tint); }
.qf__opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qf__key { display: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--qf-line); font-size: 12px; font-weight: 700; color: var(--qf-muted); place-items: center; flex-shrink: 0; background: #fff; }
.qf__tick { width: 22px; height: 22px; border-radius: 99px; border: 2px solid var(--qf-ctl-border); display: grid; place-items: center; flex-shrink: 0; color: var(--brand-ink, #fff); order: -1; }
.qf__opt--multi .qf__tick { border-radius: 6px; }
.qf__opt.is-on .qf__tick { background: var(--qf-brand); border-color: var(--qf-brand); }

.qf__input { width: 100%; border: 0; border-bottom: 2px solid var(--qf-ctl-border); background: transparent; color: inherit; font: inherit; font-size: 22px; padding: 8px 2px; border-radius: 0; }
.qf__input:focus { outline: none; border-color: var(--qf-brand); }
.qf__input.is-err { border-color: var(--qf-danger); }
textarea.qf__input { font-size: 18px; min-height: 110px; resize: vertical; }
.qf__err { color: var(--qf-danger); font-size: 13.5px; margin-top: 12px; min-height: 1px; }

/* Previous / Next: pinned to the bottom on phone widths, within thumb reach */
.qf__nav { display: flex; gap: 10px; margin-top: 28px; position: sticky; bottom: 0; z-index: 5; background: linear-gradient(to bottom, transparent, var(--qf-bg) 22%); padding: 18px 0 calc(10px + env(safe-area-inset-bottom)); margin-bottom: -10px; }
.qf__prev { min-height: 44px; border: 1px solid var(--qf-ctl-border); background: #fff; color: inherit; border-radius: 12px; padding: 12px 18px; font-weight: 600; }
.qf__ok { flex: 1; min-height: 44px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; border: 0; background: var(--qf-brand); color: var(--brand-ink, #fff); font-weight: 650; padding: 12px 20px; border-radius: 12px; }
.qf__ok:hover { filter: brightness(1.08); }
.qf__defer { text-align: center; margin: 14px 0 0; }
.qf__link { min-height: 44px; border: 0; background: none; color: var(--qf-brand); font-weight: 600; padding: 0 4px; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.qf__defer .qf__link { color: var(--qf-muted); font-weight: 500; }
.qf__kbd { display: none; text-align: center; font-size: 12px; color: var(--qf-muted); margin: 10px 0 0; }

.qf__review { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--qf-line); border-radius: 14px; overflow: hidden; }
.qf__review li { display: flex; gap: 12px; padding: 13px 16px; align-items: flex-start; }
.qf__review li + li { border-top: 1px solid var(--qf-line); }
.qf__review li > div { flex: 1; min-width: 0; }
.qf__review-q { font-size: 13px; color: var(--qf-muted); margin: 0 0 3px; }
.qf__review-a { font-weight: 600; margin: 0; font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.qf__review-a.is-blank { color: var(--qf-muted); font-weight: 500; font-style: italic; }
.qf__saved { background: var(--qf-tint); color: var(--qf-brand); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-weight: 600; font-size: 14px; }

/* Wider containers: keyboard hints and option letters, nav sits in flow */
@container qf (min-width: 600px) {
  .qf__key { display: grid; }
  .qf__tick { order: 0; }
  .qf__kbd { display: block; }
  .qf__nav { position: static; background: none; padding: 0; margin: 30px 0 0; padding-top: 16px; border-top: 1px solid var(--qf-line); }
  .qf__ok { flex: 0 1 auto; margin-left: auto; }
  .qf__opts--two { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .qf__q, .qf__q--back { animation: none; }
  .qf__bar span, .qf__opt { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .qf__q, .qf__q--back { animation: none !important; }
  .qf *, .qf *::before, .qf *::after { transition: none !important; }
}
@media (forced-colors: active) { .qf__opt.is-on { outline: 2px solid Highlight; } }
