/* =========================================================================
   SHI Surveys — public (respondent) interface
   Large touch targets, clear hierarchy, sign-language video first.
   ========================================================================= */

body.pub {
    background:
        radial-gradient(900px 420px at 110% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
        radial-gradient(700px 360px at -10% 0%, rgba(201, 164, 95, .13), transparent 70%),
        linear-gradient(180deg, #f6fbfa 0, var(--background) 520px);
    display: flex; flex-direction: column;
}

.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- header / footer ---------- */
.pub-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid rgba(223, 230, 238, .8); }
.pub-header-inner { max-width: 1180px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 32px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pub-brand img { height: 46px; width: auto; }
.pub-tag { display: inline-flex; align-items: center; gap: 8px; padding: .35em .9em; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: .88rem; }
.pub-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 32px) 56px; }
.pub-footer { border-top: 1px solid var(--line); background: rgba(255, 255, 255, .7); }
.pub-footer-inner { max-width: 1180px; margin: 0 auto; padding: 18px clamp(16px, 4vw, 32px); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .88rem; }
.pub-footer-note { display: inline-flex; align-items: center; gap: 6px; }
.pub-footer-note .i { color: var(--accent); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: .3em .95em; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: .88rem; }
.eyebrow-sm { color: var(--accent-dark); font-weight: 800; font-size: .82rem; }
.lead { font-size: clamp(1.02rem, 1.8vw, 1.15rem); color: var(--ink-2); line-height: 1.9; }

.preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 18px; border-radius: var(--r-sm); background: var(--sand-soft); border: 1px solid #efdfbd; color: #6d5020; font-weight: 700; }
.preview-bar a { margin-inline-start: auto; color: var(--navy); }

/* ---------- home ---------- */
.home-hero { text-align: center; padding: clamp(18px, 5vw, 48px) 0 clamp(26px, 5vw, 44px); }
.home-hero-inner { max-width: 760px; margin: 0 auto; display: grid; justify-items: center; gap: 16px; }
.home-hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.02em; }
.home-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.home-points li { display: inline-flex; align-items: center; gap: 8px; padding: .45em 1em; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow-xs); }
.home-points .i { color: var(--accent); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: 1.35rem; }

.survey-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.survey-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.survey-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.survey-card-media { position: relative; height: 150px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); overflow: hidden; }
.survey-card-media img { width: 100%; height: 100%; object-fit: cover; }
.survey-card-art { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .92); background: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, .22), transparent 45%), radial-gradient(circle at 80% 90%, rgba(201, 164, 95, .45), transparent 50%); }
.survey-card-art .i { width: 64px; height: 64px; stroke-width: 1.4; }
.media-flag { position: absolute; inset-inline-start: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: .25em .8em; border-radius: var(--r-pill); background: rgba(6, 27, 56, .72); color: #fff; font-size: .8rem; font-weight: 700; backdrop-filter: blur(6px); }
.survey-card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.survey-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.survey-card h3 { font-size: 1.12rem; }
.survey-card p { font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.survey-card-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.survey-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.survey-card-cta { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 8px; color: var(--accent-dark); font-weight: 800; }
.survey-card:hover .survey-card-cta .i { transform: translateX(-4px); }
.survey-card-cta .i { transition: transform .2s var(--ease); }

/* ---------- intro ---------- */
.intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: stretch; }
.intro-grid.no-video { grid-template-columns: 1fr; max-width: 820px; margin: 0 auto; }
.intro-media { padding: clamp(16px, 2.5vw, 26px); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, #fff), var(--surface-2)); display: flex; align-items: center; }
.intro-media .player { width: 100%; }
.intro-body { padding: clamp(22px, 4vw, 44px); display: flex; flex-direction: column; gap: 16px; }
.intro-body h1 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); letter-spacing: -.015em; }
.intro-body > .eyebrow { align-self: flex-start; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip-sand { background: var(--sand-soft); border-color: #efdfbd; color: #6d5020; }
.chip-sand .i { color: var(--sand-deep); }
.intro-text { display: grid; gap: 12px; color: var(--ink-2); font-size: 1.02rem; line-height: 1.95; padding: 16px 18px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line-2); }
.intro-actions { display: grid; justify-items: start; gap: 10px; margin-top: 6px; }
.intro-actions .hint { display: inline-flex; align-items: center; gap: 6px; }
.intro-actions .hint .i { color: var(--accent); }

.state-card { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed #cfd8e3; }
.state-card h2 { font-size: 1.1rem; margin-bottom: 4px; }
.state-card p { color: var(--muted); }
.state-icon { width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.state-icon .i { width: 28px; height: 28px; }

/* ---------- player ---------- */
.player { margin: 0; display: grid; gap: 10px; }
.player-frame { position: relative; border-radius: var(--r); overflow: hidden; background: #0a1628; box-shadow: 0 18px 40px rgba(6, 27, 56, .22); }
.player-frame video { width: 100%; height: auto; max-height: 72vh; margin: 0 auto; background: #0a1628; }
.player-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.player-frame:fullscreen { display: grid; place-items: center; border-radius: 0; background: #000; }
.player-frame:fullscreen video { width: 100%; height: 100%; max-height: 100vh; object-fit: contain; }
.player-frame:fullscreen iframe { width: 100%; height: 100%; aspect-ratio: auto; }
.player-sm { max-width: 560px; }
.player-sm .player-frame video { max-height: 52vh; }
.player-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.player-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; color: var(--accent-dark); font-size: .9rem; }
.player-actions { display: inline-flex; align-items: center; gap: 8px; }
.speed { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--line-2); }
.speed button { border: 0; background: transparent; padding: .3em .75em; border-radius: 8px; font-weight: 700; font-size: .84rem; color: var(--muted); }
.speed button[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-xs); }
.player-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .3em .8em; font-weight: 700; font-size: .84rem; color: var(--ink-2); }
.player-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---------- form shell ---------- */
.form-wrap { max-width: 780px; margin: 0 auto; }
html.js .survey-page[data-view="intro"] .form-wrap { display: none; }
html.js .survey-page[data-view="form"] .intro { display: none; }
.survey-form { padding: clamp(18px, 4vw, 34px); display: grid; gap: 22px; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.form-top { display: flex; align-items: center; gap: 14px; }
.progress { flex: 1; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #6fe0d2)); transition: width .45s var(--ease); }
.progress-text { font-weight: 800; color: var(--muted); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
html:not(.js) .form-top, html:not(.js) [data-prev], html:not(.js) [data-next] { display: none; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 16px; }
html.js .step:not(.is-current) { display: none; }
html.js .step.is-current { animation: step-in .35s var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
html:not(.js) .step + .step { padding-top: 26px; border-top: 1px solid var(--line-2); }
.step-title { display: flex; align-items: center; gap: 10px; padding: 0; font-size: 1.35rem; font-weight: 800; color: var(--navy); }
.step-title .i { color: var(--accent); }
.step-title:focus { outline: none; }
.step-hint { color: var(--muted); margin-top: -8px; }

.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.fields-grid .span-2 { grid-column: 1 / -1; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-flex; align-items: center; min-height: 48px; padding: .4em 1.3em; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; transition: all .15s; }
.pill span:hover { border-color: #c2cdd9; }
.pill input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent); }
.pill input:focus-visible + span { box-shadow: var(--ring); }

/* ---------- questions ---------- */
.q-head { display: flex; align-items: flex-start; gap: 14px; }
.q-num { flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--accent); color: #fff; font-weight: 800; font-size: 1.05rem; box-shadow: 0 8px 18px var(--accent-glow); }
.q-num-info { background: var(--sand-soft); color: var(--sand-deep); box-shadow: none; }
.q-title { padding: 0; font-size: clamp(1.18rem, 2.4vw, 1.4rem); font-weight: 800; color: var(--navy); line-height: 1.55; padding-top: 3px; }
.q-title:focus { outline: none; }
.q-help { color: var(--ink-2); display: grid; gap: 8px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); border-inline-start: 4px solid color-mix(in srgb, var(--accent) 45%, transparent); }

.choices { display: grid; gap: 10px; }
.choices-2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: .7em 1.05em; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s; }
.choice:hover { border-color: #c2cdd9; background: var(--surface-2); }
.choice:active { transform: scale(.995); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border: 2px solid #b9c5d3; border-radius: 8px; color: transparent; background: #fff; transition: all .15s; }
.choice:has(input[type="radio"]) .choice-box { border-radius: 50%; }
.choice-box .i { width: 16px; height: 16px; stroke-width: 3; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:checked) .choice-box { border-color: var(--accent); background: var(--accent); color: #fff; }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice-label { line-height: 1.5; }
.other-input { margin-top: 2px; }
html.js .other-input:not(.is-visible) { display: none; }

.choices-yesno { grid-template-columns: 1fr 1fr; gap: 14px; }
.choice-tile { flex-direction: column; justify-content: center; gap: 10px; min-height: 130px; font-size: 1.15rem; }
.tile-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--line-2); color: var(--muted); transition: all .15s; }
.tile-icon .i { width: 28px; height: 28px; stroke-width: 2.6; }
.choice-tile.is-yes:has(input:checked) { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.choice-tile.is-yes:has(input:checked) .tile-icon { background: var(--green); color: #fff; }
.choice-tile.is-no:has(input:checked) { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.choice-tile.is-no:has(input:checked) .tile-icon { background: var(--red); color: #fff; }

.stars { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.star { position: relative; cursor: pointer; padding: 4px; border-radius: 12px; }
.star input { position: absolute; opacity: 0; }
.star .i { width: 48px; height: 48px; stroke: #c5cfdb; stroke-width: 1.5; fill: #f1f4f8; transition: all .15s; }
.star.is-on .i, .star:has(input:checked) .i { stroke: #d49a1f; fill: #f5c04a; }
.star:has(input:focus-visible) { box-shadow: var(--ring); }
.stars:hover .star .i { stroke: #c5cfdb; fill: #f1f4f8; }
.stars:hover .star.is-hover .i { stroke: #d49a1f; fill: #f8d27c; }
.stars-caption { margin-inline-start: 10px; font-weight: 800; color: var(--sand-deep); }

.scale-row { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.scale-cell { position: relative; }
.scale-cell input { position: absolute; opacity: 0; }
.scale-cell span { display: grid; place-items: center; height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; cursor: pointer; transition: all .15s; font-variant-numeric: tabular-nums; }
.scale-cell span:hover { border-color: #c2cdd9; }
.scale-cell input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 18px var(--accent-glow); }
.scale-cell input:focus-visible + span { box-shadow: var(--ring); }
.scale-ends { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: .85rem; font-weight: 700; }

.q-step.is-invalid .choice, .q-step.is-invalid .scale-cell span { border-color: #eab8b8; }

/* ---------- review ---------- */
.review-list { display: grid; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.review-list:empty { display: none; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.review-item:last-child { border-bottom: 0; }
.review-item dt { color: var(--muted); font-size: .88rem; font-weight: 700; grid-column: 1; }
.review-item dd { margin: 0; font-weight: 700; color: var(--navy); grid-column: 1; overflow-wrap: anywhere; }
.review-item dd.is-empty { color: var(--faint); font-weight: 600; }
.review-item .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.consent-box { padding: 16px 18px; border-radius: var(--r-sm); background: var(--sand-soft); border: 1px solid #efdfbd; display: grid; gap: 6px; }
.consent-box .check { align-items: flex-start; line-height: 1.8; }
.consent-box .check input { margin-top: 5px; }
.consent-box.is-invalid { border-color: var(--red); background: var(--red-soft); }

.step-nav { display: flex; align-items: center; gap: 12px; padding-top: 6px; border-top: 1px solid var(--line-2); padding-top: 20px; }
.step-nav-spacer { flex: 1; }
.step-nav [data-submit] .spinner { margin-inline-end: 4px; }

/* ---------- done ---------- */
.done { display: grid; place-items: center; padding: clamp(10px, 4vw, 40px) 0; }
.done-card { width: 100%; max-width: 620px; padding: clamp(26px, 5vw, 48px); display: grid; justify-items: center; gap: 16px; text-align: center; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.done-card h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.done-text { color: var(--ink-2); display: grid; gap: 10px; font-size: 1.05rem; }
.done-mark { width: 96px; height: 96px; }
.done-svg { width: 96px; height: 96px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done-svg circle { stroke: var(--accent); stroke-width: 4; fill: var(--accent-soft); stroke-dasharray: 190; stroke-dashoffset: 190; animation: draw .7s var(--ease) forwards; }
.done-svg path { stroke: var(--accent-dark); stroke-width: 5; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .45s .55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ref-box { width: 100%; display: grid; justify-items: center; gap: 8px; padding: 18px; border-radius: var(--r); border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--surface-2); }
.ref-label { color: var(--muted); font-weight: 700; font-size: .9rem; }
.ref-code { font-size: 1.7rem; letter-spacing: .08em; color: var(--navy); font-weight: 900; }
.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.big-icon { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 26px; background: var(--accent-soft); color: var(--accent); }
.big-icon .i { width: 40px; height: 40px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .intro-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .pub-brand img { height: 38px; }
    .pub-tag { display: none; }
    .fields-grid { grid-template-columns: 1fr; }
    .choices-2col { grid-template-columns: 1fr; }
    .scale-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .star .i { width: 42px; height: 42px; }
    .step-nav .btn-lg { min-height: 50px; padding-inline: 1em; }
    .intro-actions .btn-xl { width: 100%; }
    .review-item { grid-template-columns: 1fr; }
    .review-item .btn { grid-column: 1; grid-row: auto; justify-self: start; }
}
