/* ============================================================================
   Login — pantalla de acceso (layout _LoginLayout).
   Diseño "I-Xport IA": panel izquierdo de marca (oscuro, glows + tarjeta de
   estatus AXI) y panel derecho de formulario (claro).
   Este archivo SOLO se carga en el login; los tokens y overrides de controles
   de aquí no afectan al resto de la app (que sigue el estándar de shared.css).
   ============================================================================ */

/* ═══════════════════════════════════════════════
   DESIGN TOKENS · Expediente Electrónico (I-Xport IA)
   ═══════════════════════════════════════════════ */
:root {
    --lg-font-main: "Inter", sans-serif;
    --lg-font-mono: "Geist Mono", "IBM Plex Mono", monospace;

    --lg-bg-1: #091220;
    --lg-bg-2: #0F1C36;
    --lg-bg-3: #132840;
    --lg-gradient-brand: linear-gradient(155deg, #17395E 0%, #0F2440 48%, #070F1E 100%);

    --lg-bg-light: #EFF8FB;
    --lg-bg-white: #FFFFFF;

    --lg-accent-1: #0BABE6;
    --lg-accent-2: #0991C3;
    --lg-accent-light: #22D3EE;
    --lg-accent-green: #10B981;
    --lg-grad-accent: linear-gradient(135deg, #0BABE6 0%, #0991C3 100%);
    --lg-grad-text: linear-gradient(90deg, #22D3EE, #10B981);

    --lg-d-title: #FFFFFF;
    --lg-d-body: rgba(200, 220, 255, .62);
    --lg-d-muted: rgba(200, 220, 255, .34);

    --lg-l-title: #0A1E38;
    --lg-l-label: #4A6F8A;
    --lg-l-sub: #6B8EAA;
    --lg-l-muted: #A0BAC8;

    --lg-field-border: rgba(16, 156, 191, .22);
    --lg-border-focus: #0BABE6;
    --lg-shadow-focus: rgba(16, 156, 191, .14);
    --lg-shadow-btn: rgba(16, 156, 191, .32);
    --lg-shadow-btn-hover: rgba(16, 156, 191, .44);

    --lg-radius-sm: 7px;
    --lg-radius-md: 10px;
    --lg-radius-lg: 14px;
}

/* ── Base: neutraliza el body navy centrado de shared.css ─────────────────── */
html, body.login-page { height: 100%; }

body.login-page {
    font-family: var(--lg-font-main);
    background: var(--lg-bg-light);
    color: var(--lg-l-title);
    display: block;
    padding: 0;
    overflow: auto;
}

.auth { display: flex; min-height: 100vh; }

/* Réplica scoped del reset `*{box-sizing:border-box}` del diseño original:
   sin él, los paddings de .brand/.form-side ensanchan los paneles (content-box). */
.auth, .auth *, .auth *::before, .auth *::after { box-sizing: border-box; }

/* ═══════════════════════════════════════════════
   PANEL IZQUIERDO · MARCA (oscuro)
   ═══════════════════════════════════════════════ */
.brand {
    flex: 0 0 45%;
    position: relative;
    overflow: hidden;
    background: var(--lg-gradient-brand);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 56px;
}

.brand-glow { position: absolute; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
.brand-glow.a { top: -140px; left: -120px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(11, 171, 230, .7), transparent 68%); opacity: .5; }
.brand-glow.b { bottom: -200px; right: -140px; width: 560px; height: 560px; background: radial-gradient(circle, rgba(16, 185, 129, .6), transparent 68%); opacity: .42; }
.brand-arc { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 1; }
.brand-foot { position: absolute; left: 56px; bottom: 40px; z-index: 1; font-size: 11.5px; color: var(--lg-d-muted); }

.brand-hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 440px;
    text-align: left;
}

.brand-logo { height: 38px; width: auto; display: block; margin-bottom: 26px; }

.brand-hero h1 {
    font-size: clamp(25px, 2.1vw, 33px);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.015em;
    color: var(--lg-d-title);
    max-width: 440px;
    margin: 0 0 30px;
    text-align: left;
    /* Anula el texto-en-gradiente del h1 global de shared.css */
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
}

.brand-hero h1 em {
    font-style: normal;
    background: var(--lg-grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Tarjeta firma: estatus de expediente ── */
.status-card {
    width: 100%;
    max-width: 355px;
    text-align: left;
    background: rgba(15, 28, 54, .60);
    border: 1px solid rgba(16, 156, 191, .20);
    border-radius: var(--lg-radius-lg);
    padding: 20px 22px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 22px 50px -18px rgba(3, 10, 22, .7);
    box-sizing: border-box;
}

.sc-ring { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1px solid rgba(200, 220, 255, .08); }
.sc-axi {
    margin-left: auto; width: 54px; height: auto; display: block; flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(34, 211, 238, .30));
}
.ring-wrap { position: relative; width: 66px; height: 66px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(200, 220, 255, .10); stroke-width: 6; }
.ring-fill {
    fill: none; stroke: url(#ringGrad); stroke-width: 6; stroke-linecap: round;
    stroke-dasharray: 176; stroke-dashoffset: 176;
    animation: ring 1.3s .3s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes ring { to { stroke-dashoffset: 0; } }
.ring-val {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--lg-font-mono); font-size: 15px; font-weight: 600; color: var(--lg-d-title);
}
.sc-ring .meta .big { font-size: 14px; font-weight: 600; color: var(--lg-d-title); margin-bottom: 3px; }
.sc-ring .meta .small { font-size: 12px; color: var(--lg-d-body); display: flex; align-items: center; gap: 6px; }
.sc-ring .meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lg-accent-green); }

.sc-src { display: flex; flex-direction: column; gap: 11px; }
.sc-src-title {
    font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    color: var(--lg-d-muted); margin-bottom: 12px;
}
.src { display: flex; align-items: center; gap: 11px; opacity: 0; transform: translateY(4px); animation: rise .5s forwards; }
.src:nth-child(1) { animation-delay: .75s; }
.src:nth-child(2) { animation-delay: .9s; }
.src:nth-child(3) { animation-delay: 1.05s; }
.src:nth-child(4) { animation-delay: 1.2s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.src .chk {
    width: 19px; height: 19px; flex-shrink: 0; border-radius: 50%;
    background: rgba(16, 185, 129, .14); border: 1px solid rgba(16, 185, 129, .4);
    display: flex; align-items: center; justify-content: center; color: var(--lg-accent-green);
}
.src .name { font-size: 13px; font-weight: 600; color: var(--lg-d-title); text-decoration: none; transition: color .15s; }
a.name:hover { color: var(--lg-accent-light); text-decoration: underline; }

/* ═══════════════════════════════════════════════
   PANEL DERECHO · FORMULARIO (claro)
   ═══════════════════════════════════════════════ */
.form-side {
    flex: 1;
    background: var(--lg-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.form-inner { width: 100%; max-width: 360px; }

.form-head { margin-bottom: 32px; }
.brand-mark {
    width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(155deg, rgba(11, 171, 230, .14), rgba(9, 145, 195, .05));
    border: 1px solid rgba(16, 156, 191, .28);
    box-shadow: 0 8px 20px -8px rgba(11, 171, 230, .45);
    box-sizing: border-box;
}
.brand-mark svg { width: 26px; height: 26px; }
.form-head .platform {
    font-size: 27px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1;
    color: var(--lg-l-title); margin: 0 0 8px;
    text-align: left;
    /* Anula el texto-en-gradiente del h1 global de shared.css */
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: currentColor;
}
.form-head .signin { font-size: 13.5px; color: var(--lg-l-sub); margin: 0; }

.field { margin-bottom: 16px; }
.field label {
    display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    color: var(--lg-l-label); margin-bottom: 7px;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 13px; display: flex; color: var(--lg-l-muted); pointer-events: none; transition: color .15s; }

/* Override explícito del estándar global de 40px de shared.css: este campo
   define su alto por padding, con borde/tipografía propios del diseño. */
.form-side .input-wrap input {
    width: 100%;
    height: auto;
    padding: 12px 14px 12px 40px;
    border-radius: var(--lg-radius-sm);
    border: 1.5px solid var(--lg-field-border);
    background: var(--lg-bg-white);
    color: var(--lg-l-title);
    font-family: var(--lg-font-main);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}

.form-side .input-wrap input::placeholder { color: var(--lg-l-muted); }
.form-side .input-wrap input:focus {
    border-color: var(--lg-border-focus);
    box-shadow: 0 0 0 3px var(--lg-shadow-focus);
}
.input-wrap:focus-within .input-icon { color: var(--lg-accent-1); }

.pw-toggle {
    position: absolute; right: 11px; background: none; border: none; cursor: pointer;
    color: var(--lg-l-sub); padding: 4px; display: flex; border-radius: 6px; transition: color .15s;
}
.pw-toggle:hover { color: var(--lg-accent-1); }
.pw-toggle:focus-visible { outline: 2px solid var(--lg-accent-1); outline-offset: 1px; }
.form-side .input-wrap.has-toggle input { padding-right: 44px; }

.row-opts { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 22px; }
.remember {
    display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 400;
    text-transform: none; letter-spacing: 0;
    color: var(--lg-l-label); cursor: pointer; user-select: none; margin-bottom: 0;
}
.remember input { width: 15px; height: 15px; accent-color: var(--lg-accent-1); cursor: pointer; margin: 0; }
.forgot { font-size: 12.5px; font-weight: 500; color: var(--lg-accent-1); text-decoration: none; }
.forgot:hover { color: var(--lg-accent-2); text-decoration: underline; }

.btn-login {
    width: 100%; padding: 13px; border: none; border-radius: var(--lg-radius-md);
    background: var(--lg-grad-accent); color: #fff; font-family: var(--lg-font-main);
    font-size: 15px; font-weight: 600; letter-spacing: .02em; cursor: pointer;
    box-shadow: 0 4px 16px var(--lg-shadow-btn);
    transition: transform .18s, box-shadow .18s, opacity .18s;
    box-sizing: border-box;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 22px var(--lg-shadow-btn-hover); }
.btn-login:active { transform: translateY(0); }
.btn-login:focus-visible { outline: 2px solid var(--lg-accent-1); outline-offset: 2px; }
.btn-login:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.secure {
    display: flex; align-items: center; justify-content: center; gap: 7px; margin: 26px 0 0;
    font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--lg-l-muted);
}
.secure .dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--lg-accent-green);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); animation: pulse 2.4s ease-in-out infinite;
}
.secure strong { color: var(--lg-accent-1); font-weight: 600; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .4); }
    50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

.by-ixport {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 34px; padding-top: 20px; border-top: 1px solid rgba(16, 156, 191, .12);
}
.by-ixport span { font-size: 13px; color: var(--lg-l-muted); }
.by-ixport img { height: 22px; width: auto; opacity: .9; display: block; }

/* ── Funcional: estado de carga HTMX del botón ─────────────────────────────── */
.btn-login .btn-loading { display: none; align-items: center; justify-content: center; gap: 8px; }
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.form-loading { pointer-events: none; opacity: .7; }

/* ── Funcional: mensajes de error de validación/autenticación ──────────────── */
.error-message {
    display: block; margin-top: 7px;
    color: #B4232A; font-size: 12px; font-weight: 500;
}
div.error-message {
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .25);
    border-radius: var(--lg-radius-sm);
    padding: 9px 12px; margin: 0 0 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DOBLE FACTOR POR CORREO — segundo paso del acceso.
   Mismo lenguaje que el panel del formulario: plano, acento cian I-Xport,
   tipografía Inter con el código en Geist Mono.
   ═══════════════════════════════════════════════════════════════════════════ */
.mfa-panel { animation: mfaIn .28s ease both; }
@keyframes mfaIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* Si el segundo factor está en pantalla, el subtítulo de credenciales ya no aplica. */
.form-inner:has(.mfa-panel) .form-head .signin { display: none; }

.mfa-head { margin-bottom: 22px; }
.mfa-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-bottom: 15px;
    border-radius: var(--lg-radius-md);
    background: rgba(11, 171, 230, .10);
    border: 1px solid rgba(11, 171, 230, .20);
    color: var(--lg-accent-1);
}
.mfa-head h2 {
    margin: 0 0 7px; font-size: 19px; font-weight: 700;
    letter-spacing: -.01em; color: var(--lg-l-title);
}
.mfa-head p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--lg-l-sub); }

/* Chip con el correo destino enmascarado */
.mfa-target {
    display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
    padding: 6px 11px; border-radius: 999px;
    background: var(--lg-bg-light); border: 1px solid var(--lg-field-border);
    font-family: var(--lg-font-mono); font-size: 12px; font-weight: 500;
    color: var(--lg-l-title); max-width: 100%;
}
.mfa-target svg { color: var(--lg-accent-1); flex: 0 0 auto; }
.mfa-target > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Campo del código: alto, centrado y monoespaciado */
.mfa-field { margin-bottom: 20px; }
.form-side .input-wrap input.mfa-code-input {
    height: 54px; text-align: center;
    letter-spacing: .42em; text-indent: .42em;
    font-family: var(--lg-font-mono); font-size: 22px; font-weight: 600;
    color: var(--lg-l-title); padding-left: 14px; padding-right: 14px;
}
.form-side .input-wrap input.mfa-code-input::placeholder {
    letter-spacing: .28em; font-size: 18px; color: var(--lg-l-muted);
}
.mfa-hint {
    display: block; margin-top: 7px;
    font-size: 11.5px; font-weight: 500; color: var(--lg-l-muted);
}

.mfa-submit { margin-top: 2px; }

/* Aviso informativo (código reenviado) */
.info-message {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 16px; padding: 9px 12px;
    color: #0F7A55; font-size: 12px; font-weight: 500; line-height: 1.4;
    background: rgba(16, 185, 129, .09);
    border: 1px solid rgba(16, 185, 129, .28);
    border-radius: var(--lg-radius-sm);
}
.info-message svg { flex: 0 0 auto; }

/* Pie: reenviar / usar otra cuenta */
.mfa-foot {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px;
    border-top: 1px solid rgba(16, 156, 191, .12);
    font-size: 12.5px; color: var(--lg-l-sub);
}
.mfa-foot-q { color: var(--lg-l-muted); }
.mfa-link {
    background: none; border: none; padding: 0; margin: 0;
    font-family: var(--lg-font-main); font-size: 12.5px; font-weight: 600;
    color: var(--lg-accent-1); text-decoration: none; cursor: pointer;
    transition: color .15s;
}
.mfa-link:hover { color: var(--lg-accent-2); text-decoration: underline; }
.mfa-link:focus-visible { outline: 2px solid var(--lg-accent-1); outline-offset: 2px; border-radius: 3px; }
.mfa-link:disabled { opacity: .55; cursor: not-allowed; text-decoration: none; }
.mfa-sep {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--lg-l-muted); opacity: .6;
}

/* Indicador de carga de los botones del segundo factor (hx-indicator = el propio botón) */
.btn-login.htmx-request .btn-text { display: none; }
.btn-login.htmx-request .btn-loading { display: flex; }
.mfa-link.htmx-request { opacity: .55; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   RECONOCIMIENTO FACIAL — visor de escaneo automático.
   Se muestra el video en vivo (el usuario necesita encuadrarse) con una máscara
   encima: viñeta, esquinas, guía de rostro y línea de barrido. La imagen solo
   vive en el <video>: no se guarda ni se envía más que el frame del intento.
   ═══════════════════════════════════════════════════════════════════════════ */
.face-panel { animation: mfaIn .28s ease both; text-align: center; }
.face-panel .mfa-head { text-align: left; }

.face-stage {
    position: relative;
    width: 232px; height: 232px; max-width: 70vw;
    margin: 0 auto 16px;
    border-radius: var(--lg-radius-lg);
    overflow: hidden;
    background: radial-gradient(120% 120% at 50% 35%, #17395E 0%, #0F2440 55%, #070F1E 100%);
    box-shadow: inset 0 0 0 1px rgba(11, 171, 230, .22), 0 10px 26px rgba(7, 15, 30, .28);
}
/* El video alimenta la captura pero NO se muestra en el login: el escaneo es automático y el
   rostro del usuario no debe quedar expuesto en pantalla (equipo compartido / privacidad).
   En el enrolamiento sí se muestra, porque ahí el usuario necesita encuadrarse antes de capturar. */
.face-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0;
    transform: scaleX(-1); /* espejo, como cámara frontal */
    pointer-events: none;
}
[data-face-enroll] .face-video { opacity: 1; }

.face-mask { position: absolute; inset: 0; }
/* Viñeta: solo hace falta cuando hay imagen debajo (enrolamiento), para que esquinas,
   guía y línea de barrido se lean sobre el video. */
[data-face-enroll] .face-mask::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 45%, transparent 42%, rgba(7, 15, 30, .55) 100%);
    pointer-events: none;
}
.face-corner {
    position: absolute; width: 32px; height: 32px;
    border: 3px solid var(--lg-accent-light);
    transition: border-color .3s ease;
}
.face-corner.tl { top: 20px; left: 20px; border-right: none; border-bottom: none; border-top-left-radius: 12px; }
.face-corner.tr { top: 20px; right: 20px; border-left: none; border-bottom: none; border-top-right-radius: 12px; }
.face-corner.bl { bottom: 20px; left: 20px; border-right: none; border-top: none; border-bottom-left-radius: 12px; }
.face-corner.br { bottom: 20px; right: 20px; border-left: none; border-top: none; border-bottom-right-radius: 12px; }
.face-glyph {
    position: absolute; top: 50%; left: 50%;
    width: 108px; height: 108px; transform: translate(-50%, -50%);
    color: rgba(34, 211, 238, .9);
    transition: color .3s ease, opacity .3s ease;
}
/* Sobre el video (enrolamiento) la guía se atenúa para no tapar el rostro. */
[data-face-enroll] .face-glyph {
    color: rgba(34, 211, 238, .55);
    filter: drop-shadow(0 1px 3px rgba(7, 15, 30, .6));
}
.face-check {
    position: absolute; top: 50%; left: 50%;
    width: 92px; height: 92px; transform: translate(-50%, -50%) scale(.6);
    color: var(--lg-accent-green); opacity: 0;
    filter: drop-shadow(0 2px 6px rgba(7, 15, 30, .7));
    transition: opacity .3s ease, transform .3s ease;
}
/* Al identificar, el video visible (enrolamiento) se atenúa para que destaque el check. */
[data-face-enroll] .face-stage.is-ok .face-video { opacity: .35; }
.face-scanline {
    position: absolute; left: 26px; right: 26px; top: 20px;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--lg-accent-light), transparent);
    box-shadow: 0 0 14px 2px rgba(34, 211, 238, .65);
    opacity: 0;
}

/* Escaneando */
.face-stage.is-scanning .face-glyph { animation: facePulse 1.6s ease-in-out infinite; }
.face-stage.is-scanning .face-scanline { opacity: 1; animation: faceSweep 2.2s ease-in-out infinite; }
/* Identificado */
.face-stage.is-ok .face-corner { border-color: var(--lg-accent-green); }
.face-stage.is-ok .face-glyph { opacity: 0; }
.face-stage.is-ok .face-scanline { opacity: 0; animation: none; }
.face-stage.is-ok .face-check { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* Fallo */
.face-stage.is-fail .face-corner { border-color: #EF4444; }
.face-stage.is-fail .face-glyph { color: rgba(239, 68, 68, .9); animation: none; }
.face-stage.is-fail .face-scanline { opacity: 0; animation: none; }

@keyframes faceSweep {
    0%   { top: 22px; }
    50%  { top: calc(100% - 22px); }
    100% { top: 22px; }
}
@keyframes facePulse {
    0%, 100% { opacity: .45; }
    50%      { opacity: .85; }
}

/* Detalle del rechazo devuelto por el servicio facial (qué corregir en la foto) */
.face-detail {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 10px 0 0; padding: 9px 12px; text-align: left;
    background: rgba(239, 68, 68, .07);
    border: 1px solid rgba(239, 68, 68, .28);
    border-radius: var(--lg-radius-sm);
    font-size: 12px; font-weight: 500; line-height: 1.45; color: #B4232A;
}
.face-detail[hidden] { display: none; }
.face-detail svg { flex: 0 0 auto; margin-top: 1px; }

/* ── Enrolamiento: captura manual con vista previa (patrón del proyecto base) ─── */
.face-open-btn { margin-bottom: 16px; }
.face-open-btn .btn-text { display: inline-flex; align-items: center; gap: 8px; }

/* Loader mientras enciende la cámara: cubre el recuadro */
.face-loader {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: rgba(7, 15, 30, .78);
    font-size: 12.5px; font-weight: 500; color: var(--lg-d-body);
}
.face-loader[hidden] { display: none; }
.face-loader .spinner { color: var(--lg-accent-light); }

/* Foto congelada: ocupa el mismo recuadro que el video */
.face-preview {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* mismo espejo que la cámara, para que se vea igual que al capturar */
}
.face-preview[hidden] { display: none; }
.face-video[hidden] { display: none; }

/* En vista previa la guía y el barrido estorban: solo se deja el marco */
.face-stage.is-preview .face-glyph,
.face-stage.is-preview .face-scanline { display: none; }
.face-stage.is-preview .face-mask::before { background: none; }

/* Acciones (Capturar/Cancelar · Repetir/Eliminar) */
.face-actions { margin-top: 4px; }
.face-actions[hidden] { display: none; }
.face-actions-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.face-actions-row[hidden] { display: none; }

.face-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 14px;
    border-radius: var(--lg-radius-sm);
    border: 1px solid var(--lg-field-border);
    background: var(--lg-bg-white); color: var(--lg-l-title);
    font-family: var(--lg-font-main); font-size: 13px; font-weight: 600;
    cursor: pointer; box-sizing: border-box;
    transition: background-color .15s, border-color .15s, color .15s;
}
.face-btn:hover { background: var(--lg-bg-light); border-color: var(--lg-accent-1); }
.face-btn:focus-visible { outline: 2px solid var(--lg-accent-1); outline-offset: 2px; }
.face-btn:disabled { opacity: .6; cursor: not-allowed; }

.face-btn--primary {
    background: var(--lg-grad-accent); border-color: transparent; color: #fff;
}
/* El hover repone el degradado y el color: si no, gana el background claro de .face-btn:hover */
.face-btn--primary:hover {
    background: var(--lg-grad-accent);
    border-color: transparent;
    color: #fff;
    filter: brightness(1.06);
}
.face-btn--primary:active { filter: brightness(.97); }

.face-btn--danger { color: #B4232A; border-color: rgba(239, 68, 68, .35); }
.face-btn--danger:hover { background: rgba(239, 68, 68, .08); border-color: #B4232A; }

/* Botón de registro (aparece con la foto lista) */
.face-enroll-btn { margin-top: 14px; }
.face-enroll-btn[hidden] { display: none; }
.btn-login.is-loading .btn-text { display: none; }
.btn-login.is-loading .btn-loading { display: flex; }

.face-status {
    margin: 0; min-height: 1.3em;
    font-size: 12.5px; font-weight: 500; color: var(--lg-l-sub);
}
.face-stage.is-ok ~ .face-status { color: #0F7A55; }
.face-stage.is-fail ~ .face-status { color: #B4232A; }
.face-retry { margin-top: 14px; }

/* ── Responsive / accesibilidad ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .brand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-glow, .ring-fill, .src, .secure .dot, .btn-login, .mfa-panel, .face-panel,
    .face-glyph, .face-scanline { animation: none !important; transition: none !important; }
    .face-scanline { opacity: 0 !important; }
    .ring-fill { stroke-dashoffset: 0; }
    .src { opacity: 1; transform: none; }
    .spinner { animation: spin 1.6s linear infinite; }
}
