﻿/* ══════════════════════════════════════════════════════════════════
   LOGIN DEL FRONT (Login.aspx) — rediseño 2026
   Página liviana a propósito: no carga jQuery, Bootstrap, SweetAlert ni Font Awesome
   (los íconos son SVG en la página). Prefijo: lg-
   El tema (claro/oscuro) es el mismo que elige el usuario dentro del sistema (localStorage g-tema).
   ══════════════════════════════════════════════════════════════════ */
:root {
    --f: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --rojo: #bf0d3e; --rojo-bg: #bf0d3e; --rojo-h: #a20b35; --rojo-suave: #fcebef; --rojo-borde: #f3c2cf;
    --verde: #15803d; --verde-suave: #e8f6ed; --verde-borde: #b9e3c7;
    --ambar: #a15c07; --ambar-suave: #fff6e0; --ambar-borde: #f3d99a;
    --azul: #1d5fa8; --azul-suave: #eaf1fb; --azul-borde: #c3d6f2;
    --fondo: #ffffff; --panel: #f4f5f7; --sup: #ffffff; --borde: #dfe3e6; --borde-f: #c9cfd3;
    --txt: #1d2326; --txt2: #5c666c; --txt3: #8b949a;
    --foco: 0 0 0 4px rgba(191, 13, 62, .14);
    color-scheme: light;
}

html.dark {
    --rojo: #ff6b8f; --rojo-bg: #b00c3a; --rojo-h: #c81147; --rojo-suave: #3a1520; --rojo-borde: #5e2133;
    --verde: #4ade80; --verde-suave: #12291b; --verde-borde: #1f4a30;
    --ambar: #fbbf24; --ambar-suave: #2f2410; --ambar-borde: #5a4416;
    --azul: #7cb2ff; --azul-suave: #142235; --azul-borde: #23406a;
    --fondo: #0f1214; --panel: #181c1f; --sup: #181c1f; --borde: #2a3236; --borde-f: #3a4449;
    --txt: #e7ebed; --txt2: #a9b2b7; --txt3: #7a858b;
    --foco: 0 0 0 4px rgba(255, 107, 143, .22);
    color-scheme: dark;
}

/* Fundido corto al pasar al inicio (Chrome/Edge 126+) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--f); font-size: 14px; color: var(--txt); background: var(--fondo); -webkit-font-smoothing: antialiased; }
form { margin: 0; }

.lg { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(440px, .95fr); min-height: 100%; }

/* ── Arte de la marca: JPEG + máscara (la curva y la sombra). IIS 8.5 no sirve WebP sin Web.config. ── */
.lg-arte { position: relative; overflow: hidden; }
.lg-arte-img {
    position: absolute; inset: 0;
    background: url("../../img/g/login-arte.jpg") left center / cover no-repeat;
    -webkit-mask: url("../../img/g/login-arte-mascara.png") left center / cover no-repeat;
            mask: url("../../img/g/login-arte-mascara.png") left center / cover no-repeat;
    animation: lg-aparece .5s ease both;
}

/* ── Panel del formulario ── */
.lg-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 32px 24px; }
.lg-caja { width: 100%; max-width: 400px; animation: lg-sube .35s ease both; }

.lg-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 30px; }
.lg-logo img { height: 74px; width: auto; }
html.dark .lg-logo img { filter: brightness(0) invert(1); }
.lg-chip {
    display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 12px;
    border-radius: 999px; background: var(--panel); border: 1px solid var(--borde);
    color: var(--txt2); font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.lg-chip i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.lg-chip.lg-off i { background: var(--rojo); }

.lg-tit { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.lg-sub { margin: 0 0 24px; font-size: 14px; color: var(--txt2); }

/* Avisos dentro del formulario (errores del servidor, activación de terminal, etc.) */
.lg-aviso {
    display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 12px 14px;
    border-radius: 12px; border: 1px solid var(--azul-borde); background: var(--azul-suave);
    font-size: 13.5px; line-height: 1.45;
}
.lg-aviso svg { flex: 0 0 18px; margin-top: 1px; color: var(--azul); }
.lg-aviso b { display: block; }
.lg-aviso-error { border-color: var(--rojo-borde); background: var(--rojo-suave); animation: lg-sacude .32s ease; }
.lg-aviso-error svg { color: var(--rojo); }
.lg-aviso-warning { border-color: var(--ambar-borde); background: var(--ambar-suave); }
.lg-aviso-warning svg { color: var(--ambar); }
.lg-aviso-success { border-color: var(--verde-borde); background: var(--verde-suave); }
.lg-aviso-success svg { color: var(--verde); }

/* Campos */
.lg-campo { margin-bottom: 16px; }
.lg-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.lg-input { position: relative; }
.lg-input > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--txt3); pointer-events: none; transition: color .15s; }
.lg-input input {
    width: 100%; height: 50px; margin: 0; padding: 0 46px;
    border: 1.5px solid var(--borde); border-radius: 12px;
    background: var(--sup); color: var(--txt);
    font: inherit; font-size: 15px; font-weight: 500;
    transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.lg-input input::placeholder { color: var(--txt3); font-weight: 400; }
.lg-input input:hover { border-color: var(--borde-f); }
.lg-input input:focus { outline: none; border-color: var(--rojo); box-shadow: var(--foco); }
.lg-input:focus-within > svg { color: var(--rojo); }
.lg-mayus input { text-transform: uppercase; }
.lg-mayus input::placeholder { text-transform: none; }
.lg-campo.lg-mal input { border-color: var(--rojo); }
.lg-msj { display: none; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--rojo); }
.lg-campo.lg-mal .lg-msj { display: block; }
.lg-ojo {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 9px; background: transparent; color: var(--txt3); cursor: pointer;
}
.lg-ojo:hover { background: var(--panel); color: var(--txt); }
.lg-ojo:focus-visible { outline: none; box-shadow: var(--foco); }
.lg-ojo .lg-ojo-no { display: none; }
.lg-ojo[aria-pressed="true"] .lg-ojo-si { display: none; }
.lg-ojo[aria-pressed="true"] .lg-ojo-no { display: inline; }

/* Botón principal */
.lg-btn {
    display: block; width: 100%; height: 52px; margin-top: 8px; border: 0; border-radius: 12px;
    background: var(--rojo-bg); color: #fff;
    font: inherit; font-size: 15.5px; font-weight: 800; letter-spacing: .2px; cursor: pointer;
    box-shadow: 0 8px 20px -8px rgba(191, 13, 62, .6);
    transition: background .15s, transform .08s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.lg-btn:hover { background: var(--rojo-h); }
.lg-btn:active { transform: translateY(1px); }
.lg-btn:focus-visible { outline: none; box-shadow: var(--foco), 0 8px 20px -8px rgba(191, 13, 62, .6); }
.lg-btn:disabled { opacity: .55; cursor: not-allowed; }
.lg-enviar { position: relative; }
.lg-gira {
    display: none; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -70px;
    border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
    pointer-events: none; animation: lg-gira .7s linear infinite;
}
.lg-enviando .lg-btn { cursor: progress; background: var(--rojo-h); padding-left: 28px; }
.lg-enviando .lg-gira { display: block; }
.lg-enviando .lg-input input { opacity: .65; }

/* Barra superior mientras se valida y entra */
.lg-progreso { position: fixed; left: 0; top: 0; z-index: 10; height: 3px; width: 0; background: var(--rojo-bg); transition: width 3s cubic-bezier(.1, .7, .2, 1); }
.lg-enviando .lg-progreso { width: 88%; }

/* Separador, rastreo y pie */
.lg-o { display: flex; align-items: center; gap: 14px; margin: 22px 0 16px; color: var(--txt3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.lg-o::before, .lg-o::after { content: ""; flex: 1; height: 1px; background: var(--borde); }
.lg-sec {
    display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px;
    border: 1.5px solid var(--borde); border-radius: 12px; color: var(--txt);
    font-size: 14px; font-weight: 700; text-decoration: none; transition: border-color .15s, background .15s;
}
.lg-sec:hover { border-color: var(--borde-f); background: var(--panel); }
.lg-sec:focus-visible { outline: none; box-shadow: var(--foco); }
.lg-sec svg { color: var(--rojo); }

.lg-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 400px; margin-top: 36px; font-size: 12px; color: var(--txt3); }
.lg-tema {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
    border: 1px solid var(--borde); border-radius: 999px; background: transparent;
    color: var(--txt2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.lg-tema:hover { background: var(--panel); }
.lg-tema:focus-visible { outline: none; box-shadow: var(--foco); }

@keyframes lg-gira { to { transform: rotate(360deg); } }
@keyframes lg-sacude { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes lg-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes lg-sube { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 959.98px) {
    .lg { grid-template-columns: 1fr; }
    .lg-arte { display: none; }
    .lg-panel { justify-content: flex-start; padding: 48px 20px 24px; background: linear-gradient(180deg, var(--rojo-suave) 0, var(--fondo) 260px); }
}
@media (max-height: 720px) and (min-width: 960px) {
    .lg-logo { margin-bottom: 18px; }
    .lg-logo img { height: 58px; }
    .lg-sub { margin-bottom: 16px; }
    .lg-pie { margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
