/*
 * Login (rediseño 2026-11-27)
 * Computadora (>= 992px): pantalla dividida, panel de marca a la izquierda y formulario a la derecha.
 * Tablet / celular: tarjeta centrada sobre la imagen de fondo.
 * Modo oscuro: html.modo-oscuro (el mismo ajuste que usa el sistema).
 * Respaldos: scratchpad login.css.bak_v2 (diseño anterior) y login.css.bak_moderno (original).
 */

.lg-pantalla {
    --lg-primario: #2563eb;
    --lg-primario-osc: #1d4ed8;
    --lg-texto: #0f172a;
    --lg-suave: #64748b;
    --lg-borde: #cbd5e1;
    --lg-campo: #f8fafc;
    --lg-fondo-form: #ffffff;
    --lg-naranja: #f59e0b;

    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--lg-texto);
    background: #0f172a url(../img/back_login.fw.png) center / cover no-repeat;
    z-index: 10;
}
.lg-pantalla *, .lg-pantalla *::before, .lg-pantalla *::after { box-sizing: border-box; }

/* ---------- panel de marca ---------- */
.lg-marca {
    position: relative;
    flex: 1 1 55%;
    display: none;                 /* solo en pantallas grandes */
    align-items: center;
    padding: 56px 64px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, rgba(15, 23, 42, .92) 0%, rgba(30, 58, 138, .82) 60%, rgba(37, 99, 235, .70) 100%);
}
.lg-marca-contenido { position: relative; z-index: 1; max-width: 520px; }
.lg-marca-logo { display: block; width: 260px; max-width: 100%; height: auto; margin: 0 0 36px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35)); }
.lg-marca-titulo {
    margin: 0 0 28px;
    font-size: 32px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em;
    color: #fff;
}
.lg-marca-lista { list-style: none; margin: 0; padding: 0; }
.lg-marca-lista li { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; font-size: 16px; color: #dbeafe; }
.lg-marca-ico {
    flex: 0 0 40px; width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    color: var(--lg-naranja); font-size: 17px;
}
/* adornos */
.lg-burbuja { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.lg-burbuja-1 { width: 420px; height: 420px; right: -140px; top: -120px; background: radial-gradient(circle, rgba(96, 165, 250, .35) 0%, rgba(96, 165, 250, 0) 70%); }
.lg-burbuja-2 { width: 360px; height: 360px; left: -120px; bottom: -140px; background: radial-gradient(circle, rgba(245, 158, 11, .22) 0%, rgba(245, 158, 11, 0) 70%); }

/* ---------- lado del formulario ---------- */
.lg-lado-form {
    position: relative;
    flex: 1 1 100%;
    display: flex; align-items: center; justify-content: center;
    min-height: 100%;
    padding: 72px 16px 32px;
    background: linear-gradient(135deg, rgba(15, 23, 42, .88) 0%, rgba(30, 58, 138, .78) 100%);
}
.lg-tarjeta {
    width: 100%; max-width: 400px;
    background: var(--lg-fondo-form);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(2, 6, 23, .45);
    overflow: hidden;
    animation: lg-entrar .45s ease-out both;
}
@keyframes lg-entrar { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* logo de la tarjeta (celular/tablet). Se llama .logo: el sistema le aplica "shake" al fallar */
.lg-tarjeta .logo {
    height: 112px;
    background: url(../img/logo.png) no-repeat center / auto 64px, linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

#login { padding: 28px 28px 8px; }
.lg-titulo { margin: 0 0 4px; font-size: 24px; font-weight: 700; color: var(--lg-texto); letter-spacing: -.01em; }
.lg-subtitulo { margin: 0 0 22px; font-size: 14px; color: var(--lg-suave); }

.lg-etiqueta { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: #334155; }

.lg-campo { position: relative; margin: 0 0 16px; }
.lg-campo-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 16px; color: #94a3b8; pointer-events: none;
    transition: color .15s ease;
}
.lg-campo input[type="text"],
.lg-campo input[type="password"] {
    display: block; width: 100%; height: 48px; margin: 0;
    padding: 0 44px 0 42px;
    font: inherit; font-size: 16px;           /* 16px: el iPhone no hace zoom al enfocar */
    color: var(--lg-texto);
    background: var(--lg-campo) !important;   /* sin el icono rojo de "obligatorio" del sistema */
    border: 1px solid var(--lg-borde);
    border-radius: 12px;
    outline: none;
    -webkit-appearance: none; appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lg-campo input::placeholder { color: #94a3b8; }
.lg-campo input:focus {
    border-color: var(--lg-primario);
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}
.lg-campo:focus-within .lg-campo-ico { color: var(--lg-primario); }
/* autocompletado del navegador: mantiene el fondo del campo */
.lg-campo input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--lg-campo) inset; -webkit-text-fill-color: var(--lg-texto); }

.lg-ver-clave {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; padding: 0;
    border: none; border-radius: 10px;
    background: transparent; color: #94a3b8; font-size: 16px; cursor: pointer;
}
.lg-ver-clave:hover { background: #e2e8f0; color: #334155; }

.lg-aviso-mayus {
    display: none;
    margin: -8px 0 14px; padding: 7px 10px;
    font-size: 12.5px; color: #92400e;
    background: #fef3c7; border-radius: 8px;
}
.lg-aviso-mayus.visible { display: block; }

/* errores de la validacion: el sistema pone el mensaje dentro de .lg-campo, debajo del input.
   Los iconos se centran respecto al input (24px = mitad de su alto) y no se mueven al aparecer el mensaje. */
.lg-campo-ico { top: 24px !important; }
.lg-ver-clave { top: 24px !important; }
#LG__formLogin label.error {
    display: block; margin: 6px 0 0 2px;
    font-size: 12.5px; font-weight: 500; line-height: 1.3;
    color: #dc2626 !important;
}
html.modo-oscuro #LG__formLogin label.error { color: #f87171 !important; }
#LG__formLogin input.error { border-color: #f87171 !important; background-color: #fef2f2 !important; }

.lg-btn-entrar {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 50px; margin: 8px 0 0;
    font: inherit; font-size: 16px; font-weight: 600;
    color: #fff !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: none !important; border-radius: 12px !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .35);
    cursor: pointer;
    transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}
.lg-btn-entrar:hover { filter: brightness(1.07); box-shadow: 0 12px 26px rgba(37, 99, 235, .45); }
.lg-btn-entrar:active { transform: translateY(1px); }
.lg-btn-entrar .fa-arrow-right { transition: transform .15s ease; }
.lg-btn-entrar:hover .fa-arrow-right { transform: translateX(3px); }
.lg-btn-entrar[disabled] { opacity: .75; cursor: wait; }

.lg-tarjeta .foot { padding: 18px 24px 22px; text-align: center; font-size: 11.5px; line-height: 1.5; color: var(--lg-suave); }
.lg-tarjeta .foot a { color: var(--lg-primario); text-decoration: none; }
.lg-tarjeta .foot a:hover { text-decoration: underline; }

/* boton de modo oscuro */
.lg-btn-tema {
    position: absolute; top: 16px; right: 16px;
    width: 42px; height: 42px; padding: 0;
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 12px;
    background: rgba(255, 255, 255, .10); color: #fff; font-size: 18px; cursor: pointer;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    transition: background .15s ease;
}
.lg-btn-tema:hover { background: rgba(255, 255, 255, .2); }

/* ---------- computadora: pantalla dividida ---------- */
@media (min-width: 992px) {
    .lg-marca { display: flex; }
    .lg-lado-form {
        flex: 0 0 480px;
        padding: 48px 56px;
        background: var(--lg-fondo-form);
    }
    .lg-tarjeta { max-width: 360px; background: transparent; border-radius: 0; box-shadow: none; overflow: visible; }
    .lg-tarjeta .logo { display: none; }         /* el logo ya esta en el panel de marca */
    #login { padding: 0; }
    .lg-titulo { font-size: 28px; }
    .lg-subtitulo { margin-bottom: 28px; }
    .lg-tarjeta .foot { padding: 28px 0 0; }
    .lg-btn-tema { color: #475569; border-color: #e2e8f0; background: #f8fafc; }
    .lg-btn-tema:hover { background: #eef2f7; }
}
@media (min-width: 1400px) {
    .lg-lado-form { flex-basis: 560px; }
    .lg-marca { padding: 64px 96px; }
    .lg-marca-titulo { font-size: 38px; }
}

/* ---------- celulares pequeños ---------- */
@media (max-width: 380px) {
    #login { padding: 22px 18px 6px; }
    .lg-tarjeta .logo { height: 96px; background-size: auto 54px, auto; }
    .lg-titulo { font-size: 21px; }
}
/* pantallas bajas (celular en horizontal) */
@media (max-height: 560px) and (max-width: 991px) {
    .lg-lado-form { align-items: flex-start; padding-top: 64px; }
    .lg-tarjeta .logo { height: 80px; background-size: auto 46px, auto; }
}

/* ---------- modo oscuro ---------- */
html.modo-oscuro .lg-pantalla {
    --lg-texto: #e2e8f0;
    --lg-suave: #94a3b8;
    --lg-borde: #334155;
    --lg-campo: #0b1220;
    --lg-fondo-form: #111827;
}
html.modo-oscuro .lg-etiqueta { color: #cbd5e1; }
html.modo-oscuro .lg-campo input:focus { background-color: #0b1220 !important; box-shadow: 0 0 0 4px rgba(59, 130, 246, .25); }
html.modo-oscuro .lg-campo input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #0b1220 inset; -webkit-text-fill-color: #e2e8f0; }
html.modo-oscuro .lg-ver-clave:hover { background: #1f2937; color: #e2e8f0; }
html.modo-oscuro .lg-aviso-mayus { color: #fde68a; background: rgba(245, 158, 11, .15); }
html.modo-oscuro #LG__formLogin input.error { background-color: rgba(220, 38, 38, .12) !important; }
html.modo-oscuro .lg-tarjeta .foot a { color: #60a5fa; }
@media (min-width: 992px) {
    html.modo-oscuro .lg-btn-tema { color: #e2e8f0; border-color: #334155; background: #1f2937; }
    html.modo-oscuro .lg-btn-tema:hover { background: #273449; }
}

/* sin animaciones si el usuario lo pidio en su sistema */
@media (prefers-reduced-motion: reduce) {
    .lg-tarjeta { animation: none; }
}
