/* ==========================================================================
   DISEÑO MODERNO Y CORPORATIVO PARA LOGIN
   ========================================================================== */
body {
    background-color: #f8fafc; /* Fondo general gris ultra claro */
    font-family: 'Nunito', sans-serif;
}

#auth {
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   LADO IZQUIERDO (Formulario)
   ========================================================================== */
#auth-left {
    padding: 3rem 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    background-color: #ffffff;
    position: relative;
    z-index: 10;
    box-shadow: 10px 0 30px rgba(0,0,0,0.03); /* Sombra suave hacia la imagen */
}

#auth-left .auth-logo {
    margin-bottom: 3rem;
    text-align: left;
}

#auth-left .auth-logo img {
    max-height: 100px; /* Evita que el logo sea gigante */
    width: auto;
}

#auth-left .auth-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1e293b; /* Color corporativo oscuro */
    margin-bottom: 0.5rem;
}

#auth-left .auth-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 2.5rem;
}

/* Campos de entrada (Inputs) modernos */
.form-control.form-control-xl {
    padding: 1rem 1rem 1rem 3.2rem;
    font-size: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #334155;
    transition: all 0.3s ease;
}

.form-control.form-control-xl:focus {
    background-color: #ffffff;
    border-color: #3b82f6; /* Borde azul al enfocar */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); /* Efecto halo/glow */
}

.form-control-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 1rem;
}

.form-control-icon i {
    color: #94a3b8;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

/* El icono cambia a azul cuando escribes */
.form-control:focus ~ .form-control-icon i {
    color: #3b82f6;
}

/* Botón principal */
#iniSesion {
    background-color: #2563eb;
    border-color: #2563eb;
    border-radius: 12px;
    padding: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
}

#iniSesion:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(37, 99, 235, 0.25) !important;
}

/* ==========================================================================
   LADO DERECHO (Imagen / Portada)
   ========================================================================== */
#auth-right {
    /* Agregamos un filtro superpuesto a la imagen para que se vea más premium */
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(37, 99, 235, 0.6) 100%), url('../../images/bg/4853433.jpg');
    background-size: cover;
    background-position: center;
    height: 100vh;
}

/* ==========================================================================
   RESPONSIVE (Tablets y Móviles)
   ========================================================================== */
@media screen and (max-width: 1199px) {
    #auth-left {
        padding: 3rem;
    }
}

@media screen and (max-width: 991px) {
    #auth {
        background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%); /* Fondo corporativo para móvil */
    }
    
    #auth-left {
        padding: 2rem 1.5rem;
        background-color: transparent;
        box-shadow: none;
        align-items: center; /* Centramos todo en móvil */
    }

    #auth-left .auth-logo {
        background: #ffffff;
        padding: 15px 25px;
        border-radius: 16px;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        margin-bottom: 2rem;
        text-align: center;
    }

    #auth-left .auth-title {
        color: #ffffff;
        text-align: center;
    }

    #auth-left .auth-subtitle {
        color: #cbd5e1;
        text-align: center;
        margin-bottom: 2rem;
    }

    /* Convertimos el formulario en una tarjeta blanca flotante */
    #sessionOK {
        background: #ffffff;
        padding: 2.5rem 2rem;
        border-radius: 20px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        width: 100%;
        max-width: 450px; /* Evita que sea muy ancho en tablets */
    }
}
/* ==========================================================================
   ANIMACIONES DE ENTRADA (ESTILO APP PREMIUM)
   ========================================================================== */

/* 1. Definición de los fotogramas clave (Keyframes) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes imageReveal {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 2. Aplicar las animaciones a los elementos */

/* La imagen de la derecha aparece y hace un ligero alejamiento (efecto elegante) */
#auth-right {
    animation: imageReveal 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Animación en cascada para el lado izquierdo */
#auth-left .auth-logo {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.1s forwards;
}

#auth-left .auth-title {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
}

#auth-left .auth-subtitle {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

/* Animando los campos del formulario uno por uno */
#sessionOK .form-group:nth-child(1) {
    opacity: 0;
    animation: fadeInRight 0.6s ease-out 0.4s forwards;
}

#sessionOK .form-group:nth-child(2) {
    opacity: 0;
    animation: fadeInRight 0.6s ease-out 0.5s forwards;
}

#iniSesion {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.6s forwards;
}

/* En móviles, animamos la tarjeta flotante completa */
@media screen and (max-width: 991px) {
    #sessionOK {
        opacity: 0;
        animation: fadeInUp 0.8s ease-out 0.4s forwards;
    }
    
    /* Quitamos la animación individual de los inputs en móvil para que la tarjeta suba completa */
    #sessionOK .form-group:nth-child(1),
    #sessionOK .form-group:nth-child(2),
    #iniSesion {
        opacity: 1;
        animation: none;
    }
}