/* ═══════════════════════════════════════════════════════════════════════════
   TIQUETE AL FUTURO — inscripción paso a paso
   ---------------------------------------------------------------------------
   Capa de presentación sobre el formulario real: `apply-wizard.js` mueve los
   campos existentes a pasos, uno por pantalla. El formulario original sigue
   siendo el que valida y envía, así que si el JS falla se ve el formulario
   normal y nada se rompe.

   La metáfora es un tiquete: la persona no «llena un formulario», embarca en
   un proceso. Una pregunta a la vez, avance visible, y al final un pase de
   abordaje con sus datos.
   ═══════════════════════════════════════════════════════════════════════════ */

.wz-on { overflow: hidden; }
/* El formulario real: oculto pero vivo (sigue validando y enviando) */
.wz-on .shell.apply-public,
.shell.apply-public.wz-hidden { display: none !important; }

.wz {
    position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
    background: var(--sx-blue-950, #082B3A); color: #fff;
    font-family: var(--sx-font-sans, 'Inter', system-ui, sans-serif);
    -webkit-font-smoothing: antialiased;
}

/* Fondo: horizonte en movimiento muy lento, sin robar atención */
.wz-sky { position: absolute; inset: -25%; pointer-events: none; filter: blur(80px); opacity: .8; }
.wz-sky i { position: absolute; display: block; border-radius: 50%; animation: wzDrift 22s ease-in-out infinite alternate; }
.wz-sky i:nth-child(1) { width: 48vmax; height: 48vmax; left: -6%; top: -8%;  background: radial-gradient(circle, #1A8DB3 0%, transparent 65%); }
.wz-sky i:nth-child(2) { width: 42vmax; height: 42vmax; right: -8%; top: 30%; background: radial-gradient(circle, #0B7A9F 0%, transparent 65%); animation-delay: -8s; }
.wz-sky i:nth-child(3) { width: 36vmax; height: 36vmax; left: 20%; bottom: -12%; background: radial-gradient(circle, #38A6C9 0%, transparent 65%); animation-delay: -15s; }
@keyframes wzDrift { from { transform: translate3d(-3%,-2%,0) scale(1); } to { transform: translate3d(4%,3%,0) scale(1.12); } }

/* ── Cabecera: la ruta ─────────────────────────────────────────────────── */
.wz-top {
    position: relative; z-index: 2; flex-shrink: 0;
    padding: 18px 20px 0; display: flex; flex-direction: column; gap: 14px;
}
.wz-brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); }
.wz-brand img {
    width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: #fff; flex-shrink: 0;
}
/* Sin logotipo del cliente, la marca es el orbe (orbe.js lo anima) */
.wz-brand .wz-logo {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; position: relative; display: block;
    background:
        radial-gradient(circle at 34% 28%, rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 34%),
        radial-gradient(circle at 60% 70%, var(--sx-blue-300, #6FC3DD) 0%, var(--sx-blue-500, #1A8DB3) 48%, var(--sx-blue-800, #0C4F68) 100%);
    box-shadow: 0 0 18px rgba(111, 195, 221, .45);
}
.wz-route { display: flex; align-items: center; gap: 6px; }
.wz-route i {
    flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.18);
    position: relative; overflow: hidden;
}
.wz-route i::after {
    content: ''; position: absolute; inset: 0; width: 0; border-radius: 3px;
    background: linear-gradient(90deg, #6FC3DD, #fff);
    transition: width .45s cubic-bezier(.3,.8,.3,1);
}
.wz-route i.done::after { width: 100%; }
.wz-route i.now::after  { width: 55%; }
.wz-step-of { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.55); text-transform: uppercase; }

/* ── Cuerpo: una pregunta por pantalla ─────────────────────────────────── */
.wz-body {
    position: relative; z-index: 2; flex: 1; min-height: 0; overflow-y: auto;
    display: flex; align-items: center; justify-content: center; padding: 24px 20px;
    -webkit-overflow-scrolling: touch;
}
.wz-card { width: 100%; max-width: 520px; }
.wz-step { display: none; }
.wz-step.on { display: block; animation: wzIn .42s cubic-bezier(.2,.8,.2,1); }
.wz-step.back.on { animation: wzInBack .42s cubic-bezier(.2,.8,.2,1); }
@keyframes wzIn     { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes wzInBack { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

.wz-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6FC3DD; margin: 0 0 10px; }
.wz-q { margin: 0 0 8px; font-size: 27px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.wz-help { margin: 0 0 24px; font-size: 14.5px; line-height: 1.55; color: rgba(255,255,255,.7); }

/* Los campos reales, revestidos para esta pantalla */
.wz-field .form-label { display: none; }
.wz-field .form-input, .wz-field .form-select, .wz-field .form-textarea {
    width: 100%; font-size: 19px; font-weight: 500; padding: 16px 18px;
    color: #fff; background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.22); border-radius: 14px;
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.wz-field .form-select {
    appearance: none;
    /* Flecha propia: al quitar la del navegador hay que devolverla, o el
       desplegable no se lee como tal. */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center; background-size: 20px;
    padding-right: 48px; cursor: pointer;
}
.wz-field .form-select option { color: #0B2230; background: #fff; }
.wz-field .form-input::placeholder, .wz-field .form-textarea::placeholder { color: rgba(255,255,255,.4); }
.wz-field .form-input:focus, .wz-field .form-select:focus, .wz-field .form-textarea:focus {
    outline: none; border-color: #6FC3DD; background: rgba(255,255,255,.13);
    box-shadow: 0 0 0 4px rgba(111,195,221,.18);
}
.wz-field .form-input[readonly] { opacity: .85; border-style: dashed; }
.wz-field .field-hint { display: block; margin-top: 10px; font-size: 12.5px; color: rgba(255,255,255,.55); }
.wz-field .form-input.error, .wz-field .form-select.error { border-color: #FF9B9B; }
.wz-err { margin: 12px 0 0; font-size: 13.5px; font-weight: 600; color: #FFB4B4; min-height: 1.2em; }

/* ── Consentimiento ────────────────────────────────────────────────────────
   El texto legal necesita fondo claro para leerse, pero todo lo que lo rodea
   vive sobre el azul del asistente. Las piezas heredadas del formulario
   clásico traen colores pensados para fondo claro, así que aquí se repintan
   una por una: sin esto el botón de imprimir queda blanco sobre blanco y el
   aviso de «desplázate» desaparece.

   La caja se mantiene baja a propósito: la casilla de aceptar tiene que verse
   al mismo tiempo que el texto. Si queda debajo del pliegue, la persona no
   relaciona que el botón de continuar no avanza porque falta marcarla. */
.wz-step .tnc-wrapper { position: relative; background: #fff; border-radius: 14px; overflow: hidden; }
.wz-step .tnc-section {
    max-height: min(210px, 30vh); overflow-y: auto; padding: 16px 18px;
    color: #0B2230; font-size: 13.5px; line-height: 1.6;
}
/* Difuminado al pie: se ve que el texto sigue. Va colgado del borde superior
   de la barra de progreso (bottom: 100%), que es exactamente donde acaba la
   caja de texto: así no hay que adivinar cuánto miden el pie y la barra. Y es
   corto —una línea— porque el de antes, de 52px, se comía dos líneas y media
   y dejaba una frase cortada por la mitad. Desaparece al llegar al final. */
/* overflow visible: el difuminado cuelga por encima de la barra y con el
   `overflow: hidden` del estilo base se recortaba entero. El relleno nunca se
   sale —es un ancho en %—, así que no hacía falta recortar nada. */
.wz-step .tnc-progress-bar { position: relative; overflow: visible; }
.wz-step .tnc-progress-bar::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 26px; z-index: 2;
    pointer-events: none; opacity: 1; transition: opacity .25s ease;
    background: linear-gradient(rgba(255,255,255,0), #fff);
}
.wz-step .tnc-wrapper:has(.tnc-scroll-hint.complete) .tnc-progress-bar::after { opacity: 0; }

.wz-step .tnc-header { color: rgba(255,255,255,.75); margin-bottom: 10px; }
.wz-step .tnc-header .form-label { display: block; color: rgba(255,255,255,.8); }

/* Imprimir: en el asistente es un botón claro sobre azul, no blanco sobre blanco */
.wz-step .btn-print {
    background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28);
    color: rgba(255,255,255,.88);
}
.wz-step .btn-print:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }

/* Cuánto llevas leído: barra gruesa y visible sobre el azul */
.wz-step .tnc-progress-bar { height: 6px; background: rgba(11,35,48,.18); }
.wz-step .tnc-scroll-hint {
    background: #EAF4F8; color: #0A6382; font-size: 12px; font-weight: 600;
    border-top: 0; padding: 10px 14px;
}
.wz-step .tnc-scroll-hint.is-scrolling { background: #DCEEF6; color: #0A6382; }
.wz-step .tnc-scroll-hint:not(:disabled):hover { background: #CDE7F2; }
.wz-step .tnc-scroll-hint.complete { background: #E4F5EC; color: #15803D; }

/* La casilla es el paso que falta: apagada mientras no se pueda marcar,
   encendida en cuanto se termina de leer. */
.wz-step .check-row {
    display: flex; gap: 11px; align-items: flex-start; margin-top: 14px;
    padding: 12px 14px; border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
    font-size: 14px; line-height: 1.45; color: rgba(255,255,255,.9); cursor: pointer;
    transition: border-color .2s, background .2s, opacity .2s;
}
.wz-step .check-row input { width: 20px; height: 20px; margin-top: 0; accent-color: #6FC3DD; flex-shrink: 0; }
.wz-step .check-row:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.wz-step .check-row:has(input:not(:disabled)) { border-color: rgba(111,195,221,.6); background: rgba(111,195,221,.12); }
.wz-step .check-row:has(input:checked) { border-color: #2FA36B; background: rgba(47,163,107,.16); }
.wz-step .divider { display: none; }

/* ── Pie: avanzar ──────────────────────────────────────────────────────── */
.wz-foot {
    position: relative; z-index: 2; flex-shrink: 0;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(to top, rgba(8,43,58,.96), rgba(8,43,58,0));
}
.wz-back {
    background: none; border: none; padding: 12px; border-radius: 10px; cursor: pointer;
    color: rgba(255,255,255,.7); font: inherit; font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
}
.wz-back:hover { background: rgba(255,255,255,.1); color: #fff; }
.wz-back svg { width: 16px; height: 16px; }
.wz-next {
    flex: 1; padding: 16px 22px; border: none; border-radius: 14px; cursor: pointer;
    font: inherit; font-size: 16px; font-weight: 700; color: var(--sx-blue-900, #0E3F53);
    background: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    transition: transform .12s, box-shadow .18s, opacity .18s;
    box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
.wz-next:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(0,0,0,.34); }
.wz-next:active { transform: translateY(0) scale(.99); }
.wz-next[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.wz-next svg { width: 17px; height: 17px; }
.wz-enter { font-size: 11.5px; color: rgba(255,255,255,.45); text-align: center; margin: 10px 0 0; }
@media (hover: none) { .wz-enter { display: none; } }

/* ── Pase de abordaje: la portada y el cierre ──────────────────────────── */
.wz-pass {
    background: #fff; color: #0B2230; border-radius: 18px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.wz-pass-top {
    padding: 22px 22px 18px; background: linear-gradient(135deg, var(--sx-blue-600, #0B7A9F), var(--sx-blue-800, #0C4F68));
    color: #fff;
}
.wz-pass-top .lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.wz-pass-top .val { font-size: 21px; font-weight: 800; letter-spacing: -.01em; margin-top: 3px; }
.wz-pass-row { display: flex; gap: 18px; margin-top: 16px; }
.wz-pass-row > div { min-width: 0; }
/* La muesca del tiquete */
.wz-pass-tear {
    position: relative; height: 22px; background: #fff;
    background-image: radial-gradient(circle at 11px 11px, var(--sx-blue-950, #082B3A) 11px, transparent 12px),
                      radial-gradient(circle at calc(100% - 11px) 11px, var(--sx-blue-950, #082B3A) 11px, transparent 12px);
    background-repeat: no-repeat;
}
.wz-pass-tear::after {
    content: ''; position: absolute; left: 26px; right: 26px; top: 50%;
    border-top: 2px dashed var(--sx-surface-3, #E6EEF2);
}
.wz-pass-body { padding: 6px 22px 22px; }
.wz-pass-body dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.wz-pass-body dt { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-text-3, #6B8496); }
.wz-pass-body dd { margin: 3px 0 0; font-size: 14.5px; font-weight: 600; color: #0B2230; overflow: hidden; text-overflow: ellipsis; }
.wz-pass-body dd.wide, .wz-pass-body dt.wide { grid-column: 1 / -1; }

@media (max-width: 420px) {
    .wz-q { font-size: 23px; }
    .wz-field .form-input, .wz-field .form-select, .wz-field .form-textarea { font-size: 17px; padding: 14px 16px; }
    .wz-body { padding: 16px; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .wz-sky i, .wz-step.on { animation: none; }
    .wz-next { transition: none; }
}


/* ── Encendido de motores (portada) ───────────────────────────────────── */
.wz-engine { position: relative; width: 128px; height: 128px; margin: 0 auto 26px; color: #fff; }
.wz-eng-core {
    position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px;
    border-radius: 50%; background: radial-gradient(circle at 50% 45%, #fff 0%, #6FC3DD 42%, #0B7A9F 100%);
    box-shadow: 0 0 44px rgba(111,195,221,.65);
    animation: wzThrust 2.4s ease-in-out infinite;
}
@keyframes wzThrust {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 40px rgba(111,195,221,.55); }
    50%      { transform: scale(1.07); box-shadow: 0 0 62px rgba(111,195,221,.85); }
}
.wz-eng-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35); opacity: 0;
    animation: wzRing 3s cubic-bezier(.2,.7,.3,1) infinite;
}
.wz-eng-ring.b { animation-delay: 1s; }
.wz-eng-ring.c { animation-delay: 2s; }
@keyframes wzRing {
    0%   { transform: scale(.6); opacity: .8; }
    100% { transform: scale(1.5); opacity: 0; }
}
.wz-eng-ship {
    position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
    color: var(--sx-blue-950, #082B3A); animation: wzHover 3.4s ease-in-out infinite;
}
@keyframes wzHover { 0%,100% { transform: translateY(-2px); } 50% { transform: translateY(2px); } }

.wz-check { list-style: none; margin: 22px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.wz-check li {
    font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.9);
}
.wz-check li::before { content: '✓ '; color: #6FC3DD; font-weight: 800; }

/* ── Despegue (al enviar) ─────────────────────────────────────────────── */
.wz.wz-launch .wz-body { animation: wzLift 1.1s cubic-bezier(.6,0,.9,.2) forwards; }
.wz.wz-launch .wz-sky  { animation: wzWarp 1.1s ease-in forwards; }
@keyframes wzLift { to { transform: translateY(-16vh) scale(.94); opacity: 0; } }
@keyframes wzWarp { to { transform: scale(1.5); opacity: 1; filter: blur(40px); } }
.wz.wz-launch::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
    background: radial-gradient(circle at 50% 78%, rgba(111,195,221,.75) 0%, transparent 55%);
    opacity: 0; animation: wzBurn 1.1s ease-in forwards;
}
@keyframes wzBurn { 0% { opacity: 0; } 60% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 420px) { .wz-engine { width: 108px; height: 108px; margin-bottom: 20px; } }
@media (prefers-reduced-motion: reduce) {
    .wz-eng-core, .wz-eng-ring, .wz-eng-ship { animation: none; }
    .wz.wz-launch .wz-body, .wz.wz-launch .wz-sky, .wz.wz-launch::after { animation: none; }
}

/* `hidden` debe ganar a los display de este archivo */
.wz [hidden] { display: none !important; }

/* Entrada y salida del asistente cuando se abre desde el home */
.wz { animation: wzOpen .38s cubic-bezier(.2,.8,.2,1); }
@keyframes wzOpen { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.wz.wz-out { animation: wzClose .26s ease forwards; }
@keyframes wzClose { to { opacity: 0; transform: scale(.98); } }

.wz-close {
    position: absolute; right: 14px; top: 12px; z-index: 3;
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08);
    color: #fff; font-size: 22px; line-height: 1; font-family: inherit;
    display: flex; align-items: center; justify-content: center;
    transition: background .18s, transform .12s;
}
.wz-close:hover { background: rgba(255,255,255,.18); }
.wz-close:active { transform: scale(.94); }


/* ── Dentro del modal del home ─────────────────────────────────────────────
   Mismo asistente, pero ocupando el cuadro del modal en vez de la pantalla:
   el viaje ocurre dentro de `.lp-apply-dialog`, donde antes estaba la tarjeta
   del formulario. */
.wz.wz--inline {
    position: relative; inset: auto;
    height: min(78vh, 720px); max-height: calc(100dvh - 32px);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.wz.wz--inline .wz-top { padding: 16px 18px 0; }
.wz.wz--inline .wz-body { padding: 18px; }
.wz.wz--inline .wz-foot { padding: 14px 18px; }
.wz.wz--inline .wz-close { right: 12px; top: 10px; width: 34px; height: 34px; font-size: 20px; }
.wz.wz--inline .wz-engine { width: 104px; height: 104px; margin-bottom: 20px; }
.wz.wz--inline .wz-q { font-size: 24px; }
.wz.wz--inline .wz-step .tnc-section { max-height: min(170px, 24vh); }
@media (max-width: 480px) {
    .wz.wz--inline { height: calc(100dvh - 32px); border-radius: 16px; }
    .wz.wz--inline .wz-q { font-size: 22px; }
}
