/* login-gns.css v1.2.0 — Rediseño login GNS+ "Placa de circuito"
   Cargado por login_head.php en las 5 pantallas de autenticación.
   Scoping: todo cuelga de clases propias (cir-*, card, campo, etc.) o de
   body.login-gns; no pisa Tailwind. A MetroNotification le pisa SOLO el
   cartel .SmallBox (bloque al final), y a propósito: ver ahí por qué.
   v1.1.0: el circuito se genera por JS en píxeles del viewport
   (login-ambiente.php); los dasharray de pulsos van inline por pista.
   v1.2.0: el cartel de $.smallBox ("Acceso incorrecto") se rearma con flex. */

:root {
    --lg-azul: #3477CB;
    --lg-azul-fuerte: #2b64ad;
    --lg-rojo: #f87171;
    --lg-ambar: #fbbf24;
    --lg-txt: #f3f7fc;
    --lg-txt-tenue: #c3d2e4;
    --lg-txt-suave: #93a6bd;
    --lg-linea: rgba(255, 255, 255, 0.35);
    --lg-disp: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
    --lg-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
    --lg-ui: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    /* Ambiente de circuito: todo en tonos de azul */
    --lg-cian: #6cb6ff;
    --lg-azul-medio: #3b82f6;
    --lg-azul-hondo: #2563eb;
}

html.login-gns, body.login-gns { height: 100%; margin: 0; padding: 0; }
html.login-gns { color-scheme: dark; }
body.login-gns {
    min-height: 100%;
    font-family: var(--lg-ui);
    color: var(--lg-txt);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Fondo negro-azulado profundo (la foto va tenue dentro de .lg-bg) */
    background:
        radial-gradient(1200px 800px at 80% 6%, rgba(108,182,255,.10), transparent 55%),
        radial-gradient(1000px 700px at 6% 94%, rgba(37,99,235,.10), transparent 55%),
        linear-gradient(160deg, #07131f 0%, #081726 44%, #05070c 100%);
}

/* ===== Fondo animado: placa de circuito (login-ambiente.php) ===== */
.lg-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.lg-bg .photo {
    position: absolute; inset: 0;
    background: url("../imagenes/background/gns-auth-bg.webp") center/cover no-repeat;
    opacity: .18;
    filter: saturate(1.05) brightness(.62);
}
.lg-bg .circuit { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .6; }
.cir-t { fill: none; stroke: #163150; stroke-width: 1.3; opacity: .55; }
.cir-pad { fill: #0c1a2c; stroke: #24506f; stroke-width: 1; }
.cir-node { fill: #0a1220; stroke: #295672; stroke-width: 1.3; }
.cir-node.live { animation: lgVia 4.5s ease-in-out infinite; }
.cir-p {
    fill: none; stroke-width: 2; stroke-linecap: round;
    /* stroke-dasharray va inline por pista: fotón de largo fijo en px */
    animation: lgFlow var(--d,9s) linear infinite;
    animation-delay: var(--dl,0s);
    filter: drop-shadow(0 0 5px currentColor);
}
.cir-p.p-cyan { stroke: var(--lg-cian); color: var(--lg-cian); }
.cir-p.p-green { stroke: var(--lg-azul-medio); color: var(--lg-azul-medio); }
.cir-p.p-violet { stroke: var(--lg-azul-hondo); color: var(--lg-azul-hondo); }
@keyframes lgFlow { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes lgVia { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

/* Pulso rápido nítido ("dato apurado"): lo dispara el JS del ambiente sobre
   trazas al azar, cada uno una sola vez */
.surge-run {
    fill: none;
    stroke-width: 2.6; stroke-linecap: round;
    /* stroke-dasharray va inline por pista: fotón de largo fijo en px */
    filter: drop-shadow(0 0 4px currentColor);
    animation: lgSurge var(--dur, 0.9s) linear forwards;
}
.surge-run.s-violeta { stroke: #b833ff; color: #b833ff; }
.surge-run.s-blanco  { stroke: #ffffff; color: #ffffff; }
.surge-run.s-azul    { stroke: #1a8cff; color: #1a8cff; }
@keyframes lgSurge {
    0%   { stroke-dashoffset: 1; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

.lg-bg .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.lg-bg .blob.c { width: 520px; height: 520px; top: -160px; right: -120px;
    background: radial-gradient(circle, rgba(108,182,255,.4), transparent 66%);
    animation: lgDrift 22s ease-in-out infinite; }
.lg-bg .blob.v { width: 560px; height: 560px; bottom: -200px; left: -160px;
    background: radial-gradient(circle, rgba(37,99,235,.34), transparent 66%);
    animation: lgDrift 26s ease-in-out infinite reverse; }
.lg-bg .blob.g { width: 340px; height: 340px; top: 38%; left: 44%;
    background: radial-gradient(circle, rgba(59,130,246,.18), transparent 68%);
    animation: lgDrift 30s ease-in-out infinite; }
@keyframes lgDrift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(26px,-30px); } }

.lg-bg .veil {
    position: absolute; inset: 0;
    background:
        radial-gradient(1100px 900px at 68% 50%, transparent 0%, rgba(3,5,10,.55) 78%),
        linear-gradient(0deg, rgba(3,5,10,.5), transparent 30%, transparent 70%, rgba(3,5,10,.35));
}

/* Las pantallas 2FA/validación mantienen su main: solo lo suben sobre el fondo */
.sobre-ambiente { position: relative; z-index: 1; }

/* ===== Maqueta del login (dos columnas + barra inferior) ===== */
#marco {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column;
}
#pantalla { flex: 1; display: flex; flex-direction: column; }
@media (min-width: 1024px) { #pantalla { flex-direction: row; } }

#barraInferior { display: none; }
@media (min-width: 1024px) {
    #barraInferior {
        display: flex; align-items: center; justify-content: center;
        flex-wrap: wrap; gap: 12px 34px;
        padding: 14px 46px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(5, 9, 16, 0.42);
        -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    }
}
#barraInferior .stats, #barraInferior .sellos, #barraInferior .ia { margin: 0; max-width: none; }

/* --- Hero (izquierda, solo desktop) --- */
#hero {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}
@media (min-width: 1024px) { #hero { display: flex; } }
#heroInner { position: relative; max-width: 30rem; }
#heroInner .marca { display: flex; align-items: center; gap: 18px; margin-bottom: 2rem; }
#heroInner .marca .logo-link { display: flex; flex: none; border-radius: 8px; transition: opacity 0.2s; }
#heroInner .marca .logo-link:hover { opacity: 0.82; }
#heroInner .marca .logo-link:focus-visible { outline: 2px solid var(--lg-cian); outline-offset: 4px; }
#heroInner .marca .logo-corp { height: 68px; width: auto; display: block; flex: none; border: 0; }
#heroInner .marca .divisor { width: 1px; height: 48px; background: rgba(255, 255, 255, 0.16); flex: none; }
#heroInner .marca .producto { display: flex; flex-direction: column; gap: 3px; }
#heroInner .marca .producto .erp {
    font-family: var(--lg-mono); font-weight: 500;
    font-size: 0.95rem; letter-spacing: 0.18em;
    color: var(--lg-cian);
}
#heroInner .marca .producto .desc { font-size: 0.9rem; color: var(--lg-txt-tenue); line-height: 1.25; }
#heroInner h1 {
    margin: 0;
    font-family: var(--lg-disp);
    font-size: clamp(3rem, 5vw, 4.4rem);
    line-height: 1.04;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-wrap: balance;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}
#heroInner h1 .hl {
    background: linear-gradient(100deg, var(--lg-cian), var(--lg-azul-medio));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
#heroInner p {
    margin: 1.2rem 0 0;
    font-size: clamp(1.05rem, 1.6vw, 1.4rem);
    font-weight: 300;
    color: var(--lg-txt-tenue);
    max-width: 28rem;
}
.stats {
    margin-top: 2rem;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-family: var(--lg-mono);
    font-size: 0.8rem; color: var(--lg-txt-suave);
}
.stats b { color: var(--lg-txt); font-weight: 500; }
.stats .sep { width: 1px; height: 13px; background: rgba(147, 166, 189, 0.45); }

/* Sellos / credenciales: chips sobrios */
.sellos { display: flex; flex-wrap: wrap; gap: 8px; }
.sellos .chip {
    font-family: var(--lg-mono);
    font-size: 0.66rem; letter-spacing: 0.02em;
    color: var(--lg-txt-tenue);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 4px 11px;
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}
/* Línea de IA: acento azul */
.ia {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--lg-mono);
    font-size: 0.72rem; letter-spacing: 0.03em;
    color: var(--lg-cian);
}
.ia svg { width: 15px; height: 15px; flex: none; }

/* --- Columna de la card --- */
#cardCol {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}
/* login-group / reset-group: bloques simples para convivir con el
   toggle jQuery .hide()/.show() (none <-> block) de reset-form.php */
#cardCol > .login-group, #cardCol > .reset-group { width: 100%; max-width: 30rem; }

/* ===== Card glass con borde luminoso ===== */
.card {
    position: relative;
    width: 100%;
    max-width: 30rem;
    margin: 0 auto;
    padding: 2.6rem 2.4rem 2.2rem;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(32, 51, 78, 0.66), rgba(16, 28, 47, 0.74));
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid transparent;
    box-shadow:
        0 34px 80px -30px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    animation: lgEntra 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.card::before {
    content: "";
    position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(140deg, rgba(108,182,255,.75), rgba(37,99,235,.18) 45%, rgba(59,130,246,.6));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}
@media (max-width: 480px) { .card { padding: 2rem 1.5rem; } }
@keyframes lgEntra {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-logo { display: flex; justify-content: center; margin-bottom: 0.9rem; }
.card-logo img { height: 50px; width: auto; display: block; border: 0; }
.card-titulo { text-align: center; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; color: var(--lg-txt); }
.card-sub { text-align: center; font-size: 0.9rem; color: var(--lg-txt-suave); margin-top: 0.3rem; margin-bottom: 2rem; }

/* Indicador "conexión segura" */
.safe {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--lg-txt-suave); margin-bottom: 1.3rem;
}
.safe svg { opacity: 0.85; }

/* --- Campo con label flotante + icono prefijo --- */
.campo { position: relative; margin-bottom: 1.55rem; }
.campo .icono {
    position: absolute; left: 2px; top: 0.55rem;
    color: var(--lg-txt-suave); pointer-events: none; transition: color 0.2s;
}
.campo input {
    width: 100%; box-sizing: border-box;
    padding: 0.55rem 2.2rem 0.55rem 2rem;
    font-size: 1rem; font-family: var(--lg-ui); color: var(--lg-txt);
    background: transparent; border: none;
    border-bottom: 2px solid var(--lg-linea);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    border-radius: 6px 6px 0 0;
}
.campo input::-ms-reveal, .campo input::-ms-clear { display: none; }
/* Hover = mismo realce que focus (borde, fondo e icono); el label NO se mueve en hover */
.campo input:focus,
.campo input:hover { border-bottom-color: var(--lg-cian); background: rgba(255, 255, 255, 0.06); }
.campo input:focus ~ .icono,
.campo input:hover ~ .icono { color: var(--lg-cian); }
.campo label {
    position: absolute; left: 2rem; top: 0.55rem;
    font-size: 1rem; color: var(--lg-txt-suave);
    pointer-events: none; transform-origin: left;
    transition: transform 0.18s ease, color 0.18s ease;
}
.campo input:focus + label,
.campo input.con-valor + label,
.campo input:not(:placeholder-shown) + label {
    transform: translateY(-1.5rem) scale(0.78);
    color: var(--lg-txt-tenue);
}
.campo .ojo {
    position: absolute; right: 0; top: 0.35rem;
    background: none; border: none; color: var(--lg-txt-suave);
    cursor: pointer; padding: 4px; border-radius: 6px; display: flex;
}
.campo .ojo:hover { color: var(--lg-txt); }
.campo .ojo:focus-visible { outline: 2px solid var(--lg-cian); outline-offset: 1px; }

/* --- Caps lock --- */
.hint-caps {
    display: none; align-items: center; gap: 6px;
    font-size: 0.78rem; color: var(--lg-ambar); margin-top: 0.4rem;
}
.hint-caps.on { display: flex; }

/* --- Botón --- */
.btn-ingresar {
    width: 100%; height: 3rem; box-sizing: border-box;
    border: none; border-radius: 12px;
    background: linear-gradient(180deg, #3f83d6, var(--lg-azul));
    color: #fff; font-size: 1rem; font-weight: 600; font-family: var(--lg-ui);
    cursor: pointer; text-decoration: none;
    box-shadow: 0 10px 24px rgba(52, 119, 203, 0.45);
    transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    position: relative;
}
.btn-ingresar:hover { filter: brightness(1.08); box-shadow: 0 14px 32px rgba(52, 119, 203, 0.55); color: #fff; }
.btn-ingresar:active { transform: translateY(1px); }
.btn-ingresar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-ingresar .spin {
    width: 18px; height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
    border-radius: 50%; display: none; animation: lgGiro 0.7s linear infinite;
}
.btn-ingresar.cargando { pointer-events: none; filter: saturate(0.6) brightness(0.9); }
.btn-ingresar.cargando .txt { opacity: 0.7; }
.btn-ingresar.cargando .spin { display: block; }
@keyframes lgGiro { to { transform: rotate(360deg); } }

/* Badge flotante de reCAPTCHA oculto (permitido por Google si la atribución
   se muestra en el flujo: la trae .recaptcha-nota dentro de la card) */
.grecaptcha-badge { visibility: hidden !important; }

/* Lienzo de la estrella fugaz de fin de año (solo se emite del 8 dic al 6 ene).
   Va por encima de todo, decorativo, sin capturar clics. */
#fxFiestas { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.recaptcha-nota {
    margin-top: 1.1rem;
    text-align: center;
    font-size: 0.66rem; line-height: 1.5;
    color: var(--lg-txt-suave);
}
.recaptcha-nota a { color: var(--lg-txt-suave); text-decoration: underline; }
.recaptcha-nota a:hover { color: var(--lg-txt-tenue); }

.olvido { text-align: center; margin-top: 1.3rem; }
.olvido a {
    font-size: 0.9rem; color: var(--lg-txt-tenue); text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
}
.olvido a:hover { color: #fff; border-bottom-color: var(--lg-cian); }

@media (prefers-reduced-motion: reduce) {
    .cir-p, .surge-run, .cir-node.live, .lg-bg .blob, .card, .btn-ingresar .spin { animation: none !important; }
}

/* ---------------------------------------------------------------------------
   Cartel de MetroNotification ($.smallBox: "Acceso incorrecto", "Debe ingresar
   un Usuario", "Acceso Denegado"...).
   POR QUÉ SE PISA: la librería arma el cartel con floats y anchos en % pensados
   para content-box (imagen de 100px + texto al 65% + márgenes, dentro de 420px
   con padding-right 30). El preflight de Tailwind (assets/tailwind/output.css)
   pone box-sizing:border-box e img{display:block} a TODO, y con eso el texto ya
   no entra al lado de la imagen: cae debajo, y la nube (.miniPic, absoluta sin
   left) queda encima del texto. Medido en el navegador: en pantallas angostas
   el cartel llega a tener 0 px de contenido. Se rearma con flex, que no depende
   del box-sizing. Scoped a body.login-gns: no toca el resto del ERP.
   --------------------------------------------------------------------------- */
/* El contenedor cubre todo el ancho (sin capturar clics) para que el cartel
   pueda medirse en % y no en vw: 100vw da 0 en algunos navegadores embebidos. */
body.login-gns #divSmallBoxes { width: auto; left: 0; right: 0; top: 0; pointer-events: none; z-index: 10000; }
/* (z-index en el contenedor, no solo en .SmallBox: la card del login crea su
   propio contexto de apilamiento y sin esto se pinta encima del cartel) */
body.login-gns .SmallBox {
    box-sizing: border-box; pointer-events: auto;
    display: flex; align-items: center; gap: 14px;
    width: 380px; max-width: calc(100% - 32px);
    right: 16px; top: 16px;
    padding: 14px 40px 14px 14px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    font-family: var(--lg-ui);
}
body.login-gns .SmallBox .foto {
    float: none; flex: 0 0 64px;
    width: 64px; height: 64px; margin: 0;
}
body.login-gns .SmallBox .foto img { display: block; width: 64px; height: 64px; }
body.login-gns .SmallBox .textoFoto,
body.login-gns .SmallBox .textoFull {
    float: none; flex: 1 1 auto; min-width: 0;
    width: auto; margin: 0; padding: 0;
}
body.login-gns .SmallBox span {
    display: block;
    font-size: 1.05rem; font-weight: 600; line-height: 1.25;
}
body.login-gns .SmallBox p {
    margin: 4px 0 0;
    font-size: 0.85rem; line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}
/* La nube decorativa va al rincón inferior derecho, chica, sin pisar texto */
body.login-gns .SmallBox .miniIcono { height: auto; }
body.login-gns .SmallBox .miniPic {
    position: absolute; right: 10px; bottom: 8px; left: auto;
    width: 20px; height: 20px; opacity: 0.85;
}
