/* ==========================================================================
   LUMINIK QUANTUM 2030 — Hoja de estilos de la pantalla de acceso (Fase 3B)
   Se carga únicamente desde login2030.php. Prefijo de clases: lx-

   CONTRATO DE ESTADOS (para acordar con js/login2030.js, Fase 3C)
   - #lxCard[data-state]     : idle | loading | error | success
   - #btnIngresar[data-state]: idle | loading | error | success
   - #btnIngresar[aria-disabled="true"] => aspecto inactivo (estado actual)
   - #lxFlow[data-stage]     : select | form (el JS alterna además el atributo
                               `hidden` de #lxChoice / #lxCard; el CSS lo respeta)
   - .lx-choice__card[data-state]: idle | selected | dimmed (los asigna el JS;
                               el CSS no decide la selección)
   - #lxModoEtiqueta         : texto de modalidad; vacío => oculto (:empty)
   - input[aria-invalid="true"] => campo con error
   - #btnTogglePass[aria-pressed="true"] => contraseña visible
   - Reinicio del temblor de error: JS debe quitar y volver a poner
     data-state="error" (forzando reflow) para repetir la animación.
   - Luz del botón (opcional): JS puede fijar --lx-mx y --lx-my (ej. "40%")
     en #btnIngresar; sin JS el brillo queda centrado.
   - Canvas: #quantumCanvas ocupa 100% de .lx-backdrop; JS debe dimensionar
     el buffer a partir de clientWidth/clientHeight y devicePixelRatio.

   ÍNDICE
   1. Tokens   2. Base   3. Fondo   4. Escena y composición   5. Identidad
   6. Tarjeta  7. Selector   8. Campos   9. Mensajes   10. Botón
   11. Estados   12. Animaciones   13. Responsive   14. Accesibilidad
   ========================================================================== */


/* 1. TOKENS ---------------------------------------------------------------- */
.lx-body {
    --lx-night: #040C18;
    --lx-navy: #081A2B;
    --lx-blue: #087FC7;
    --lx-cyan: #00BCD4;
    --lx-cyan-soft: #75E6ED;
    --lx-silver: #C6C7CE;
    --lx-white: #FFFFFF;
    --lx-danger: #FF7A8A;
    --lx-success: #7CF2C8;

    --lx-ease-out: cubic-bezier(.22, 1, .36, 1);
    --lx-ease-io: cubic-bezier(.65, 0, .35, 1);

    --lx-font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;

    --lx-logo-w: clamp(210px, 62vw, 320px);
    --lx-halo: min(calc(var(--lx-logo-w) * 1.9), 96vw);
    --lx-edge: var(--lx-cyan-soft);

    /* Punto focal de la iluminación (centro aproximado de la identidad) */
    --lx-fx: 50%;
    --lx-fy: 21%;
}


/* 2. BASE ------------------------------------------------------------------ */
html {
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: #040C18;
}

.lx-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--lx-night);
    color: var(--lx-white);
    font-family: var(--lx-font);
    font-size: 1rem;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.lx-stage *,
.lx-stage *::before,
.lx-stage *::after {
    box-sizing: border-box;
}

.lx-body ::selection {
    background: rgba(0, 188, 212, .35);
    color: var(--lx-white);
}


/* 3. FONDO QUANTUM (decorativo, no interactivo) ---------------------------- */
.lx-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.lx-layer,
.lx-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.lx-canvas { display: block; }

/* Luz ambiental */
.lx-layer--base {
    background:
        radial-gradient(ellipse 30% 38% at var(--lx-fx) var(--lx-fy), rgba(0, 188, 212, .20), transparent 72%),
        radial-gradient(ellipse 70% 58% at var(--lx-fx) var(--lx-fy), rgba(8, 127, 199, .30), transparent 72%),
        radial-gradient(ellipse 48% 40% at 88% 94%, rgba(0, 188, 212, .12), transparent 70%),
        radial-gradient(ellipse 40% 36% at 6% 92%, rgba(8, 127, 199, .14), transparent 72%),
        linear-gradient(180deg, var(--lx-navy) 0%, var(--lx-night) 72%);
}

/* Rejilla tecnológica sutil, desvanecida hacia los bordes */
.lx-layer--grid {
    background-image:
        linear-gradient(rgba(117, 230, 237, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(117, 230, 237, .055) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 62% at var(--lx-fx) var(--lx-fy), #000 8%, transparent 74%);
            mask-image: radial-gradient(ellipse 70% 62% at var(--lx-fx) var(--lx-fy), #000 8%, transparent 74%);
}

/* Geometría discreta: diagonales finas y arcos concéntricos */
.lx-layer--lines {
    display: none;
    background:
        linear-gradient(115deg, transparent 0 36%, rgba(117, 230, 237, .14) 36.05%, transparent 36.2%),
        linear-gradient(115deg, transparent 0 70%, rgba(117, 230, 237, .10) 70.05%, transparent 70.2%),
        radial-gradient(circle at var(--lx-fx) var(--lx-fy),
            transparent 0 24vmin, rgba(0, 188, 212, .12) 24.1vmin, transparent 24.3vmin,
            transparent 38vmin, rgba(0, 188, 212, .08) 38.1vmin, transparent 38.3vmin,
            transparent 52vmin, rgba(0, 188, 212, .045) 52.1vmin, transparent 52.3vmin);
}

.lx-layer--vignette {
    background: radial-gradient(ellipse at 50% 45%, transparent 42%, rgba(2, 6, 12, .82) 100%);
}


/* 4. ESCENA Y COMPOSICIÓN -------------------------------------------------- */
.lx-stage {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 1fr auto;     /* fila 1: contenido · fila 2: pie legal (#lxLegal) */
    justify-items: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding-block: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-bottom));
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
    overflow-x: clip;
}

.lx-main {
    display: grid;
    justify-items: center;
    align-items: center;
    gap: clamp(.5rem, 3vh, 1.75rem);
    width: min(100%, 72rem);
    perspective: 1200px;
}


/* 5. IDENTIDAD, LOGOTIPO Y HALO -------------------------------------------- */
.lx-identity {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
}

.lx-logo {
    position: relative;
    z-index: 1;
    display: block;
    width: var(--lx-logo-w);
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    /* Sombra estática (no animada) para separar el logotipo del fondo */
    filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .45));
    animation: lx-logo-in 1s var(--lx-ease-out) .1s backwards;
}

.lx-halo {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.lx-halo__glow,
.lx-halo__ring {
    grid-area: 1 / 1;
    width: var(--lx-halo);
    aspect-ratio: 1;
    border-radius: 50%;
}

/* Resplandor: núcleo oscuro (separa y da contraste a la tipografía plateada del
   logotipo) rodeado por un anillo de luz cian que lo envuelve */
.lx-halo__glow {
    background:
        radial-gradient(closest-side circle,
            rgba(4, 12, 24, .50) 0%, rgba(4, 12, 24, .36) 38%,
            rgba(0, 188, 212, .22) 62%, rgba(8, 127, 199, .11) 79%, transparent 100%);
    animation: lx-breathe 7s ease-in-out infinite alternate;
}

.lx-halo__ring {
    position: relative;
    border: 1px solid rgba(117, 230, 237, .20);
    border-top-color: rgba(117, 230, 237, .80);
    animation: lx-spin 48s linear infinite;
}

/* Nodo luminoso que orbita sobre el anillo (pseudo-elemento, sin capas nuevas) */
.lx-halo__ring::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: var(--lx-cyan-soft);
    box-shadow: 0 0 8px 1px rgba(117, 230, 237, .7);
}

.lx-halo__ring--inner {
    width: calc(var(--lx-halo) * .74);
    border-style: dashed solid solid dashed;
    border-color: rgba(117, 230, 237, .16);
    border-bottom-color: rgba(8, 127, 199, .85);
    animation-duration: 34s;
    animation-direction: reverse;
}

.lx-halo__ring--inner::after {
    top: auto;
    bottom: -2.5px;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    background: var(--lx-blue);
    box-shadow: 0 0 7px 1px rgba(8, 127, 199, .8);
}


/* 6. TARJETA DE ACCESO ----------------------------------------------------- */
.lx-card {
    position: relative;
    isolation: isolate;
    width: min(100%, 27.5rem);
    border: 1px solid rgba(117, 230, 237, .20);
    border-radius: 22px;
    background:
        radial-gradient(120% 55% at 0% 0%, rgba(0, 188, 212, .10), transparent 55%),
        linear-gradient(160deg, rgba(17, 44, 70, .94), rgba(5, 14, 26, .97));
    box-shadow:
        0 40px 90px -28px rgba(0, 0, 0, .8),
        0 2px 6px rgba(0, 0, 0, .35),
        0 0 80px -36px rgba(0, 188, 212, .5),
        inset 0 1px 0 rgba(255, 255, 255, .09),
        inset 0 -24px 40px -30px rgba(0, 0, 0, .5);
    transform-origin: 50% 100%;
    animation: lx-card-in .8s var(--lx-ease-out) .2s backwards;
}

/* Cristal real solo donde hay soporte; sin él, el fondo opaco mantiene el contraste */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .lx-card {
        background:
            radial-gradient(120% 55% at 0% 0%, rgba(0, 188, 212, .10), transparent 55%),
            linear-gradient(160deg, rgba(17, 44, 70, .72), rgba(5, 14, 26, .82));
        -webkit-backdrop-filter: blur(14px) saturate(1.25);
                backdrop-filter: blur(14px) saturate(1.25);
    }
}

/* Reflejo suave en la parte superior (volumen de cristal) */
.lx-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, 0) 26%);
    pointer-events: none;
}

.lx-card__body {
    position: relative;
    padding: clamp(1.5rem, 5vw, 2.25rem);
}

/* Borde luminoso: se muestra solo si el navegador soporta el enmascarado */
.lx-card__edge { display: none; }

@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
    .lx-card__edge {
        display: block;
        position: absolute;
        inset: -1px;
        z-index: 2;
        padding: 1px;
        border-radius: inherit;
        overflow: hidden;
        pointer-events: none;
        background: rgba(117, 230, 237, .20);
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
                mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
                mask-composite: exclude;
        transition: background-color .4s ease;
    }

    .lx-card__edge::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 240%;
        aspect-ratio: 1;
        background: conic-gradient(from 0deg, transparent 0 72%, var(--lx-edge) 91%, transparent 100%);
        opacity: .9;
        transform: translate(-50%, -50%) rotate(0deg);
        animation: lx-edge-spin 12s linear infinite;
    }

    .lx-card:focus-within .lx-card__edge {
        background: rgba(117, 230, 237, .26);
    }
}

.lx-title {
    margin: 0 0 1.5rem;
    font-size: clamp(1.35rem, 4.5vw, 1.6rem);
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.2;
    color: var(--lx-white);
    animation: lx-fade-up .6s var(--lx-ease-out) .4s backwards;
}

.lx-title::after {
    content: "";
    display: block;
    width: 3rem;
    height: 2px;
    margin-top: .75rem;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--lx-cyan-soft), var(--lx-cyan) 40%, transparent);
    box-shadow: 0 0 10px rgba(0, 188, 212, .55);
}

.lx-form {
    display: grid;
    gap: 1.15rem;
}

.lx-form > * { animation: lx-fade-up .6s var(--lx-ease-out) backwards; }
.lx-form > :nth-child(1) { animation-delay: .46s; }
.lx-form > :nth-child(2) { animation-delay: .53s; }
.lx-form > :nth-child(3) { animation-delay: .60s; }
.lx-form > :nth-child(4) { animation-delay: .67s; }
.lx-form > :nth-child(5) { animation-delay: .74s; }


/* 6B. FLUJO DE DOS ETAPAS (#lxFlow) ---------------------------------------- */
/* Las etapas ocultas con el atributo hidden nunca son visibles ni enfocables */
.lx-stage [hidden] { display: none; }

.lx-flow {
    display: grid;
    justify-items: center;
    align-items: center;
    width: 100%;
    min-width: 0;
}

/* Ambas etapas comparten celda: al alternarlas no se desplaza el layout */
.lx-flow > * {
    grid-area: 1 / 1;
    min-width: 0;
}


/* 6C. ETAPA 1 — SELECCIÓN DE ACCESO (#lxChoice) ---------------------------- */
.lx-choice {
    display: grid;
    justify-items: center;
    width: 100%;
    text-align: center;
}

.lx-choice__title {
    margin: 0 0 .5rem;
    font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem);
}

.lx-choice__title::after {
    width: 5rem;
    margin-inline: auto;
    background: linear-gradient(90deg, transparent, var(--lx-cyan) 30%, var(--lx-cyan-soft) 50%, var(--lx-cyan) 70%, transparent);
}

.lx-choice__lead {
    max-width: 34ch;
    margin: 0 0 1.5rem;
    color: rgba(198, 199, 206, .92);
    animation: lx-fade-up .6s var(--lx-ease-out) .46s backwards;
}

.lx-choice__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(.9rem, 2vw, 1.5rem);
    width: 100%;
}

/* Card = botón real. Foto a sangre, degradado para legibilidad y texto superpuesto */
.lx-choice__card {
    position: relative;
    isolation: isolate;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;              /* más horizontal: preserva la composición de las fotos */
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(160deg, #0C2740, #050E1A);   /* base si la imagen no carga */
    box-shadow: 0 26px 50px -26px rgba(0, 0, 0, .85);
    color: var(--lx-white);
    font: inherit;
    text-align: left;
    cursor: pointer;
    outline: 3px solid transparent;
    outline-offset: 4px;
    -webkit-tap-highlight-color: transparent;
    transition: transform .55s var(--lx-ease-out), opacity .45s ease, outline-color .2s ease;
    animation: lx-rise .7s var(--lx-ease-out) backwards;
}

.lx-choice__card--cabina { animation-delay: .55s; }
.lx-choice__card--emple  { animation-delay: .68s; }

/* Resplandor exterior: solo cambia la opacidad */
.lx-choice__card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: 0 26px 52px -20px rgba(0, 188, 212, .6);
    opacity: 0;
    pointer-events: none;
    transition: opacity .45s ease;
}

.lx-choice__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
    /* Fondo complementario Quantum: rellena el espacio sobrante sin franjas ajenas */
    background:
        radial-gradient(90% 70% at 50% 0%, rgba(8, 127, 199, .22), transparent 70%),
        linear-gradient(180deg, #0B2540 0%, #060F1C 100%);
}

/* La foto se muestra COMPLETA (contain), sin deformarse, alineada arriba: si es más
   panorámica que la card, el espacio sobrante queda abajo, donde va el texto.
   Para afinar una foto concreta (dimensiones reales aún sin medir) usar, por ejemplo:
   #btnModoCabina .lx-choice__img { object-fit: cover; object-position: center 35%; } */
.lx-choice__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    transform: none;
    transition: transform .9s var(--lx-ease-out);
    user-select: none;
    -webkit-user-drag: none;
}

/* Degradado solo en el tercio inferior (zona del texto) para no velar la fotografía */
.lx-choice__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(4, 12, 24, 0) 0%, rgba(4, 12, 24, 0) 54%,
            rgba(4, 12, 24, .62) 77%, rgba(4, 12, 24, .94) 100%);
    pointer-events: none;
}

.lx-choice__text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: grid;
    gap: .2rem;
    padding: 1.25rem 4.1rem 1.35rem 1.35rem;
}

.lx-choice__name {
    font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem);
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.15;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
}

.lx-choice__desc {
    font-size: .92rem;
    line-height: 1.35;
    color: rgba(214, 226, 236, .95);
}

/* Indicador de avance (flecha); en selección cambia a marca de verificación */
.lx-choice__indicator {
    position: absolute;
    right: 1.1rem;
    bottom: 1.2rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(117, 230, 237, .55);
    border-radius: 50%;
    background: rgba(4, 12, 24, .6);
    transition: transform .4s var(--lx-ease-out), background-color .3s ease, border-color .3s ease;
}

.lx-choice__indicator::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: .5rem;
    height: .5rem;
    border-top: 2px solid var(--lx-cyan-soft);
    border-right: 2px solid var(--lx-cyan-soft);
    transform: translate(-65%, -50%) rotate(45deg);
    transition: border-color .3s ease;
}

/* Borde fino con brillo interior; visible siempre (no depende del hover) */
.lx-choice__edge {
    position: absolute;
    inset: 0;
    z-index: 3;
    border: 1px solid rgba(117, 230, 237, .30);
    border-radius: inherit;
    box-shadow: inset 0 0 36px -14px rgba(0, 188, 212, .38);
    opacity: .85;
    pointer-events: none;
    transition: opacity .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.lx-choice__note {
    margin: 1.25rem 0 0;
    padding: .4rem .9rem;
    border: 1px dashed rgba(117, 230, 237, .28);
    border-radius: 999px;
    color: rgba(198, 199, 206, .9);
    font-size: .82rem;
    animation: lx-fade-up .6s var(--lx-ease-out) .85s backwards;
}

/* Hover: solo en dispositivos con puntero fino */
@media (hover: hover) and (pointer: fine) {
    .lx-choice__card[data-state="idle"]:hover { transform: translateY(-6px) scale(1.012); }
    .lx-choice__card[data-state="idle"]:hover::after { opacity: 1; }

    .lx-choice__card[data-state="idle"]:hover .lx-choice__edge {
        opacity: 1;
        border-color: rgba(117, 230, 237, .70);
    }

    .lx-choice__card[data-state="idle"]:hover .lx-choice__indicator {
        transform: translateX(4px);
        border-color: var(--lx-cyan-soft);
        background: rgba(0, 188, 212, .85);
    }

    .lx-choice__card[data-state="idle"]:hover .lx-choice__indicator::after {
        border-top-color: #04101C;
        border-right-color: #04101C;
    }
}

/* Foco por teclado: contorno blanco de alto contraste + realce */
.lx-choice__card:focus-visible {
    outline-color: var(--lx-white);
    transform: translateY(-4px) scale(1.01);
}

.lx-choice__card:focus-visible::after { opacity: 1; }

.lx-choice__card:focus-visible .lx-choice__edge {
    opacity: 1;
    border-color: var(--lx-cyan-soft);
}

.lx-choice__card[data-state="idle"]:active { transform: translateY(-2px) scale(.995); }

/* Seleccionada: más presencia, borde doble y marca de verificación (no solo color) */
.lx-choice__card[data-state="selected"] {
    z-index: 2;
    transform: translateY(-8px) scale(1.025);
}

.lx-choice__card[data-state="selected"]::after {
    opacity: 1;
    box-shadow: 0 30px 60px -20px rgba(0, 188, 212, .75);
}

.lx-choice__card[data-state="selected"] .lx-choice__edge {
    opacity: 1;
    border-color: var(--lx-cyan-soft);
    box-shadow: inset 0 0 0 1px var(--lx-cyan-soft), inset 0 0 44px -12px rgba(0, 188, 212, .55);
}

.lx-choice__card[data-state="selected"] .lx-choice__indicator {
    border-color: var(--lx-white);
    background: var(--lx-cyan-soft);
    transform: scale(1.08);
}

.lx-choice__card[data-state="selected"] .lx-choice__indicator::after {
    width: .4rem;
    height: .7rem;
    border-top: 0;
    border-right: 2px solid #04101C;
    border-bottom: 2px solid #04101C;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* Atenuada: la card no elegida pierde presencia sin desaparecer */
.lx-choice__card[data-state="dimmed"] {
    opacity: .42;
    transform: scale(.97);
    pointer-events: none;
}


/* 6D. ETAPA 2 — BOTÓN VOLVER Y ETIQUETA DE MODALIDAD ----------------------- */
.lx-back {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    margin: -.35rem 0 .35rem -.7rem;
    padding: .4rem .95rem .4rem .7rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: rgba(198, 199, 206, .92);
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: .03em;
    cursor: pointer;
    outline: 2px solid transparent;
    outline-offset: 2px;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.lx-back__icon {
    width: .55rem;
    height: .55rem;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .3s var(--lx-ease-out);
}

.lx-back:hover {
    border-color: rgba(117, 230, 237, .28);
    background: rgba(117, 230, 237, .10);
    color: var(--lx-white);
}

.lx-back:hover .lx-back__icon { transform: translateX(-2px) rotate(45deg); }

.lx-back:focus-visible {
    outline-color: var(--lx-cyan-soft);
    border-color: rgba(117, 230, 237, .5);
    color: var(--lx-white);
}

/* Etiqueta de la modalidad elegida (la rellenará el JS; vacía = oculta) */
.lx-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .75rem;
    padding: .25rem .75rem;
    border: 1px solid rgba(117, 230, 237, .30);
    border-radius: 999px;
    background: rgba(0, 188, 212, .12);
    color: var(--lx-cyan-soft);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.lx-card__eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--lx-cyan);
    box-shadow: 0 0 8px rgba(0, 188, 212, .8);
}

.lx-card__eyebrow:empty { display: none; }


/* 6E. PIE LEGAL (#lxLegal) — común a ambas etapas -------------------------- */
.lx-legal {
    position: relative;
    z-index: 1;
    align-self: end;
    padding-top: clamp(.5rem, 2vh, 1.25rem);
    text-align: center;
}

.lx-legal__link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: .4rem .9rem;
    border-radius: 8px;
    color: rgba(198, 199, 206, .92);
    font-size: .85rem;
    letter-spacing: .03em;
    text-decoration: underline;
    text-decoration-color: rgba(117, 230, 237, .4);
    text-underline-offset: .25em;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: color .25s ease, text-decoration-color .25s ease, background-color .25s ease;
}

.lx-legal__link:hover {
    color: var(--lx-cyan-soft);
    text-decoration-color: currentColor;
}

.lx-legal__link:focus-visible {
    outline-color: var(--lx-cyan-soft);
    background: rgba(117, 230, 237, .08);
    color: var(--lx-white);
}


/* 7. SELECTOR ADMINISTRATIVO / CABINA -------------------------------------- */
/* HEREDADO: el HTML de la Fase 3D.3A ya no contiene .lx-mode* (selector de radios
   sustituido por las cards). Estas reglas quedan sin uso y pueden eliminarse en
   una fase de limpieza, junto con sus menciones en los bloques responsive,
   movimiento reducido, contraste y colores forzados. */
.lx-mode {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.lx-mode__legend {
    padding: 0;
    margin-bottom: .5rem;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(198, 199, 206, .85);
}

.lx-mode__track {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border: 1px solid rgba(198, 199, 206, .16);
    border-radius: 14px;
    background: rgba(2, 8, 16, .6);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
}

/* Radios accesibles: ocultos visualmente pero operables con teclado */
.lx-mode__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.lx-mode__label {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    min-height: 2.75rem;
    padding: .5rem .75rem;
    border-radius: 10px;
    font-size: .92rem;
    font-weight: 500;
    color: rgba(198, 199, 206, .78);
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .3s ease;
}

.lx-mode__label:hover { color: var(--lx-white); }

.lx-mode__input:checked + .lx-mode__label {
    color: var(--lx-white);
    font-weight: 600;
}

.lx-mode__input:focus-visible + .lx-mode__label {
    outline: 2px solid var(--lx-cyan-soft);
    outline-offset: 1px;
}

.lx-mode__indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 2);
    border: 1px solid rgba(117, 230, 237, .5);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(8, 127, 199, .68), rgba(0, 188, 212, .38));
    box-shadow: 0 6px 18px -8px rgba(0, 188, 212, .55), inset 0 1px 0 rgba(255, 255, 255, .14);
    transition: transform .5s var(--lx-ease-out);
}

/* El indicador precede a los radios en el HTML: se usa :has() para moverlo */
.lx-mode__track:has(#tipoCabina:checked) .lx-mode__indicator {
    transform: translateX(100%);
}

/* Alternativa sin :has(): se resalta la etiqueta activa y se oculta el indicador */
@supports not selector(:has(*)) {
    .lx-mode__indicator { display: none; }
    .lx-mode__input:checked + .lx-mode__label {
        background: linear-gradient(135deg, rgba(8, 127, 199, .62), rgba(0, 188, 212, .34));
        box-shadow: inset 0 0 0 1px rgba(117, 230, 237, .38);
    }
}


/* 8. CAMPOS ---------------------------------------------------------------- */
.lx-field { min-width: 0; }

.lx-field__label {
    display: block;
    margin-bottom: .45rem;
    font-size: .82rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(198, 199, 206, .9);
}

.lx-field__control { position: relative; }

.lx-field__input {
    display: block;
    width: 100%;
    min-height: 3rem;
    margin: 0;
    padding: .8rem 1rem;
    border: 1px solid rgba(198, 199, 206, .22);
    border-radius: 12px;
    background: rgba(3, 10, 20, .66);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4);
    color: var(--lx-white);
    font: inherit;
    font-size: 1rem;              /* 16px: evita el zoom automático en iOS */
    caret-color: var(--lx-cyan-soft);
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: border-color .25s ease, background-color .25s ease;
}

.lx-field__input--with-action { padding-right: 3.5rem; }

.lx-field__input:hover:not(:disabled) {
    border-color: rgba(117, 230, 237, .42);
}

.lx-field__input:focus {
    border-color: var(--lx-cyan-soft);
    background: rgba(4, 14, 28, .85);
}

.lx-field__input:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Error: color + acento lateral + subrayado (no depende solo del color) */
.lx-field__input[aria-invalid="true"] {
    border-color: var(--lx-danger);
    box-shadow: inset 4px 0 0 var(--lx-danger), 0 2px 0 0 var(--lx-danger);
}

.lx-field__input:-webkit-autofill,
.lx-field__input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--lx-white);
    caret-color: var(--lx-white);
    -webkit-box-shadow: 0 0 0 1000px #0A1D30 inset;
    transition: background-color 9999s ease-out 0s;
}

/* Resplandor de enfoque: solo se anima la opacidad */
.lx-field__glow {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, .22), 0 0 22px rgba(0, 188, 212, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.lx-field__control:focus-within .lx-field__glow { opacity: 1; }

/* Botón mostrar/ocultar contraseña */
.lx-field__toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(198, 199, 206, .85);
    cursor: pointer;
    transform: translateY(-50%);
    -webkit-tap-highlight-color: transparent;
    transition: background-color .25s ease, color .25s ease;
}

.lx-field__toggle:hover {
    background: rgba(117, 230, 237, .10);
    color: var(--lx-cyan-soft);
}

.lx-field__toggle:focus-visible {
    outline: 2px solid var(--lx-cyan-soft);
    outline-offset: 0;
}

/* Icono de ojo dibujado con CSS (sin imágenes) */
.lx-field__toggle-icon {
    position: relative;
    display: block;
    width: 1.3rem;
    height: .85rem;
    border: 2px solid currentColor;
    border-radius: 100% / 70%;
}

.lx-field__toggle-icon::before {          /* pupila */
    content: "";
    position: absolute;
    inset: 0;
    width: .36rem;
    height: .36rem;
    margin: auto;
    border-radius: 50%;
    background: currentColor;
}

.lx-field__toggle-icon::after {           /* tachado: contraseña visible */
    content: "";
    position: absolute;
    left: -3px;
    top: 50%;
    width: calc(100% + 6px);
    height: 2px;
    margin-top: -1px;
    border-radius: 2px;
    background: currentColor;
    transform: rotate(-30deg) scaleX(0);
    transition: transform .3s var(--lx-ease-out);
}

.lx-field__toggle[aria-pressed="true"] .lx-field__toggle-icon::after {
    transform: rotate(-30deg) scaleX(1);
}


/* 9. MENSAJES -------------------------------------------------------------- */
.lx-messages { min-width: 0; }

.lx-message {
    margin: 0;
    padding: .65rem .85rem;
    border-left: 3px solid var(--lx-cyan);
    border-radius: 4px 10px 10px 4px;
    background: rgba(8, 127, 199, .12);
    color: rgba(235, 242, 248, .95);
    font-size: .88rem;
    line-height: 1.45;
}

.lx-message--error {
    border-left-color: var(--lx-danger);
    background: rgba(255, 122, 138, .12);
    color: #FFE1E5;
    font-weight: 500;
}

.lx-message[hidden] { display: none; }


/* 10. BOTÓN INGRESAR ------------------------------------------------------- */
.lx-submit {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 3.25rem;
    margin: 0;
    padding: .8rem 1.5rem;
    border: 1px solid rgba(117, 230, 237, .5);
    border-radius: 12px;
    overflow: hidden;
    background:
        radial-gradient(9rem circle at var(--lx-mx, 50%) var(--lx-my, 0%), rgba(255, 255, 255, .20), transparent 65%),
        linear-gradient(135deg, #055A99 0%, #0775A6 55%, #0888AC 100%);
    box-shadow:
        0 12px 28px -12px rgba(0, 188, 212, .6),
        inset 0 1px 0 rgba(255, 255, 255, .28);
    color: var(--lx-white);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    text-transform: uppercase;
    cursor: pointer;
    outline: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
    transition: transform .25s var(--lx-ease-out), box-shadow .3s ease, border-color .3s ease;
}

.lx-submit__label { position: relative; z-index: 1; }

.lx-submit:focus-visible {
    outline: 2px solid var(--lx-white);
    outline-offset: 3px;
}

/* Barrido luminoso */
.lx-submit__sheen {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .34), transparent);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-140%) skewX(-18deg);
    transition: opacity .3s ease, transform 0s linear .3s;
}

.lx-submit:not([aria-disabled="true"]):not([data-state="loading"]):hover {
    transform: translateY(-1px);
    border-color: rgba(190, 245, 250, .8);
    box-shadow:
        0 16px 34px -12px rgba(0, 188, 212, .75),
        inset 0 1px 0 rgba(255, 255, 255, .35);
}

.lx-submit:not([aria-disabled="true"]):not([data-state="loading"]):hover .lx-submit__sheen,
.lx-submit:not([aria-disabled="true"]):focus-visible .lx-submit__sheen {
    opacity: 1;
    transform: translateX(340%) skewX(-18deg);
    transition: opacity .2s ease, transform .9s var(--lx-ease-io);
}

.lx-submit:not([aria-disabled="true"]):active {
    transform: translateY(0) scale(.99);
}

/* Inactivo (estado actual de la fase): no debe parecer operativo */
.lx-submit[aria-disabled="true"] {
    border-color: rgba(198, 199, 206, .22);
    background: linear-gradient(135deg, rgba(198, 199, 206, .16), rgba(198, 199, 206, .08));
    box-shadow: none;
    color: rgba(198, 199, 206, .8);
    text-shadow: none;
    cursor: not-allowed;
}

/* Indicador de carga */
.lx-submit__loader {
    position: absolute;
    top: 50%;
    left: 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: -.55rem;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: var(--lx-white);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: scale(.6);
    transition: opacity .25s ease, transform .25s var(--lx-ease-out);
}


/* 11. ESTADOS (data-state) ------------------------------------------------- */
/* Cargando */
.lx-submit[data-state="loading"] {
    cursor: progress;
    pointer-events: none;
}

.lx-submit[data-state="loading"] .lx-submit__loader {
    opacity: 1;
    transform: scale(1);
    animation: lx-spin .8s linear infinite;
}

.lx-submit[data-state="loading"] .lx-submit__sheen {
    opacity: 1;
    animation: lx-sheen-loop 1.6s var(--lx-ease-io) infinite;
}

.lx-card[data-state="loading"] .lx-card__edge::before { animation-duration: 3s; }

/* Error: borde coral y un único temblor breve */
.lx-card[data-state="error"] { --lx-edge: var(--lx-danger); }

.lx-card[data-state="error"] .lx-card__edge { background: rgba(255, 122, 138, .35); }

.lx-card[data-state="error"] .lx-card__body {
    animation: lx-shake .45s var(--lx-ease-out);
}

.lx-submit[data-state="error"] {
    border-color: rgba(255, 122, 138, .7);
}

/* Completado visual */
.lx-card[data-state="success"] { --lx-edge: var(--lx-success); }

.lx-card[data-state="success"] .lx-card__edge { background: rgba(124, 242, 200, .35); }

.lx-submit[data-state="success"] {
    background: linear-gradient(135deg, #07705F, #0A8F74);
    border-color: rgba(124, 242, 200, .7);
}


/* 12. ANIMACIONES ---------------------------------------------------------- */
@keyframes lx-logo-in {
    from { opacity: 0; transform: scale(.97); filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .45)) brightness(.55); }
    to   { opacity: 1; transform: scale(1);   filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .45)) brightness(1); }
}

@keyframes lx-card-in {
    from { opacity: 0; transform: translate3d(0, 28px, 0) rotateX(5deg); }
    to   { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0); }
}

@keyframes lx-fade-up {
    from { opacity: 0; transform: translate3d(0, 12px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes lx-rise {
    from { opacity: 0; transform: translate3d(0, 22px, 0) scale(.98); }
    to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes lx-breathe {
    from { opacity: .72; transform: scale(.97); }
    to   { opacity: 1;   transform: scale(1.05); }
}

@keyframes lx-spin {
    to { transform: rotate(360deg); }
}

@keyframes lx-edge-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes lx-sheen-loop {
    from { transform: translateX(-140%) skewX(-18deg); }
    to   { transform: translateX(340%) skewX(-18deg); }
}

@keyframes lx-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-7px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(2px); }
}


/* 13. RESPONSIVE ----------------------------------------------------------- */
/* Móvil: composición simplificada y sin movimiento decorativo costoso */
@media (max-width: 639px) {
    .lx-halo__ring { animation: none; }
    .lx-halo__ring--inner { display: none; }
    .lx-card__edge::before { animation: none; }
    .lx-layer--grid { background-size: 44px 44px; }

    /* Cards apiladas y más panorámicas para que quepan con el logotipo */
    .lx-choice__grid { grid-template-columns: 1fr; }
    .lx-choice__card { aspect-ratio: 3 / 2; border-radius: 18px; }
    .lx-choice__text { padding: 1rem 3.8rem 1.1rem 1.15rem; }
    .lx-choice__indicator { right: .9rem; bottom: 1rem; }
}

@media (max-width: 359px) {
    .lx-card__body { padding: 1.25rem 1rem; }
    .lx-mode__label { font-size: .85rem; padding-inline: .4rem; }
}

/* Tablet */
@media (min-width: 640px) {
    .lx-body { --lx-logo-w: clamp(260px, 44vw, 380px); }
    .lx-layer--lines { display: block; }
    .lx-flow { max-width: 40rem; }
}

/* Escritorio: identidad a la izquierda; cards (o formulario) a la derecha.
   El logotipo se reduce respecto a la Fase 3D.1 para dar espacio horizontal a las
   cards y mantener el halo dentro de su columna (sin solapar las cards). */
@media (min-width: 960px) and (min-height: 600px) {
    .lx-body {
        --lx-logo-w: clamp(240px, 21vw, 340px);
        --lx-halo: min(calc(var(--lx-logo-w) * 1.65), 38vw);
        --lx-fx: 25%;
        --lx-fy: 46%;
    }

    /* Zona más limpia y oscura detrás de las cards */
    .lx-layer--vignette {
        background:
            radial-gradient(ellipse 34% 56% at 70% 50%, rgba(2, 8, 16, .5), transparent 72%),
            radial-gradient(ellipse at 50% 45%, transparent 42%, rgba(2, 6, 12, .82) 100%);
    }

    .lx-main {
        width: min(100%, 84rem);
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
        gap: clamp(2rem, 5vw, 5rem);
    }

    .lx-flow { max-width: 46rem; }
}

/* Pantallas muy grandes */
@media (min-width: 1600px) {
    .lx-body { --lx-logo-w: clamp(300px, 19vw, 360px); }
}

/* Horizontal con altura reducida (móviles apaisados, ventanas bajas) */
@media (orientation: landscape) and (max-height: 599px) and (min-width: 640px) {
    .lx-body {
        --lx-logo-w: clamp(180px, 28vw, 300px);
        --lx-halo: min(calc(var(--lx-logo-w) * 1.9), 44vw);
        --lx-fx: 27%;
        --lx-fy: 38%;
    }

    .lx-stage { place-items: start center; }

    .lx-main {
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
        gap: 1.5rem;
    }

    .lx-flow { max-width: 44rem; }
    .lx-choice__card { aspect-ratio: 4 / 3; }
    .lx-choice__lead { margin-bottom: 1rem; }

    /* Cards pequeñas: texto e indicador más compactos para no tapar la foto */
    .lx-choice__text { padding: .7rem 3.2rem .8rem .9rem; }
    .lx-choice__name { font-size: 1.1rem; }
    .lx-choice__desc { font-size: .82rem; }
    .lx-choice__indicator { width: 2.1rem; height: 2.1rem; right: .7rem; bottom: .75rem; }

    .lx-card__body { padding: 1.25rem 1.5rem; }
    .lx-title { margin-bottom: 1rem; }
    .lx-form { gap: .85rem; }
}


/* 14. ACCESIBILIDAD -------------------------------------------------------- */
/* Movimiento reducido: sin animaciones; todo visible de inmediato */
@media (prefers-reduced-motion: reduce) {
    .lx-stage *,
    .lx-stage *::before,
    .lx-stage *::after {
        animation: none;
        scroll-behavior: auto;
        transition-duration: .01ms;
        transition-delay: 0s;
    }

    .lx-submit:not([aria-disabled="true"]):hover { transform: none; }
    .lx-mode__indicator { transition: none; }

    /* Cards: sin desplazamientos por hover/foco; los estados de selección se aplican al instante */
    .lx-choice__card[data-state="idle"]:hover,
    .lx-choice__card:focus-visible,
    .lx-choice__card[data-state="idle"]:active { transform: none; }
    .lx-choice__card[data-state="selected"] { transform: none; }
    .lx-choice__card[data-state="dimmed"] { transform: none; }
    .lx-back:hover .lx-back__icon { transform: rotate(45deg); }

    /* El estado de carga conserva una señal estática, sin giro */
    .lx-submit[data-state="loading"] .lx-submit__loader {
        border-color: var(--lx-white);
        border-radius: 3px;
    }
}

/* Mayor contraste solicitado por el sistema */
@media (prefers-contrast: more) {
    .lx-card { border-color: rgba(117, 230, 237, .6); }
    .lx-field__input { border-color: rgba(255, 255, 255, .7); }
    .lx-mode__track { border-color: rgba(255, 255, 255, .5); }
    .lx-message { background: rgba(0, 0, 0, .5); }
    .lx-choice__edge { opacity: 1; border-color: rgba(255, 255, 255, .8); }
    .lx-choice__text { background: rgba(4, 12, 24, .88); }
    .lx-back { border-color: rgba(255, 255, 255, .5); }
    .lx-legal__link { color: var(--lx-white); }
    .lx-layer--grid,
    .lx-layer--lines { opacity: .4; }
}

/* Modo de colores forzados (Windows alto contraste) */
@media (forced-colors: active) {
    .lx-card,
    .lx-field__input,
    .lx-mode__track,
    .lx-submit { border: 1px solid CanvasText; }

    .lx-mode__indicator { border: 2px solid Highlight; background: transparent; }
    .lx-submit[aria-disabled="true"] { color: GrayText; border-color: GrayText; }
    .lx-field__input[aria-invalid="true"] { border-color: Mark; }

    /* Cards: el texto necesita un fondo sólido porque los degradados se anulan */
    .lx-choice__card { border: 1px solid CanvasText; }
    .lx-choice__edge { border-color: CanvasText; box-shadow: none; }
    .lx-choice__text { background: Canvas; color: CanvasText; }
    .lx-choice__desc { color: CanvasText; }
    .lx-choice__indicator { border-color: CanvasText; background: Canvas; }
    .lx-choice__indicator::after { border-color: CanvasText; }
    .lx-choice__card:focus-visible { outline: 3px solid Highlight; }
    .lx-choice__card[data-state="selected"] .lx-choice__edge { border: 3px solid Highlight; }
    .lx-back { border-color: CanvasText; }
    .lx-back:focus-visible,
    .lx-legal__link:focus-visible { outline: 2px solid Highlight; }
}

/* Aviso sin JavaScript */
.lx-noscript {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: .75rem 1rem;
    background: rgba(8, 26, 43, .95);
    color: var(--lx-silver, #C6C7CE);
    font-family: var(--lx-font, system-ui, sans-serif);
    font-size: .9rem;
    text-align: center;
}
