/* =============================================================================
   login-expediente.css — el acceso de DS Expediente Electrónico, sobre el login
   del caparazón.

   QUÉ ES: el diseño «I-Xport IA» del Expediente en producción
   (ExpedienteElectronicoCE, DS.WebUI/wwwroot/css/login.css): panel izquierdo de
   marca —oscuro, con halos y la tarjeta de estatus con AXI— y panel derecho de
   formulario, claro.

   POR QUÉ ESTÁ APARTE Y NO DENTRO DE app/css/login.css: aquél es archivo de
   upstream y conflictuaría en cada retrofit. Esto es propio y sólo AÑADE — se
   carga después, así que gana por orden sin subir especificidad a la fuerza.

   LOS PASOS DEL ACCESO SON DEL TEMPLATE (código, recuperación, cambio de
   contraseña, rostro) y usan sus clases: .login-campo, .login-boton,
   .login-enlace… La sección «los pasos del template» de abajo las viste con el
   aspecto del original, para que no haya que editar ninguno de esos parciales.

   LO QUE NO TRAE, a propósito: ni un <style> ni un on*=. La CSP del caparazón
   es estricta (script-src 'self'; style-src 'self') y no admite nada en línea.
   ============================================================================= */

/* ── La tipografía del original ──────────────────────────────────────────────
   Inter, servida desde el propio sitio: el original la pedía a Google Fonts, y
   la CSP estricta (font-src 'self') bloquea esa hoja. Son los mismos cuatro
   archivos que trae producción. Geist Mono no existe aquí; su respaldo en el
   original ya era IBM Plex Mono, que el caparazón sí trae. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/Inter-Bold.woff2") format("woff2"); }

:root {
    --lg-font-main: "Inter", system-ui, sans-serif;
    --lg-font-mono: "Geist Mono", "IBM Plex Mono", ui-monospace, monospace;
    --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 ─────────────────────────────────────────────────────────────────── */

body.login-expediente {
    font-family: var(--lg-font-main);
    background: var(--lg-bg-light);
    color: var(--lg-l-title);
}

.auth { display: flex; min-height: 100vh; }

/* Sin esto los paddings de .brand y .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; }
.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; }

/* <h2> aquí y no el <h1> del original: el <h1> de la página es el nombre de la
   plataforma o el título del paso, en el panel del formulario. */
.brand-hero h2 {
    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;
}
.brand-hero h2 em {
    font-style: normal;
    background: var(--lg-grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── La tarjeta de estatus ── */
.status-card {
    width: 100%;
    max-width: 355px;
    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);
}
.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: lg-anillo 1.3s .3s cubic-bezier(.4, 0, .2, 1) forwards;
}
/* Inter con cifras tabulares y no la monoespaciada: el original la pinta en Geist Mono, que
   aquí no existe, y su respaldo —IBM Plex Mono— dibuja el cero con barra: «1ØØ%». */
.ring-val {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--lg-font-main); font-variant-numeric: tabular-nums;
    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-title {
    font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    color: var(--lg-d-muted); margin-bottom: 12px;
}
.sc-src { display: flex; flex-direction: column; gap: 11px; }
.src { display: flex; align-items: center; gap: 11px; opacity: 0; transform: translateY(4px); animation: lg-sube .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 .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; }
a.name:focus-visible { outline: 2px solid var(--lg-accent-light); outline-offset: 2px; border-radius: 3px; }

/* ═══ PANEL DERECHO · FORMULARIO (claro) ═════════════════════════════════════ */

.form-side {
    flex: 1;
    background: var(--lg-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* El contenedor es además la .login-tarjeta del template —de ahí saca login.js su
   formulario—, y aquélla es una tarjeta flotante con borde, sombra y vidrio. Aquí no:
   en el original el formulario va directo sobre el panel. Cada línea apaga una de las
   suyas; `.form-side` delante para ganarle también dentro de su media query de 480px. */
.form-side .login-tarjeta {
    width: 100%;
    max-width: 360px;
    padding: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.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);
}
.brand-mark svg { width: 26px; height: 26px; }
.form-side .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;
}
.form-head .signin { font-size: 13.5px; color: var(--lg-l-sub); margin: 0; }

/* En los demás pasos el nombre es marca y el título es el del paso: un punto menos de
   tamaño, para que el <h1> del paso no quede por debajo de él. */
.form-side .form-head p.platform { font-size: 22px; margin: 0; }
.form-side .form-head:has(p.platform) { margin-bottom: 24px; }

.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; }

.form-side .input-wrap input {
    width: 100%;
    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;
    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[hidden] { display: none; }
.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; }

/* Los dos ojos están en el marcado; aria-pressed —lo lleva login-expediente.js— dice cuál. */
.pw-toggle .pw-ojo-tachado,
.pw-toggle[aria-pressed="true"] .pw-ojo { display: none; }
.pw-toggle[aria-pressed="true"] .pw-ojo-tachado { display: block; }

.row-opts { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 22px; }
.remember {
    display: flex; align-items: center; gap: 8px; font-size: 12.5px;
    color: var(--lg-l-label); cursor: pointer; user-select: none;
}
.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; }
.forgot:focus-visible { outline: 2px solid var(--lg-accent-1); outline-offset: 2px; border-radius: 3px; }

.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;
}
.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; }

/* «Verificando...»: lo pone login-expediente.js al enviar, si login.js no canceló el envío. */
.btn-login .btn-loading { display: none; align-items: center; justify-content: center; gap: 8px; }
.btn-login.is-loading { opacity: .7; cursor: progress; transform: none; }
.btn-login.is-loading .btn-text { display: none; }
.btn-login.is-loading .btn-loading { display: flex; }
.spinner { animation: lg-gira 1s linear infinite; }

.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: lg-late 2.4s ease-in-out infinite;
}
.secure strong { color: var(--lg-accent-1); font-weight: 600; }

.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; }

/* ═══ LOS PASOS DEL TEMPLATE, con el aspecto del original ════════════════════
   Código, recuperación, cambio de contraseña y rostro son parciales de upstream con
   sus propias clases. Aquí se visten como el segundo factor del original (_MfaForm):
   título de paso, campos claros con borde cian, botón en degradado y enlaces cian.
   Todo con `.form-side` delante: gana a login.css sin depender sólo del orden. */

.form-side .login-tarjeta h1 {
    margin: 0 0 7px; font-size: 19px; font-weight: 700;
    letter-spacing: -.01em; color: var(--lg-l-title);
}
.form-side .login-subtitulo { margin: 0 0 18px; font-size: 13px; line-height: 1.55; color: var(--lg-l-sub); }

/* La insignia de los pasos (el correo al que se mandó el código) es el chip del original. */
.form-side .login-insignia {
    display: inline-flex; margin: 0 0 18px; padding: 6px 11px; border-radius: 999px;
    background: var(--lg-bg-white); 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%;
}
.form-side .login-insignia svg { flex: none; color: var(--lg-accent-1); }

.form-side .login-campo { margin-bottom: 16px; }
.form-side .login-campo span {
    font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    color: var(--lg-l-label); margin-bottom: 7px;
}
.form-side .login-campo input {
    padding: 12px 14px;
    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);
}
.form-side .login-campo input::placeholder { color: var(--lg-l-muted); }
.form-side .login-campo input:focus {
    background: var(--lg-bg-white);
    border-color: var(--lg-border-focus);
    box-shadow: 0 0 0 3px var(--lg-shadow-focus);
}

/* El campo del código: alto, centrado y monoespaciado, como el del original. */
.form-side .login-campo input.login-codigo {
    height: 54px; padding-left: 14px; padding-right: 14px;
    font-family: var(--lg-font-mono); font-size: 22px; font-weight: 600;
    letter-spacing: .42em; text-indent: .42em;
}
.form-side .login-pista { color: var(--lg-l-muted); }

.form-side .login-boton {
    padding: 13px; border-radius: var(--lg-radius-md);
    background: var(--lg-grad-accent);
    font-family: var(--lg-font-main); font-size: 15px; letter-spacing: .02em;
    box-shadow: 0 4px 16px var(--lg-shadow-btn);
    transition: transform .18s, box-shadow .18s;
}
.form-side .login-boton:hover {
    filter: none; transform: translateY(-1px);
    box-shadow: 0 6px 22px var(--lg-shadow-btn-hover);
}
.form-side .login-boton:active { transform: translateY(0); box-shadow: 0 4px 16px var(--lg-shadow-btn); }
.form-side .login-boton:focus-visible { outline: 2px solid var(--lg-accent-1); outline-offset: 2px; }

.form-side .login-enlace {
    font-weight: 600; color: var(--lg-accent-1); text-decoration: none;
}
.form-side .login-enlace:hover { color: var(--lg-accent-2); text-decoration: underline; }
.form-side .login-enlace:focus-visible { outline-color: var(--lg-accent-1); }

.form-side .login-codigo-pie,
.form-side .login-codigo-salida { color: var(--lg-l-sub); }

.form-side .login-error {
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .25);
    border-radius: var(--lg-radius-sm);
    color: #B4232A; font-size: 12px; font-weight: 500;
}
.form-side .login-aviso-info {
    background: rgba(11, 171, 230, .08);
    border: 1px solid rgba(11, 171, 230, .22);
    border-radius: var(--lg-radius-sm);
    color: #0A5C7A; font-size: 12px; font-weight: 500;
}

.form-side .login-requisitos {
    background: var(--lg-bg-white);
    border: 1px solid var(--lg-field-border);
    border-radius: var(--lg-radius-sm);
}

/* ── Movimiento ──────────────────────────────────────────────────────────── */

@keyframes lg-anillo { to { stroke-dashoffset: 0; } }
@keyframes lg-sube { to { opacity: 1; transform: translateY(0); } }
@keyframes lg-gira { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes lg-late {
    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); }
}

/* ── Responsive / accesibilidad ─────────────────────────────────────────── */

/* En pantalla angosta el panel de marca se va, como en el original. */
@media (max-width: 900px) {
    .brand { display: none; }
}

@media (max-width: 480px) {
    .form-side { padding: 32px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-glow, .ring-fill, .src, .secure .dot, .btn-login, .form-side .login-boton {
        animation: none !important;
        transition: none !important;
    }
    .ring-fill { stroke-dashoffset: 0; }
    .src { opacity: 1; transform: none; }
    .spinner { animation: lg-gira 1.6s linear infinite; }
}
