/* ============================================================
   LOGIN — Estilos extraídos desde login.html
   ============================================================ */
/* Tokens y componentes (.btn, .campo, .panel-flotante, .esquinas): base.css */

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    font-family: var(--fuente-texto);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
}

/* --- HEADER BRANDING --- */
.branding-header {
    text-align: center;
    margin-bottom: 60px;
    z-index: 100;
}

.ogmei-tag {
    font-family: var(--fuente-mono);
    color: var(--hud-cyan);
    font-size: 0.8rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0.8;
}

.main-logo-text {
    font-family: var(--fuente-hud);
    font-size: 3.8rem;
    font-weight: 700;
    letter-spacing: -2px;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #fff, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
}

.main-logo-text span {
    -webkit-text-fill-color: transparent;
    background: inherit;
    -webkit-background-clip: text;
}

/* --- DUAL MODULES CONTAINER --- */
.modules-grid {
    display: grid;
    grid-template-columns: 450px 450px;
    gap: 40px;
    z-index: 100;
}

@keyframes modules-fade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- TACTICAL CARD STYLE --- */
.tactical-card {
    padding: 50px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tactical-card:hover {
    border-color: var(--hud-cyan);
    transform: translateY(-5px);
    box-shadow: 0 40px 80px rgba(0,0,0,0.7), 0 0 30px rgba(var(--hud-cyan-rgb), 0.05);
}

.card-header {
    margin-bottom: 40px;
}

.card-header h2 {
    font-family: var(--fuente-hud);
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-header h2 i,
.card-header h2 svg { color: var(--hud-cyan); width: 26px; height: 26px; flex-shrink: 0; }

.card-label {
    font-family: var(--fuente-mono);
    font-size: 0.65rem;
    color: var(--hud-cyan);
    margin-top: 8px;
    opacity: 0.6;
    letter-spacing: 2px;
}

/* --- FORMS --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field-wrap {
    position: relative;
}

.field-wrap i,
.field-wrap svg {
    position: absolute;
    left: 15px; top: 50%;
    transform: translateY(-50%);
    color: var(--hud-cyan);
    opacity: 0.5;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.tactical-input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 16px 16px 45px;
    font-family: var(--fuente-texto);
    font-size: 0.95rem;
    letter-spacing: 1px;
}

/* Placeholder consistente y dentro del campo */
.tactical-input::placeholder { letter-spacing: 1px; }

/* Estados de error del input + mensaje */
.tactical-input.input-error {
    border-color: var(--hud-red);
}
.login-error {
    color: var(--hud-red);
    font-family: var(--fuente-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-top: -10px;
    text-align: center;
}

/* Overlay del intro cinemático: centra todo en ambos ejes.
   (antes vivía solo en tablero.css, que el login no carga) */
.cinematic-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: transparent;
    z-index: 99999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: hidden;
}

/* Estados iniciales de los elementos del intro (antes inline en HTML) */
#loading-overlay { display: none; }
#msg-1-container { display: flex; flex-direction: column; align-items: center; }
#msg-2 { display: none; }

/* Botón SALTAR intro */
.skip-intro-btn {
    position: fixed;
    bottom: 48px;
    right: 48px;
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}
.skip-intro-btn.visible {
    opacity: 0.85;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .skip-intro-btn { bottom: 24px; right: 24px; }
}

/* Variante "Invitado" */
.card-label.is-muted-light { color: #fff; opacity: 0.4; }

/* Texto descriptivo de la tarjeta de invitado */
.guest-card-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn-core { width: 100%; margin-top: 10px; }

.btn-observer { border-style: dashed; margin-top: auto; }

/* --- FOOTER --- */
.official-footer {
    margin-top: 80px;
    font-family: var(--fuente-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 3px;
    z-index: 100;
}

/* --- INTRO + OUTRO ANIMATIONS --- */
.load-text-1 {
    font-family: var(--fuente-hud);
    color: var(--hud-cyan);
    letter-spacing: 15px;
    font-size: 3.5rem;
    font-weight: 700;
    opacity: 0;
    text-transform: uppercase;
    margin-bottom: 30px;
    text-shadow: 0 0 30px rgba(var(--hud-cyan-rgb), 0.3);
}

.load-bar-wrap {
    width: 700px;
    height: 6px;
    background: rgba(var(--hud-cyan-rgb), 0.1);
    border: var(--borde-cian);
    border-radius: var(--radio-sm);
    position: relative;
    overflow: hidden;
    opacity: 0;
    box-shadow: 0 0 20px rgba(var(--hud-cyan-rgb), 0.1);
}

.load-bar-fill {
    position: absolute;
    top: 0; left: 0; height: 100%;
    width: 0%;
    background: var(--hud-cyan);
    box-shadow: 0 0 15px var(--hud-cyan);
}

.bar-anim { animation: bar-fill 16.5s linear forwards; }
.fade-in-bar { animation: fade-in 0.5s forwards; }

@keyframes bar-fill { from { width: 0%; } to { width: 100%; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.load-text-2 {
    font-family: var(--fuente-hud);
    color: #fff;
    letter-spacing: 4px;
    font-size: 2.6rem;
    font-weight: 700;
    opacity: 0;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

.anim-1 { animation: anim-1 1.8s forwards; }
.anim-2 { animation: anim-2 1.8s forwards; }

@keyframes anim-1 {
    0% { opacity: 0; transform: translateY(30px); filter: blur(20px); }
    20% { opacity: 1; transform: translateY(0); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes anim-2 {
    0% { opacity: 0; transform: scale(0.8); filter: blur(30px) brightness(0); }
    30% { opacity: 1; transform: scale(1); filter: blur(0) brightness(1.5) drop-shadow(0 0 30px var(--hud-cyan)); }
    70% { opacity: 1; transform: scale(1); filter: brightness(1); }
    85% { opacity: 1; transform: scale(1.1); filter: brightness(2) blur(0); }
    100% { opacity: 0; transform: scale(4); filter: brightness(10) blur(20px); }
}

/* --- POST-LOGIN OUTRO --- */
.fade-blur-out {
    animation: fade-soft 0.85s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: opacity;
}
@keyframes fade-soft {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

.outro-veil {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(1, 4, 10, 0.55);
    backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}
.outro-veil.active { opacity: 1; pointer-events: auto; }

.pre-intro { opacity: 0; pointer-events: none; }
.reveal-in { animation: modules-fade 1.1s cubic-bezier(0.4,0,0.2,1) forwards; }

/* --- SPLASH inicial --- */
.splash {
    position: fixed; inset: 0; z-index: 200000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    cursor: pointer;
    transition: opacity 0.6s ease, filter 0.6s ease;
    user-select: none;
    overflow: hidden;
}
.splash.hide { opacity: 0; pointer-events: none; filter: blur(10px); }

.splash-inner { position: relative; text-align: center; z-index: 5; padding: 0 24px; }

.splash-tag-line {
    font-family: var(--fuente-mono);
    color: var(--hud-cyan);
    font-size: 0.78rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    opacity: 0;
    margin-bottom: 22px;
    animation: splash-line-in 0.9s 0.15s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.splash-title {
    font-family: var(--fuente-hud);
    font-size: 4.4rem;
    font-weight: 700;
    letter-spacing: -1px;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #fff, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
    opacity: 0;
    transform: translateY(20px);
    filter: blur(18px);
    animation: splash-title-in 1.4s 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
    position: relative;
}
.splash-title span {
    background: linear-gradient(to bottom, var(--hud-cyan), #006e75);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.splash-sub {
    font-family: var(--fuente-mono);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 14px;
    opacity: 0;
    animation: splash-line-in 0.9s 1.0s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.splash-line {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hud-cyan), transparent);
    margin: 28px auto 24px;
    box-shadow: 0 0 12px var(--hud-cyan);
    animation: splash-line-grow 1.0s 1.2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.splash-cta {
    display: inline-flex; align-items: center; gap: 14px;
    font-family: var(--fuente-mono);
    font-size: 0.85rem;
    letter-spacing: 4px;
    color: var(--hud-cyan);
    text-transform: uppercase;
    opacity: 0;
    animation: splash-cta-in 0.6s 1.5s cubic-bezier(0.2, 0.8, 0.3, 1) forwards, splash-pulse 2s 2.1s ease-in-out infinite;
}
.splash-dot {
    width: 10px; height: 10px;
    background: var(--hud-cyan);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--hud-cyan), 0 0 24px var(--hud-cyan);
    animation: splash-blink 1.2s infinite;
}

.splash-corner {
    position: absolute;
    width: 60px; height: 60px;
    border: 1px solid var(--hud-cyan);
    opacity: 0;
    animation: splash-corner-in 1.2s 0.2s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
.splash-corner.tl { top: 40px; left: 40px; border-right: none; border-bottom: none; }
.splash-corner.tr { top: 40px; right: 40px; border-left: none; border-bottom: none; }
.splash-corner.bl { bottom: 40px; left: 40px; border-right: none; border-top: none; }
.splash-corner.br { bottom: 40px; right: 40px; border-left: none; border-top: none; }

.splash:hover .splash-title { letter-spacing: 1px; }
.splash:hover .splash-corner { opacity: 1 !important; }

@keyframes splash-line-in {
    0%   { opacity: 0; transform: translateY(8px); letter-spacing: 12px; }
    100% { opacity: 0.8; transform: translateY(0); letter-spacing: 6px; }
}
@keyframes splash-title-in {
    0%   { opacity: 0; transform: translateY(20px); filter: blur(18px); letter-spacing: 30px; }
    60%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); letter-spacing: -1px; }
}
@keyframes splash-line-grow {
    0%   { width: 0; opacity: 0; }
    100% { width: 220px; opacity: 1; }
}
@keyframes splash-cta-in {
    0%   { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes splash-pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
@keyframes splash-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.85); } }
@keyframes splash-corner-in {
    0%   { opacity: 0; transform: scale(0.4); }
    100% { opacity: 0.55; transform: scale(1); }
}

/* ============================================================
   LOGIN RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    /* 2 cards lado a lado → 1 columna apilada */
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: min(94vw, 480px);
    }
    .tactical-card { padding: 32px 24px; }
    .card-header { margin-bottom: 24px; }
    .card-header h2 { font-size: 1.4rem; letter-spacing: 2px; }
    .main-logo-text { font-size: 2.8rem; }
    .branding-header { margin-bottom: 30px; }

    /* Splash inicial: tipografía y esquinas más pequeñas */
    .splash-title { font-size: 2.6rem; letter-spacing: 0; }
    .splash-tag-line { font-size: 0.65rem; letter-spacing: 3px; padding: 0 16px; }
    .splash-sub { font-size: 0.62rem; letter-spacing: 2px; padding: 0 16px; }
    .splash-cta { font-size: 0.7rem; letter-spacing: 2px; padding: 0 16px; }
    .splash-corner { width: 40px; height: 40px; }
    .splash-corner.tl, .splash-corner.tr { top: 20px; }
    .splash-corner.bl, .splash-corner.br { bottom: 20px; }
    .splash-corner.tl, .splash-corner.bl { left: 20px; }
    .splash-corner.tr, .splash-corner.br { right: 20px; }

    /* Intro cinemático: barra y textos más pequeños */
    .load-text-1 { font-size: 2rem; letter-spacing: 8px; padding: 0 20px; }
    .load-text-2 { font-size: 1.5rem; letter-spacing: 2px; padding: 0 20px; }
    .load-bar-wrap { width: 90vw; max-width: 480px; }

    .official-footer {
        margin-top: 24px;
        font-size: 0.6rem;
        letter-spacing: 2px;
        padding: 0 20px;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .main-logo-text { font-size: 2.2rem; }
    .tactical-card { padding: 24px 18px; }
    .card-header h2 { font-size: 1.2rem; letter-spacing: 1.5px; }
    .splash-title { font-size: 2rem; }
    .load-text-1 { font-size: 1.4rem; letter-spacing: 5px; }
    .load-text-2 { font-size: 1.1rem; }
}

/* El fondo (aurora y scanlines) vive en fondo.css, compartido con el tablero */

/* Botón mientras se valida el acceso: login2 le pone .is-busy (y disabled) */
.btn-core.is-busy { cursor: progress; opacity: 0.75; }
