/* Client onboarding (shared/onboard.js). Skinned per concept through the --a-* tokens
   in each *-plus/theme.css. App-style on phones: one step per screen, big tap targets,
   Back / Continue pinned to the bottom (the tab bar is hidden on this page). */
.ob-page { padding: clamp(20px, 5vw, 56px) 0 clamp(40px, 7vw, 96px); }
.ob { max-width: 760px; margin-inline: auto; font-family: var(--a-body); scroll-margin-top: 90px; }
.ob-in-r { animation: ob-in-r .32s cubic-bezier(.2, .7, .2, 1) both; }
.ob-in-l { animation: ob-in-l .32s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes ob-in-r { from { opacity: 0; transform: translateX(18px); } }
@keyframes ob-in-l { from { opacity: 0; transform: translateX(-18px); } }

.ob-title { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0 0 .3em; }
.ob-title:focus { outline: none; }
.ob-big { font-size: clamp(2.4rem, 8vw, 4.4rem); }
.ob-lead { font-size: 1.12rem; color: var(--a-muted); max-width: 52ch; }
.ob-intro { color: var(--a-muted); margin: 0 0 28px; max-width: 56ch; }
.ob-fine { font-size: .86rem; color: var(--a-muted); }
.ob-actions { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin: 28px 0 18px; }
.ob-actions-end { justify-content: flex-end; border-top: 1px solid var(--a-line); padding-top: 22px; margin-top: 28px; }
.ob-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Welcome */
.ob-map { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--a-line); }
.ob-map li { display: flex; gap: 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--a-line); font-weight: 600; }
.ob-map li:nth-child(odd) { padding-right: 16px; }
.ob-map span { font-size: .78rem; color: var(--a-highlight); font-variant-numeric: tabular-nums; }
.ob-map em, .ob-opt-tag { font-style: normal; font-weight: 500; font-size: .74rem; color: var(--a-muted); letter-spacing: .04em; text-transform: none; }
@media (max-width: 520px) { .ob-map { grid-template-columns: 1fr; } .ob-map li:nth-child(odd) { padding-right: 0; } }

/* Progress: one segment per step */
.ob-top { margin-bottom: 26px; }
.ob-progress { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.ob-progress span { height: 4px; border-radius: var(--a-pill); background: var(--a-line); transition: background .3s; }
.ob-progress span.is-on { background: var(--a-accent); }
.ob-count { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 0; font: 600 .8rem/1 var(--a-body); color: var(--a-muted); font-variant-numeric: tabular-nums; }
.ob-exit { all: unset; cursor: pointer; padding: 10px 0 10px 12px; color: var(--a-muted); text-decoration: underline; text-underline-offset: 3px; }
.ob-exit:hover { color: var(--a-text); }
.ob-exit:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 2px; }

/* Fields */
.ob-fields { display: grid; gap: 26px; }
.ob-field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.ob-label { font: 700 .76rem/1.35 var(--a-body); letter-spacing: .1em; text-transform: uppercase; color: var(--a-text); padding: 0; }
.ob-hint { font-size: .86rem; color: var(--a-muted); margin-top: -4px; }
.ob input[type=text], .ob input[type=email], .ob input[type=tel], .ob textarea {
  font-family: inherit; font-size: 16px; line-height: 1.4; color: var(--a-text); background: var(--a-surface);
  border: 1px solid var(--a-line); border-radius: min(var(--a-radius), 12px); padding: 14px; width: 100%; box-sizing: border-box; min-height: 52px;
}
.ob textarea { resize: vertical; min-height: 96px; }
.ob textarea::placeholder { color: var(--a-muted); opacity: .8; }
.ob input:focus, .ob textarea:focus { outline: none; border-color: var(--a-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-accent) 24%, transparent); }
.ob-unit { position: relative; display: block; max-width: 220px; }
.ob-unit input { padding-right: 48px !important; }
.ob-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--a-muted); pointer-events: none; }

/* Choice chips and cards: real radio/checkbox inputs, styled */
.ob-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-opt { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ob-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ob-opt > span { display: flex; align-items: center; min-height: 48px; box-sizing: border-box; padding: 12px 16px; border: 1px solid var(--a-line); border-radius: var(--a-pill);
  background: var(--a-surface); color: var(--a-text); font-weight: 600; font-size: .95rem; transition: background .15s, border-color .15s, color .15s; }
.ob-opt:hover > span { border-color: var(--a-accent); }
.ob-opt input:checked + span { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-accent-ink); }
.ob-chips .ob-opt input[type=checkbox]:checked + span::before { content: "✓"; margin-right: 8px; font-weight: 800; }
.ob-opt input:focus-visible + span { outline: 2px solid var(--a-accent); outline-offset: 3px; }
.ob-opt:active > span { transform: scale(.98); }
.ob-cards .ob-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ob-cards .ob-opt > span { display: grid; gap: 4px; align-content: center; border-radius: var(--a-radius); padding: 16px 18px; min-height: 76px; }
.ob-cards small { font-weight: 400; font-size: .84rem; color: var(--a-muted); }
.ob-cards input:checked + span small { color: inherit; opacity: .85; }
@media (max-width: 560px) { .ob-cards .ob-opts { grid-template-columns: 1fr; } .ob-cards .ob-opt > span { min-height: 0; } }

/* 1–5 scale */
.ob-scale-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ob-scale-end { font-size: .82rem; color: var(--a-muted); }
.ob-scale .ob-opts { flex-wrap: nowrap; gap: 6px; }
.ob-scale .ob-opt > span { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: var(--a-pill); font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .ob-scale-row { display: grid; grid-template-columns: 1fr 1fr; } .ob-scale .ob-opts { grid-column: 1 / -1; grid-row: 1; justify-content: space-between; } .ob-scale-end:last-child { text-align: right; } }

/* Health questions: yes/no segmented control per question */
.ob-yn-list { list-style: none; padding: 0; margin: 0; counter-reset: q; border-top: 1px solid var(--a-line); }
.ob-yn-list > li { counter-increment: q; border-bottom: 1px solid var(--a-line); padding: 16px 0; }
.ob-yn { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 20px; }
.ob-yn legend { float: left; width: 100%; padding: 0; font-weight: 500; line-height: 1.45; }
.ob-yn legend::before { content: counter(q) ". "; color: var(--a-highlight); font-weight: 700; font-variant-numeric: tabular-nums; }
.ob-seg { display: inline-flex; border: 1px solid var(--a-line); border-radius: var(--a-pill); overflow: hidden; justify-self: start; }
.ob-seg .ob-opt > span { border: 0; border-radius: 0; min-width: 76px; justify-content: center; }
.ob-seg .ob-opt + .ob-opt > span { border-left: 1px solid var(--a-line); }
.ob-seg .ob-opt input:focus-visible + span { outline-offset: -3px; }
.ob-yn .ob-err { grid-column: 1 / -1; }

/* Consent */
.ob-consent { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; cursor: pointer; padding: 14px 16px; border: 1px solid var(--a-line); border-radius: min(var(--a-radius), 12px); background: var(--a-surface); line-height: 1.5; }
.ob-consent input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--a-accent); }
.ob-consent:has(input:checked) { border-color: var(--a-accent); }

/* Errors */
.ob-err { color: #e0675a; margin: 0; font-weight: 600; font-size: .9rem; }
.ob-field.is-bad .ob-opt > span, .ob-field.is-bad input[type=text], .ob-field.is-bad input[type=email], .ob-field.is-bad .ob-consent, .ob-field.is-bad .ob-seg { border-color: #e0675a; }
html[data-tab-theme="studio"] .ob-err, html[data-tab-theme="soft"] .ob-err { color: #b3261e; }
html[data-tab-theme="studio"] .ob-field.is-bad *, html[data-tab-theme="soft"] .ob-field.is-bad * { border-color: #b3261e; }
.ob-note { margin: 0; }

/* Back / Continue: pinned to the bottom of the screen on phones */
.ob-nav { display: flex; align-items: center; gap: 12px 20px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--a-line); }
.ob-nav .btn { margin-left: auto; min-width: 160px; text-align: center; }
.ob-back { all: unset; cursor: pointer; padding: 12px 4px; font-weight: 600; color: var(--a-muted); }
.ob-back:hover { color: var(--a-text); }
.ob-back:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 2px; }
@media (max-width: 860px) {
  .ob-nav { position: sticky; bottom: 0; z-index: 5; margin-inline: calc(-1 * var(--gut, 20px)); padding: 12px var(--gut, 20px) calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--a-bg) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .ob-nav .btn { flex: 1; min-width: 0; }
  .ob-step { padding-bottom: 0; }
}

/* Finish: your starting plan */
.ob-done-head .a-tick { margin: 0 0 18px; }
.ob-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.ob-rc h3 { font-size: 1.5rem; margin: 0 0 .25em; }
.ob-rc p { margin: 0 0 .7em; }
.ob-rc-next { grid-column: 1 / -1; background: var(--a-accent); color: var(--a-accent-ink); border-color: var(--a-accent); }
.ob-rc-next .a-eyebrow { color: inherit; opacity: .8; }
.ob-rc-next .btn { background: var(--a-accent-ink); color: var(--a-accent); border-color: var(--a-accent-ink); }
.ob-rc-next .a-link-btn { color: inherit; }
.ob-rc-flag { grid-column: 1 / -1; border-color: #d9a441; border-left-width: 4px; }
.ob-flag-label { display: flex; align-items: center; gap: 10px; font: 700 .8rem/1.2 var(--a-body); letter-spacing: .12em; text-transform: uppercase; }
.ob-flag-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #d9a441; color: #1b1405; font-weight: 800; letter-spacing: 0; }
.ob-flag-list { margin: 0 0 .7em; padding-left: 1.2em; font-weight: 600; }
.ob-meta { font-weight: 600; font-size: .92rem; }
.ob-plus { font-size: .93rem; padding-top: 10px; border-top: 1px solid var(--a-line); }
.ob-check { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.ob-check a { color: var(--a-accent); text-underline-offset: 3px; font-weight: 600; }
.ob-sheet { margin-top: 22px; padding-bottom: 16px; }
.ob-dl { margin: 0; border-top: 1px solid var(--a-line); }
.ob-dl div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--a-line); }
.ob-dl dt { font: 700 .7rem/1.5 var(--a-body); letter-spacing: .1em; text-transform: uppercase; color: var(--a-muted); }
.ob-dl dd { margin: 0; overflow-wrap: anywhere; }
.ob-dl .is-flag dd::before { content: "! "; font-weight: 800; color: #d9a441; }
.ob-dl .is-flag dd { font-weight: 600; }
@media (max-width: 640px) { .ob-res { grid-template-columns: 1fr; } .ob-dl div { grid-template-columns: 1fr; } }

/* Portal + homepage entry points */
.a-choose { margin: -8px 0 22px; color: var(--a-muted); }
.a-choose a { color: var(--a-accent); font-weight: 600; text-underline-offset: 3px; }
.a-pc-onboard { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; border-color: var(--a-accent); }
.a-pc-onboard > div { flex: 1 1 320px; }
.a-pc-onboard p:last-child { margin-bottom: 0; }
.a-start { margin-bottom: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 28px; align-items: center; text-decoration: none; color: inherit;
  background: var(--a-surface); border: 1px solid var(--a-accent); border-radius: var(--a-radius); padding: 24px 26px; transition: transform .2s; }
.a-start:hover { transform: translateY(-3px); }
.a-start:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 3px; }
.a-start h3 { font-size: 1.6rem; margin: 0 0 .25em; }
.a-start p { margin: 0; color: var(--a-muted); }
@media (max-width: 760px) { .a-start { grid-template-columns: 1fr; } .a-start .btn { text-align: center; } }

@media (prefers-reduced-motion: reduce) { .ob-in-r, .ob-in-l { animation: none; } .ob-opt:active > span { transform: none; } }
