/* =========================================================================
   SOPRINCO — diagnóstico
   Fotografía a pantalla completa + tarjeta blanca centrada. Rápido, sin ruido.
   ========================================================================= */

:root {
  --bp: #1B3570;
  --bp-deep: #13285A;
  --bp-wash: #EEF1F8;
  --ink: #0F1D3D;
  --ink-2: #4A5673;
  --ink-3: #6C7690;
  --line: #E1E4EA;
  --line-2: #C9CDD6;
  --error: #B42318;
  --f: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  background: var(--bp-deep); color: var(--ink);
  font: 400 1rem/1.55 var(--f); -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bp); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
.visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- fondo ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bp-deep); }
.bg__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 40%;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1s var(--ease), transform 8s var(--ease);
}
.bg__img.is-on { opacity: 1; transform: scale(1); }
.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,29,61,.28) 0%, rgba(15,29,61,.18) 40%, rgba(15,29,61,.55) 100%); }

/* ---------- encabezado ---------- */
.qhead { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; }
@media (min-width: 768px) { .qhead { padding: 24px 32px; } }
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: #fff; font-weight: 600; font-size: .9375rem; letter-spacing: .16em; }
.logo__mark { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.qclose {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .2s;
}
.qclose:hover { background: rgba(255,255,255,.26); }
.qclose svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ---------- tarjeta ---------- */
.qwrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 4px 10px 20px; }
@media (min-width: 768px) { .qwrap { padding: 8px 20px 32px; } }

.card {
  width: min(100%, 520px);
  background: #fff; border-radius: 24px;
  padding: 18px 20px 22px;
  box-shadow: 0 30px 80px -30px rgba(8, 18, 45, .55);
}
@media (min-width: 768px) { .card { padding: 26px 34px 32px; border-radius: 28px; } }

.card__top { display: flex; align-items: center; gap: 12px; height: 36px; margin-bottom: 18px; }
.qback { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-left: -6px; border-radius: 50%; color: var(--ink-2); transition: background-color .2s, color .2s; }
.qback:hover { background: var(--bp-wash); color: var(--bp); }
.qback svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.progress { flex: 1; display: flex; gap: 4px; }
.progress__seg { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; position: relative; }
.progress__seg::after { content: ""; position: absolute; inset: 0; background: var(--bp); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.progress__seg.is-done::after { transform: scaleX(1); }
.progress__seg.is-current::after { transform: scaleX(.4); }

/* ---------- transiciones ---------- */
.view { transition: opacity .22s var(--ease), transform .28s var(--ease); }
.view.is-leaving { opacity: 0; transition-duration: .14s; }
.view.is-leaving.to-fwd { transform: translateX(-12px); }
.view.is-leaving.to-back { transform: translateX(12px); }
.view.is-entering { opacity: 0; transition: none; }
.view.is-entering.from-fwd { transform: translateX(16px); }
.view.is-entering.from-back { transform: translateX(-16px); }

/* ---------- pregunta ---------- */
.intro { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.avatar { flex: none; width: 58px; height: 58px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--bp); border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--bp); color: #fff; font-size: .75rem; font-weight: 500; letter-spacing: .06em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.intro__hello { font-size: 1rem; line-height: 1.3; }
.intro__hello strong { font-weight: 600; }
.intro__role { font-size: .8125rem; color: var(--ink-3); }

.q-step { font-size: .8125rem; font-weight: 500; color: var(--bp); margin-bottom: 6px; }
.q-title { font-weight: 600; font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.85rem); line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
.q-lead { margin-top: 8px; color: var(--ink-2); font-size: .9375rem; text-wrap: pretty; }
.q-meta { margin-top: 8px; color: var(--ink-3); font-size: .8125rem; }
.q-hint { min-height: 1.2em; margin-top: 8px; font-size: .8125rem; color: var(--error); }
.q-hint:empty { min-height: 0; margin: 0; }

.options { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 58px; padding: 14px 16px 14px 18px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  text-align: left; font-weight: 500; font-size: 1rem; line-height: 1.3;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.option__label { display: flex; flex-direction: column; gap: 2px; }
.option__hint { font-size: .8125rem; font-weight: 400; color: var(--ink-3); }
.option__mark { flex: none; position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); transition: border-color .15s, background-color .15s; }
.option--multi .option__mark { border-radius: 7px; }
.option__mark::after {
  content: ""; position: absolute; left: 6.5px; top: 3px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .18s var(--ease);
}
.option:active { transform: scale(.99); }
.option[aria-pressed="true"] { border-color: var(--bp); background: var(--bp-wash); color: var(--bp-deep); }
.option[aria-pressed="true"] .option__mark { border-color: var(--bp); background: var(--bp); }
.option[aria-pressed="true"] .option__mark::after { transform: rotate(45deg) scale(1); }
.option.is-confirming { animation: pulse .28s var(--ease); }
.option.is-refused { animation: shake .3s var(--ease); }
@keyframes pulse { 50% { background: #E2E8F5; } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (hover: hover) {
  .option:hover:not([aria-pressed="true"]) { border-color: #B8C1D6; background: #FAFBFD; }
  .option:hover:not([aria-pressed="true"]) .option__mark { border-color: var(--bp); }
}

/* ---------- acciones ---------- */
.actionbar { margin-top: 18px; }
.actionbar__note:empty { display: none; }
.actionbar__note { margin-bottom: 14px; }
.insight { padding: 12px 14px; border-radius: 14px; background: var(--bp-wash); animation: fade .3s var(--ease); }
.insight__label { font-size: .75rem; font-weight: 500; color: var(--bp); }
.insight__text { margin-top: 4px; font-size: .9375rem; font-style: italic; font-weight: 300; }
@keyframes fade { from { opacity: 0; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 24px; border-radius: 999px;
  font: 500 1rem/1 var(--f); white-space: nowrap;
  transition: background-color .2s var(--ease), transform .12s var(--ease), opacity .2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(.985); }
.btn--blue, .btn--accent { background: var(--bp); color: #fff; }
.btn--blue:hover, .btn--accent:hover { background: var(--bp-deep); }
.btn--line { border: 1.5px solid var(--bp); color: var(--bp); }
.btn:disabled { background: var(--line); color: var(--ink-3); cursor: not-allowed; }
.btn--wide { width: 100%; }

.link { display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 6px auto 0; font-size: .875rem; font-weight: 500; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.link:hover { color: var(--bp); text-decoration-color: currentColor; }
.link--muted { color: var(--ink-3); }

/* ---------- cierre ---------- */
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .8125rem; font-weight: 500; color: var(--bp); }
.result__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bp); }
.done__check { position: relative; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--bp); }
.done__check::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 1.75px 1.75px 0; transform: rotate(45deg); }
.fit { margin: 20px 0; padding: 14px 16px; border-radius: 14px; background: var(--bp-wash); }
.fit__text { font-size: .9375rem; font-weight: 500; color: var(--bp-deep); }
.fit__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fit__chips li { padding: 4px 10px; border-radius: 999px; background: #fff; font-size: .75rem; color: var(--ink-2); }
.result__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.result__foot { margin-top: 6px; }
.done__time { margin-top: 10px; font-size: .875rem; color: var(--ink-3); }

/* ---------- formulario ---------- */
.lead__direct { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--bp-wash); font-size: .875rem; color: var(--ink-2); }
.lead__direct .link { display: inline; min-height: 0; margin: 0; }
.form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.form__pair { display: grid; gap: 12px; }
@media (min-width: 480px) { .form__pair { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .875rem; font-weight: 500; }
.field__opt { font-weight: 400; color: var(--ink-3); }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s; -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #A2A9B8; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--bp); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field__error { font-size: .8125rem; color: var(--error); }
.field__error:empty { display: none; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .8125rem; color: var(--ink-2); line-height: 1.45; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--bp); }
.consent a { text-decoration: underline; }
.consent .field__error { grid-column: 2; }
.form .btn { margin-top: 4px; }
.form__status { font-size: .875rem; color: var(--error); }
.form__status:empty { display: none; }
.lead__back { margin-top: 4px; }

/* ---------- dato de confianza + pie ---------- */
.bit {
  padding: 9px 16px; border-radius: 999px;
  color: #fff; font-size: .8125rem; font-weight: 500; text-align: center;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.26);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: opacity .18s var(--ease);
}
.bit.is-out { opacity: 0; }
.qfoot { padding: 0 16px calc(16px + env(safe-area-inset-bottom)); text-align: center; font-size: .75rem; color: rgba(255,255,255,.7); }
.qfoot a:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- cierre: señal de ayuda ---------- */
.help { text-align: center; padding: 6px 0 2px; }
.help__sign { position: relative; width: 104px; height: 104px; margin: 4px auto 18px; display: grid; place-items: center; }
.help__avatar {
  position: relative; z-index: 1; width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--bp); color: #fff;
  font-size: 1.125rem; font-weight: 500; letter-spacing: .06em;
  box-shadow: 0 0 0 4px #fff, 0 12px 30px -10px rgba(19,40,90,.6);
}
.help__avatar img { width: 100%; height: 100%; object-fit: cover; }
.help__ring { position: absolute; inset: 10px; border-radius: 50%; border: 1.5px solid var(--bp); opacity: 0; animation: help-ring 2.6s var(--ease) infinite; }
.help__ring--2 { animation-delay: 1.3s; }
@keyframes help-ring { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
.help__badge {
  position: absolute; z-index: 2; right: -10px; bottom: 6px;
  padding: 5px 11px; border-radius: 999px; background: #fff; color: var(--bp);
  font-size: .75rem; font-weight: 600; box-shadow: 0 6px 16px -6px rgba(19,40,90,.45);
  animation: pop .5s .25s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(6px); } }
.help__eyebrow { font-size: .8125rem; font-weight: 500; color: var(--bp); }
.help__title { margin-top: 4px; font-weight: 600; font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem); line-height: 1.12; letter-spacing: -.03em; }
.help__body { margin: 10px auto 0; max-width: 32ch; color: var(--ink-2); font-size: .9375rem; }
.help__perks { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.help__perks li { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--bp-wash); color: var(--bp-deep); font-size: .8125rem; font-weight: 500; }
.help__perks svg { width: 14px; height: 14px; }
.help__cta { margin-top: 22px; height: 58px; font-weight: 600; }

/* Confirmación, también centrada */
.done { text-align: center; }
.done .eyebrow { justify-content: center; }
.done .result__actions { align-items: stretch; }

/* Ícono de WhatsApp dentro de un botón (relleno, no trazo) */
.btn .wa-icon { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.btn:hover .wa-icon { transform: none; }

/* Campo trampa para bots */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__note { margin-top: -2px; font-size: .8125rem; color: var(--ink-3); text-align: center; }
