/* =============================================
   HELP IT - Security Operations Center Login
   Dark Theme for Command Center Interface
   ============================================= */

:root {
    --bg-base: #0F0F0F;
    /* Azul Navy Oscuro */
    --bg-surface: #1e1e1e;
    --bg-elevated: #ffffff;
    /* Fondo blanco para inputs */
    --bg-overlay: #2b2b2b;
    --border-default: #d1d5db;
    --text-primary: #ffffff;
    --text-input: #1f2937;
    /* Texto oscuro para inputs */
    --text-secondary: #4b5563;
    /* Placeholder gris oscuro */
    --accent-blue: #00d4ff;
    /* Celeste */
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    height: 100%;
    width: 100%;
    font-family: var(--font-body);
    overflow: hidden;
    background: var(--bg-base);
}

/* === LAYOUT PRINCIPAL === */
.split-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

.split-left {
    width: 40%;
    height: 100%;
    background-color: var(--bg-base);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
    position: relative;
    z-index: 20;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

/* Scanline / grid texture overlay for command center feel */
.split-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        /* Horizontal scanlines */
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(59, 130, 246, 0.015) 2px,
            rgba(59, 130, 246, 0.015) 4px),
        /* Vertical grid lines */
        repeating-linear-gradient(90deg,
            transparent,
            transparent 60px,
            rgba(59, 130, 246, 0.03) 60px,
            rgba(59, 130, 246, 0.03) 61px),
        /* Horizontal grid lines */
        repeating-linear-gradient(0deg,
            transparent,
            transparent 60px,
            rgba(59, 130, 246, 0.03) 60px,
            rgba(59, 130, 246, 0.03) 61px);
}

/* Subtle vignette on the left panel */
.split-left::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center,
            transparent 50%,
            rgba(0, 0, 0, 0.3) 100%);
}

.content-wrapper {
    padding: 2rem;
    max-width: 100%;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.split-right {
    width: 60%;
    height: 100%;
    background-color: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

.overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            rgba(11, 18, 46, 0.85) 0%,
            rgba(11, 18, 46, 0.45) 50%,
            rgba(11, 18, 46, 0.75) 100%);
    z-index: 10;
}

/* CARRUSEL */
.slideshow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: kenBurns 16s ease-in-out infinite;
    will-change: opacity, transform;
}

/* Capa base: siempre opaca, para que el fundido nunca deje ver el fondo. */
.slide:nth-child(1) {
    opacity: 1;
}

/* Capa superior: aparece y desaparece sobre la capa base. */
.slide:nth-child(2) {
    opacity: 0;
    animation: kenBurns 16s ease-in-out infinite,
               crossFade 16s ease-in-out infinite;
}

/* === LOGO Y TEXTOS === */
.logo-box {
    margin-top: -1.35rem;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.6));
    width: min(100%, calc(680px * var(--ui-scale)));
    display: flex;
    justify-content: center;
    align-items: center;
}

.landing-logo {
    width: clamp(300px, 65%, calc(550px * var(--ui-scale)));
    height: auto;
    display: block;
    margin: 0 auto;
    animation: floatLogo 6s ease-in-out infinite;
}

.buho-logo {
    width: min(112%, calc(650px * var(--ui-scale)));
    max-height: calc(190px * var(--ui-scale));
    object-fit: contain;
}

/* margin: top | horizontal | bottom — siempre con unidad (px, rem). Cuatro valores máx. */
.logo-separator {
    width: clamp(300px, 85%, calc(550px * var(--ui-scale)));
    height: calc(4px * var(--ui-scale));
    background: linear-gradient(90deg,
        transparent 0%,
        rgb(27, 40, 76) 20%,
        rgb(27, 40, 76) 80%,
        transparent 100%);
    border-radius: 2px;
    margin: 0 auto 1.45rem auto;
    box-shadow: 0 2px 15px rgba(249, 115, 22, 0.35),
        0 0 30px rgba(249, 115, 22, 0.1);
}

.text-box {
    margin-bottom: 2rem;
}

/* NIVEL 1 (PRINCIPAL) */
.main-title {
    color: var(--accent-orange);
    /* Naranja */
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}

/* NIVEL 2 (SECUNDARIO) */
.brand-title {
    color: var(--accent-blue);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    opacity: 0.95;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* NIVEL 3 (INFORMATIVO) */
.subtitle {
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    font-weight: 300;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

/* === AREA DE ACCION (FORMULARIO) === */
.action-box {
    width: 100%;
    max-width: calc(350px * var(--ui-scale));
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 1. BOTON MODO ADMIN */
.admin-toggle-wrapper {
    margin-bottom: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-admin-ghost {
    background: transparent !important;
    border: none !important;
    color: rgba(139, 148, 158, 0.6);
    padding: 8px 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    outline: none;
}

.btn-admin-ghost:hover {
    color: var(--accent-orange);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

/* 2. CAMPOS DE ADMIN */
.admin-fields {
    width: 100%;
    margin-bottom: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Flash / validation messages */
.mensaje-rojo {
    color: var(--accent-red);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.mensaje-amarillo {
    color: #fbbf24;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

/* Flash messages container */
.flash-wrapper .alert {
    background: rgba(249, 115, 22, 0.15) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 8px !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* =========================================
   ESTILO DE INPUTS (Dark Elevated)
   ========================================= */
.input-group {
    position: relative;
    width: 100%;
    transition: all 0.3s ease;
}

.landing-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-default);
    padding: calc(14px * var(--ui-scale)) calc(15px * var(--ui-scale)) calc(14px * var(--ui-scale)) calc(50px * var(--ui-scale));
    border-radius: 8px;
    color: var(--text-input);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Color del texto de ayuda (placeholder) */
.landing-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.input-icon {
    position: absolute;
    left: calc(18px * var(--ui-scale));
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    z-index: 2;
    transition: all 0.3s ease;
    opacity: 0.8;
}

/* === ESTADOS INTERACTIVOS (HOVER Y FOCUS) === */

/* 1. HOVER (Pasar el mouse) */
.input-group:hover .landing-input {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--bg-overlay);
}

.input-group:hover .input-icon {
    opacity: 1;
}

/* 2. FOCUS (Escribiendo) */
.input-group:focus-within .landing-input {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

.input-group:focus-within .input-icon {
    color: var(--accent-orange);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Autofill override for white background */
.landing-input:-webkit-autofill,
.landing-input:-webkit-autofill:hover,
.landing-input:-webkit-autofill:focus,
.landing-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: var(--text-input) !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--text-input);
}

/* 3. BOTON AZUL CON ESTADO PRESIONADO */
.btn-start {
    cursor: pointer;
    border: none;
    width: 100%;
    background: linear-gradient(135deg,
            #1170b8 0%,
            #0b5f9f 100%);
    color: #fff;
    padding: calc(14px * var(--ui-scale)) 0;
    border-radius: 50px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(17, 112, 184, 0.32),
        0 0 30px rgba(17, 112, 184, 0.14);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(10px * var(--ui-scale));
    position: relative;
    overflow: hidden;
}

.btn-start::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-start:hover {
    background: linear-gradient(135deg,
            #0d63a5 0%,
            #084f86 100%);
    color: #fff;
    transform: translateY(1px);
    box-shadow: inset 0 3px 8px rgba(3, 31, 58, 0.35),
        0 3px 12px rgba(17, 112, 184, 0.22);
}

.btn-start:hover::before {
    opacity: 1;
}

.btn-start:active {
    background: linear-gradient(135deg,
            #084f86 0%,
            #063d68 100%);
    transform: translateY(2px);
    box-shadow: inset 0 4px 10px rgba(3, 31, 58, 0.48);
}

/* Footer */
.left-footer {
    position: absolute;
    bottom: 0;
    font-size: 0.75rem;
    opacity: 0.35;
    width: 100%;
    color: #d3d3d3;
    z-index: 1;
}

/* === ANIMATIONS === */
@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Ciclo de 16s: 7,6s de imagen fija + 0,4s de fundido, por cada imagen.
   El fundido es corto a propósito: al ser la misma fachada de día y de noche,
   un cruce largo se lee como una doble exposición fantasma. */
@keyframes crossFade {

    0%,
    47.5% {
        opacity: 0;
    }

    50%,
    97.5% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Zoom lento compartido por ambas capas: sincronizado, para que el
   fundido no arrastre la imagen, y simétrico, para que no salte al reiniciar. */
@keyframes kenBurns {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.fade-in-down {
    animation: fadeInDown 1s ease-out forwards;
    opacity: 0;
}

.fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.3s;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .split-container {
        flex-direction: column;
    }

    .split-right {
        display: none;
    }

    .split-left {
        width: 100%;
        height: 100vh;
        box-shadow: none;
    }

    .logo-separator,
    .landing-logo {
        width: clamp(250px, 70%, 500px);
    }

    .buho-logo {
        width: min(100%, 560px);
        max-height: 165px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slide {
        animation: none;
    }

    .slide:nth-child(2) {
        animation: none;
    }
}
