/* Lista de espera de Amor Extraordinario — réplica del Typeform «Dosiel» (negro, Montserrat, botón #7AFCCA, esquinas grandes). */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #000;
  --fg: #fff;
  --mint: #7AFCCA;
  --mint-ink: #000;
  --line: rgba(255, 255, 255, 0.32);
  --soft: rgba(255, 255, 255, 0.08);
  --muted: rgba(255, 255, 255, 0.62);
  --danger: #ff8d8d;
  --radius: 14px;
}
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; }
body { font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; font-size: 16px; line-height: 1.45; }
a { color: inherit; }

#app { position: fixed; inset: 0 0 48px 0; }
.screen { position: absolute; inset: 0; display: flex; opacity: 0; visibility: hidden; transform: translateY(36px); transition: opacity .38s ease, transform .38s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .38s; }
.screen.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.screen.leave-up { transform: translateY(-36px); }
.screen.leave-down { transform: translateY(36px); }

/* ── Pantallas con foto (bienvenida y finales): contenido a la izquierda, foto a la derecha ── */
.split { width: 100%; height: 100%; display: flex; flex-direction: row; }
.split .copy { flex: 1 1 50%; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 6vw, 88px); overflow-y: auto; }
.split .photo { flex: 1 1 50%; position: relative; background: #111; }
.split .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; }
.split .photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #000 0, rgba(0, 0, 0, 0) 22%); }
.copy .inner { max-width: 520px; }

h1, h2 { margin: 0 0 14px; font-weight: 500; letter-spacing: -0.01em; }
.title-l { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.18; }
.title-l strong, .q strong, .desc strong { font-weight: 700; }
.desc { color: var(--fg); font-size: clamp(15px, 1.5vw, 18px); margin: 0 0 28px; opacity: .92; }

/* ── Preguntas ── */
.q-wrap { width: 100%; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; }
.q-inner { margin: auto; width: 100%; max-width: 640px; padding: 40px clamp(24px, 5vw, 48px); }
.q { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.22; font-weight: 500; margin: 0 0 10px; }
.q .req { color: var(--mint); margin-left: 2px; }
.q-desc { color: var(--muted); font-size: 16px; margin: 0 0 24px; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.input, .select { width: 100%; background: transparent; border: 0; border-bottom: 2px solid var(--line); color: var(--fg); font: inherit; font-size: clamp(18px, 2vw, 22px); padding: 8px 2px 10px; border-radius: 0; outline: none; transition: border-color .2s; -webkit-appearance: none; appearance: none; }
.input::placeholder { color: rgba(255, 255, 255, 0.3); }
.input:focus, .select:focus { border-bottom-color: var(--mint); }
.input.bad { border-bottom-color: var(--danger); }
.row { display: flex; gap: 20px; }
.row > * { flex: 1 1 0; min-width: 0; }
.phone { display: flex; gap: 14px; align-items: flex-end; }
.phone .select { width: 132px; flex: 0 0 auto; font-size: 17px; padding-right: 18px; background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { color: #000; }
.err { color: var(--danger); font-size: 14px; margin: 4px 0 0; min-height: 0; }
.err:empty { display: none; }

/* Opciones (A, B, C…) */
.choices { display: flex; flex-direction: column; gap: 10px; margin: 0 0 22px; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--soft); color: var(--fg); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font: inherit; font-size: clamp(16px, 1.6vw, 19px); cursor: pointer; transition: background .15s, border-color .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.choice:hover { background: rgba(255, 255, 255, 0.14); }
.choice:active { transform: scale(.99); }
.choice .key { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.choice.sel { background: rgba(122, 252, 202, 0.16); border-color: var(--mint); }
.choice.sel .key { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); }
.choice .txt { flex: 1 1 auto; }

.check { display: flex; gap: 14px; align-items: flex-start; background: var(--soft); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; font-size: 16px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; margin-top: 1px; transition: .15s; }
.check input:checked + .box { background: var(--mint); border-color: var(--mint); }
.check input:checked + .box::after { content: ''; width: 6px; height: 11px; border: solid #000; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check input:focus-visible + .box { outline: 2px solid var(--mint); outline-offset: 2px; }
.check.sel { border-color: var(--mint); }

/* Botones */
.actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--mint); color: var(--mint-ink); border: 0; border-radius: var(--radius); padding: 14px 26px; font: inherit; font-weight: 600; font-size: 17px; cursor: pointer; transition: transform .12s, filter .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.hint { color: var(--muted); font-size: 13px; }
.hint kbd { font: inherit; font-weight: 600; }
.spin { width: 18px; height: 18px; border: 2.5px solid rgba(0, 0, 0, .25); border-top-color: #000; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.sending { color: var(--muted); display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.sending .spin { border-color: rgba(255, 255, 255, .25); border-top-color: var(--mint); }
.banner-err { background: rgba(255, 141, 141, .12); border: 1px solid var(--danger); color: #ffd0d0; border-radius: var(--radius); padding: 12px 14px; margin: 0 0 16px; font-size: 15px; }

/* Barra de progreso */
#bar { position: fixed; left: 0; right: 0; bottom: 0; height: 48px; padding: 0 clamp(20px, 4vw, 40px); display: flex; align-items: center; gap: 16px; background: #000; z-index: 5; }
#bar-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 108px; }
.bar-track { flex: 1; height: 4px; background: rgba(255, 255, 255, .16); border-radius: 4px; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: var(--mint); border-radius: 4px; transition: width .45s ease; }

/* ── Celular: foto arriba, contenido abajo ── */
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .split { flex-direction: column; }
  .split .photo { order: -1; flex: 0 0 38%; }
  .split .photo::after { background: linear-gradient(0deg, #000 0, rgba(0, 0, 0, 0) 30%); }
  .split .photo img { object-position: 50% 0%; }
  .split .copy { flex: 1 1 auto; justify-content: flex-start; padding: 22px 24px 28px; }
  .row { flex-direction: column; gap: 0; }
  .q-inner { padding: 28px 22px 36px; margin: 0 auto; }
  .btn { width: 100%; justify-content: center; }
  .hint { display: none; }
}
@media (max-height: 560px) and (min-width: 761px) { .split .copy { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { .screen, #bar-fill, .choice { transition: none; } .spin { animation-duration: 1.4s; } }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.choice:focus-visible, .input:focus-visible, .select:focus-visible { outline: none; }
.choice:focus-visible { border-color: #fff; }

/* ── Selector de país del teléfono: bandera (imagen) + indicativo, con buscador ── */
.phone-field { position: relative; }
.phone-row { display: flex; align-items: flex-end; gap: 14px; }
.phone-row .input { flex: 1 1 auto; min-width: 0; }
.cc-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; background: var(--soft); color: var(--fg); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; font: inherit; font-size: 17px; cursor: pointer; transition: border-color .15s, background .15s; -webkit-tap-highlight-color: transparent; }
.cc-btn:hover { background: rgba(255, 255, 255, 0.14); }
.cc-btn:focus-visible, .cc-btn[aria-expanded="true"] { border-color: var(--mint); outline: none; }
.cc-flag { display: block; width: 26px; height: 19px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); flex: none; }
.cc-dial { font-weight: 500; min-width: 38px; text-align: left; }
.cc-caret { flex: none; opacity: .7; transition: transform .15s; }
.cc-btn[aria-expanded="true"] .cc-caret { transform: rotate(180deg); }
.phone-row.bad .cc-btn { border-color: var(--danger); }
.cc-panel { position: absolute; z-index: 20; top: 74px; left: 0; width: min(340px, 100%); padding: 10px; background: #0e0e0e; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: var(--radius); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.7); }
.cc-search { display: block; width: 100%; font: inherit; font-size: 16px; color: var(--fg); padding: 11px 13px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--soft); outline: none; margin-bottom: 8px; }
.cc-search:focus { border-color: var(--mint); }
.cc-list { max-height: 248px; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0; padding: 0; list-style: none; outline: none; }
.cc-list .country-option { display: flex; align-items: center; gap: 12px; padding: 10px; font-size: 16px; border-radius: 9px; cursor: pointer; touch-action: manipulation; }
.cc-list .country-option img { display: block; width: 26px; height: 19px; border-radius: 3px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.cc-list .country-option-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-list .country-option-dial { color: var(--muted); font-size: 14.5px; }
.cc-list .country-option.is-active, .cc-list .country-option:hover { background: rgba(122, 252, 202, 0.14); }
.cc-list .country-option[aria-selected="true"] .country-option-name { color: var(--mint); font-weight: 600; }
.cc-list .country-empty { padding: 14px 8px; color: var(--muted); text-align: center; }
.fix { background: none; border: 0; color: var(--mint); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 2.5px solid rgba(0, 0, 0, .25); border-top-color: #000; border-radius: 50%; animation: sp .7s linear infinite; }
@media (max-width: 760px) {
  .phone-row { gap: 10px; }
  .cc-panel { width: 100%; }
}
