/* ==========================================================================
   CAECF surveys: respondent screens (one question at a time, mobile first)
   ========================================================================== */
:root {
  --red: #B8282C; --red-d: #941E22; --red-l: #FCEEEE;
  --navy: #0A2463; --navy-d: #06173F; --navy-l: #EAEEF7;
  --ink: #141B2D; --body: #3A4154; --muted: #687086; --line: #E2E5EE; --soft: #F4F6FA; --ok: #1E8E5A;
  --f-head: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sv-body { margin: 0; min-height: 100vh; font-family: var(--f-body); font-size: 18px; line-height: 1.55; color: var(--body);
  background: radial-gradient(1200px 500px at 100% -10%, #E7ECF8 0, transparent 60%), radial-gradient(900px 400px at -10% 110%, #F9E7E8 0, transparent 60%), var(--soft); }
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2 { font-family: var(--f-head); color: var(--ink); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 .5em; }
kbd { font: 700 .75em var(--f-head); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--ink); }
[hidden] { display: none !important; }

/* top bar + progress */
.sv-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px clamp(14px, 3vw, 28px); background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.sv-brand img { height: 40px; width: auto; }
.sv-top-step { margin-left: auto; font: 700 .85rem var(--f-head); color: var(--muted); }
.sv-exit { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 30px; text-decoration: none; color: var(--muted); font: 600 .9rem var(--f-head); }
.sv-exit:hover { background: var(--soft); color: var(--ink); }
.sv-top-step:empty + .sv-exit { margin-left: auto; }
.sv-bar { position: sticky; top: 61px; z-index: 19; height: 4px; background: transparent; }
.sv-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), #E0484D); border-radius: 0 4px 4px 0; transition: width .5s var(--ease); }
.sv-preview { background: #FFF4D6; color: #6B4E00; text-align: center; padding: 8px 16px; font-size: .9rem; }

.sv-main { padding: clamp(18px, 4vw, 48px) 14px 60px; }
.sv-card { position: relative; max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 26px; padding: clamp(22px, 4.5vw, 44px); box-shadow: 0 2px 6px rgba(10, 36, 99, .05), 0 24px 60px rgba(10, 36, 99, .08); }

/* steps: without JS every question shows on one long page */
.sv-step + .sv-step { margin-top: 18px; }
.sv-jsonly { display: none !important; }
.sv-js .sv-jsonly { display: revert !important; }
.sv-js .sv-nav.sv-jsonly, .sv-js .sv-presets.sv-jsonly, .sv-js .sv-filter.sv-jsonly { display: flex !important; }
.sv-js .sv-step { display: none; margin: 0; }
.sv-js .sv-step.is-on { display: block; animation: svIn .45s var(--ease); }
.sv-js .sv-step.is-on.from-back { animation-name: svInBack; }
@keyframes svIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes svInBack { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

/* welcome */
.sv-welcome { display: grid; gap: 22px; max-width: 1040px; margin: 0 auto; }
.sv-js .sv-welcome.is-on { display: grid; }
.sv-js .sv-welcome { margin: 0 auto; }
.sv-kicker { display: inline-flex; align-items: center; gap: 8px; font: 800 .74rem var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; }
.sv-welcome h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.sv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.sv-chips span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 30px; background: var(--navy-l); color: var(--navy); font: 700 .86rem var(--f-head); }
.sv-lead { font-size: 1.06rem; color: var(--body); }
.sv-promise { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; }
.sv-promise li { display: flex; gap: 12px; align-items: flex-start; font-size: .98rem; }
.sv-promise i { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--red-l); color: var(--red); }
.sv-note { display: flex; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #E8F6EE; color: #145C3A; margin-bottom: 18px; font-size: .97rem; }
.sv-note-err { background: var(--red-l); color: var(--red-d); }
.sv-resume { padding: 16px 18px; border-radius: 16px; border: 2px dashed #F0B9BB; background: #FFF8F8; margin-bottom: 16px; }
.sv-resume-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.sv-start { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sv-hint { color: var(--muted); font-size: .9rem; }
.sv-phone { align-self: start; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 22px; color: var(--muted); font-size: .92rem; }
.sv-phone strong { color: var(--ink); display: block; }
.sv-qr { width: 168px; height: 168px; margin: 0 auto 12px; }
.sv-qr svg, .sv-qr img { width: 100%; height: 100%; }
@media (min-width: 980px) { .sv-welcome { grid-template-columns: minmax(0, 1fr) 240px; align-items: start; } .sv-welcome .sv-card { margin: 0; max-width: none; } }
@media (max-width: 979px) { .sv-desk { display: none !important; } }
@media (hover: none) { .sv-desk { display: none !important; } }

/* buttons */
.sv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 40px; border: 2px solid transparent; font: 700 1rem var(--f-head); cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s, transform .15s, box-shadow .2s; }
.sv-btn:active { transform: scale(.98); }
.sv-btn-red { background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(184, 40, 44, .28); }
.sv-btn-red:hover { background: var(--red-d); color: #fff; }
.sv-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.sv-btn-ghost:hover { border-color: var(--navy); }
.sv-btn-lg { min-height: 58px; padding: 0 30px; font-size: 1.08rem; }
.sv-btn[disabled] { opacity: .6; pointer-events: none; }
.sv-btn:focus-visible, .sv-opt:focus-within, .sv-pt:focus-within, .sv-chip:focus-visible, .sv-input:focus { outline: 3px solid rgba(10, 36, 99, .35); outline-offset: 2px; }

/* question */
.sv-q-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sv-q-num { font: 800 .78rem var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.sv-opt-tag { font: 700 .72rem var(--f-head); padding: 3px 9px; border-radius: 20px; background: var(--soft); color: var(--muted); letter-spacing: .04em; }
.sv-q-label { font-size: clamp(1.3rem, 3.4vw, 1.75rem); margin-bottom: 8px; }
.sv-help { color: var(--muted); margin: 0 0 6px; font-size: 1rem; }
.sv-field { margin-top: 20px; }
.sv-mini { font-size: .88rem; color: var(--muted); margin: 0 0 10px; display: flex; gap: 6px; align-items: center; }

.sv-opts { display: grid; gap: 10px; }
.sv-opt { position: relative; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; -webkit-tap-highlight-color: transparent; }
.sv-opt:hover { border-color: #B9C3DA; }
.sv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.sv-key { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid #C9D1E3; display: grid; place-items: center; font: 800 .8rem var(--f-head); color: var(--muted); background: #fff; }
.sv-opt-t { flex: 1; font-weight: 600; color: var(--ink); font-size: 1.02rem; line-height: 1.3; }
.sv-tickmark { opacity: 0; color: var(--red); font-size: 1.3rem; transition: opacity .15s, transform .2s var(--ease); transform: scale(.6); }
.sv-opt:has(input:checked) { border-color: var(--red); background: var(--red-l); }
.sv-opt:has(input:checked) .sv-key { background: var(--red); border-color: var(--red); color: #fff; }
.sv-opt:has(input:checked) .sv-tickmark { opacity: 1; transform: none; }
.sv-opt.is-checked { border-color: var(--red); background: var(--red-l); }
.sv-opt.is-checked .sv-key { background: var(--red); border-color: var(--red); color: #fff; }
.sv-opt.is-checked .sv-tickmark { opacity: 1; transform: none; }
.sv-opt.flash { animation: svFlash .35s; }
@keyframes svFlash { 50% { transform: scale(.98); } }
.sv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sv-grid .sv-opt { min-height: 50px; padding: 10px 12px; }
.sv-grid .sv-opt-t { font-size: .96rem; }
@media (min-width: 640px) { .sv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sv-filter { align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-radius: 14px; border: 2px solid var(--line); margin-bottom: 12px; color: var(--muted); }
.sv-filter input { flex: 1; border: 0; outline: 0; font: inherit; background: transparent; color: var(--ink); min-width: 0; }
.sv-other { display: none; margin-top: 12px; }
.sv-other.is-on { display: block; animation: svIn .3s var(--ease); }
.sv-sublabel { display: block; font: 700 .9rem var(--f-head); color: var(--ink); margin-bottom: 6px; }

.sv-input { width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink); padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: #fff; transition: border-color .15s; }
.sv-input:focus { border-color: var(--navy); outline: none; }
.sv-input-lg { font-size: 1.2rem; min-height: 60px; }
textarea.sv-input { resize: vertical; min-height: 140px; line-height: 1.5; }

/* scale */
.sv-scale { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.sv-pt { position: relative; cursor: pointer; --hue: calc(var(--t) * 120); }
.pol-low_good .sv-pt { --hue: calc(120 - var(--t) * 120); }
.sv-pt input { position: absolute; opacity: 0; pointer-events: none; }
.sv-pt-n { display: grid; place-items: center; height: 58px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font: 800 1.15rem var(--f-head); color: var(--ink); transition: background .15s, border-color .15s, color .15s, transform .15s; }
.sv-pt:hover .sv-pt-n { border-color: hsl(var(--hue) 55% 45%); }
.sv-pt:has(input:checked) .sv-pt-n, .sv-pt.is-checked .sv-pt-n { background: hsl(var(--hue) 62% 42%); border-color: hsl(var(--hue) 62% 42%); color: #fff; transform: translateY(-2px); }
.sv-scale.is-labelled { grid-template-columns: 1fr; }
.sv-scale.is-labelled .sv-pt { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; }
.sv-scale.is-labelled .sv-pt-n { width: 18px; height: 18px; border-radius: 50%; border: 0; background: hsl(var(--hue) 62% 45%); flex: none; }
.sv-scale.is-labelled .sv-pt-l { font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.sv-scale.is-labelled .sv-pt:has(input:checked), .sv-scale.is-labelled .sv-pt.is-checked { border-color: hsl(var(--hue) 62% 42%); background: hsl(var(--hue) 70% 96%); }
.sv-scale.is-labelled .sv-pt:has(input:checked) .sv-pt-n, .sv-scale.is-labelled .sv-pt.is-checked .sv-pt-n { transform: none; box-shadow: 0 0 0 5px hsl(var(--hue) 62% 85%); }
.sv-scale-ends { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: .88rem; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) {
  .sv-scale:not(.is-labelled)[style*="--n:10"], .sv-scale:not(.is-labelled)[style*="--n:11"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* duration / date chips */
.sv-presets { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sv-chip { min-height: 42px; padding: 0 16px; border-radius: 30px; border: 2px solid var(--line); background: #fff; font: 700 .92rem var(--f-head); color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.sv-chip:hover { border-color: var(--navy); }
.sv-chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.sv-dur { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sv-dur-f label { display: block; font: 700 .85rem var(--f-head); color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
.sv-step-in { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.sv-step-in:focus-within { border-color: var(--navy); }
.sv-step-in input { flex: 1; min-width: 0; border: 0; outline: 0; text-align: center; font: 800 1.6rem var(--f-head); color: var(--ink); padding: 10px 0; -moz-appearance: textfield; }
.sv-step-in input::-webkit-outer-spin-button, .sv-step-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sv-step-in button { width: 52px; border: 0; background: var(--soft); font: 700 1.5rem var(--f-head); color: var(--navy); cursor: pointer; }
.sv-js .sv-step-in button.sv-jsonly { display: block !important; }
.sv-step-in button:hover { background: var(--navy-l); }
.sv-dur-read { margin: 12px 0 0; font: 700 1rem var(--f-head); color: var(--navy); min-height: 1.5em; }

/* errors + nav */
.sv-err { margin: 14px 0 0; color: var(--red-d); font-weight: 600; font-size: .95rem; min-height: 0; }
.sv-err:empty { display: none; }
.sv-err::before { content: "\F33A"; font-family: "bootstrap-icons"; margin-right: 6px; }
.has-err .sv-card { animation: svShake .4s; }
@keyframes svShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.sv-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.sv-nojs .sv-nav { display: flex; justify-content: flex-end; }
.sv-nav [data-next] { min-width: 140px; }

/* review */
.sv-sum { list-style: none; counter-reset: s; padding: 0; margin: 18px 0 0; display: grid; gap: 8px; }
.sv-sum li button { width: 100%; text-align: left; display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.sv-sum li button:hover { border-color: var(--navy); background: var(--soft); }
.sv-sum b { font: 800 .8rem var(--f-head); color: var(--red); padding-top: 2px; }
.sv-sum .q { display: block; font-size: .9rem; color: var(--muted); line-height: 1.35; }
.sv-sum .a { display: block; font-weight: 700; color: var(--ink); margin-top: 3px; overflow-wrap: anywhere; }
.sv-sum .a.skip { color: #A3AEC8; font-weight: 600; font-style: italic; }
.sv-sum i { color: var(--muted); }

/* end screens */
.sv-end { text-align: center; }
.sv-end h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); }
.sv-end .sv-lead { max-width: 520px; margin: 0 auto; }
.sv-tick { width: 96px; height: 96px; margin: 4px auto 18px; }
.sv-tick circle { fill: #E8F6EE; stroke: var(--ok); stroke-width: 4; stroke-dasharray: 230; stroke-dashoffset: 230; animation: svDraw .7s var(--ease) forwards; }
.sv-tick path { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: svDraw .45s var(--ease) .55s forwards; }
@keyframes svDraw { to { stroke-dashoffset: 0; } }
.sv-closed-ic { width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 2rem; color: var(--muted); }
.sv-share { margin: 28px auto 0; padding: 20px; border-radius: 18px; background: var(--soft); max-width: 540px; }
.sv-share p { margin: 0 0 12px; font-size: .97rem; }
.sv-share-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.sv-btn-wa { background: #25D366; color: #fff; }
.sv-btn-wa:hover { background: #1EB257; color: #fff; }
.sv-end-links { display: grid; gap: 8px; max-width: 540px; margin: 22px auto 0; text-align: left; }
.sv-end-links a { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; color: var(--ink); }
.sv-end-links a:hover { border-color: var(--navy); }
.sv-end-links i { color: var(--red); font-size: 1.15rem; }

.sv-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: .3s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
.sv-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  body.sv-body { font-size: 17px; }
  .sv-main { padding: 14px 10px 40px; }
  .sv-card { border-radius: 22px; }
  .sv-brand img { height: 34px; }
  .sv-bar { top: 55px; }
  .sv-exit span { display: none; }
  .sv-nav { position: sticky; bottom: 0; background: #fff; margin: 22px -22px -22px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-radius: 0 0 22px 22px; }
  .sv-nav [data-next], .sv-nav [data-submit] { flex: 1; }
  .sv-step-in button { width: 40px; font-size: 1.3rem; }
  .sv-step-in input { font-size: 1.35rem; }
  .sv-btn-lg { padding: 0 18px; font-size: 1rem; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .sv-tick circle, .sv-tick path { stroke-dashoffset: 0; } }
