@charset "UTF-8";

/* ===================================================
   VARIABLES DE DISEÑO (PALETA DE AZULES)
   =================================================== */
:root {
    --blue-dark: #002f5e;
    --blue-main: #0080ff;
    --blue-glow: rgba(0, 128, 255, 0.2);
    --bg-input: #f4f4f4;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================
   RESET & ESTILOS GLOBALES
   =================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    color: #ffffff; 
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--blue-main);
}

a:visited {
    color: #ffffff8a;
}

body {
    min-height: 100vh;
    background: linear-gradient(180deg, #ffffff, #e6e6e6);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
}

/* ===================================================
   HEADER (BARRA SUPERIOR)
   =================================================== */
header {
    position: sticky;
    top: 0;
    width: 100%;
    height: 7vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-main));
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.himg {
    width: 4rem;
    height: auto;
}

/* ===================================================
   ESTRUCTURA PRINCIPAL (PANEL IZQUIERDO Y DERECHO)
   =================================================== */
.fsection {
    display: flex;
    align-items: center;
    min-height: 93vh;
}

.left-wside {
    display: grid;
    place-items: center;
    flex: 0.7; 
    height: 93vh;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-main));
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    padding: 1rem;
}

.center-welcome-text {
    display: grid;
    place-items: center;
    text-align: center;
    gap: 20px;
}

.span-welcome {
    font-family: 'Lucida Sans', Geneva, Verdana, sans-serif;
    font-size: 2.8rem;
    font-weight: bold;
    text-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
}

.aside-img {
    height: 22rem;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.2));
}

/* ===================================================
   FORMULARIO DE LOGIN
   =================================================== */
.login-form {
    flex: 1.3;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333333;
    padding: 2rem;
}

#form-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.brand-name {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--blue-dark);
    margin-bottom: 0.5rem;
}

.welcome-back {
    font-size: 1.1rem;
    color: #666666;
    margin-bottom: 3rem; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px; 
    width: 100%;
}

/* ===================================================
   INPUTS CON ANIMACIÓN DE ELEVACIÓN
   =================================================== */
.text-input {
    border: 1.5px solid #ccccccc0;
    border-radius: 8px;
    background: var(--bg-input);
    padding: 0 12px;
    display: flex;
    width: 100%;
    max-width: 320px;
    transition: var(--transition-smooth);
}

.text-input legend.text {
    font-size: 0.75rem;
    color: #777777;
    font-weight: 700;
    padding: 0 6px;
    background: transparent;
    margin-left: 8px;
    text-align: left;
    transition: var(--transition-smooth);
}

.text-input input.text {
    border: none !important;
    background: transparent !important;
    padding: 12px 0;
    width: 100%;
    font-size: 0.9rem;
    color: #222222;
    outline: none;
}

/* Animación interactiva al hacer foco */
.text-input:focus-within {
    border-color: var(--blue-main);
    background: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 8px 22px var(--blue-glow);
}

.text-input:focus-within legend.text {
    color: var(--blue-main);
}

/* ===================================================
   BOTÓN Y CONTENEDOR DE ANCLAJE
   =================================================== */
.login-container-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 10px; 
    position: relative;
    margin-bottom: 50px; 
}

#login-button {
    width: 100%;
    max-width: 320px;
    padding: 14px;
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-main));
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 47, 94, 0.2);
    transition: var(--transition-smooth);
}

#login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 128, 255, 0.35);
}

#login-button:active {
    transform: translateY(1px);
}

#login-button:disabled {
    background: #cccccc;
    color: #888888;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

#resultado {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px; 
}

/* ===================================================
   VISTA MINIMALISTA DE SEGURIDAD (CUENTA ATRÁS)
   =================================================== */
.alerta-bloqueo {
    color: #2d3748; 
    padding: 14px 0;
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    border-top: 1px solid #e2e8f0; 
    border-bottom: 1px solid #e2e8f0; 
    letter-spacing: 0.5px;
    width: 100%;
    max-width: 320px; /* Centrado y acoplado al tamaño del botón */
}

.cuenta-atras {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    color: var(--blue-dark); /* Reutiliza tu azul oscuro corporativo de forma sutil */
    padding: 0 3px;
    font-size: 0.95rem;
}

.alerta-expirada {
    color: #718096;
    padding: 14px 0;
    margin-top: 15px;
    font-size: 0.85rem;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    letter-spacing: 0.5px;
    width: 100%;
    max-width: 320px;
    opacity: 0.8;
}

/* ===================================================
   LOADER EN POSICIÓN ABSOLUTA HOLGADA
   =================================================== */
.spinner {
    display: none; 
    position: absolute;
    top: calc(100% + 16px); 
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 12px;
    z-index: 10;
}

.dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--blue-main);
    border-radius: 50%;
    animation: puntosFlotando 0.6s infinite alternate;
}

.dot1 { left: 0; animation-delay: 0s; }
.dot2 { left: 18px; animation-delay: 0.2s; }
.dot3 { left: 36px; animation-delay: 0.4s; }

@keyframes puntosFlotando {
    0% { transform: translateY(0); opacity: 0.3; }
    100% { transform: translateY(-6px); opacity: 1; }
}

/* Estados de error */
.spinner.error .dot {
    animation-play-state: paused; 
    background-color: #ff3333; 
}

/* ===================================================
   RESPONSIVE (ADAPTACIÓN A MÓVILES)
   =================================================== */
@media (max-width: 769px) {
    header {
        height: auto;
        padding: 15px 20px;
    }

    .fsection {
        flex-direction: column;
        min-height: auto;
    }

    .left-wside {
        width: 100%;
        height: auto;
        padding: 3rem 1.5rem;
        flex: none;
    }

    .span-welcome {
        font-size: 2.2rem;
    }

    .aside-img {
        height: 14rem;
    }

    .login-form {
        width: 100%;
        padding: 3.5rem 1.5rem;
        flex: none;
    }

    #form-login {
        width: 100%;
        max-width: 320px; 
    }

    .text-input, #login-button, .alerta-bloqueo, .alerta-expirada {
        width: 100%;
        max-width: 100%;
    }
}