/* ============================================= */
/* ==   NUEVO CSS MODERNO - POP-UP DE LOGIN   == */
/* ============================================= */

/* === Variables Globales (¡Personaliza fácil!) === */
:root {
    --login-primary-color: #007bff; /* Color de acento para botones y enlaces */
    --login-background: #ffffff;
    --login-text-color: #212529;
    --login-text-light: #6c757d;
    --login-border-color: #dee2e6;
    --login-font: 'Segoe UI', system-ui, sans-serif;
}

/* === Overlay (Fondo oscuro) === */
.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* No se puede hacer clic hasta que esté activo */
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ========================================= */
/* === ESTILOS BASE (MOBILE-FIRST) === */
/* ========================================= */

.popup-container {
    position: fixed;
    z-index: 1001;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 90vh;
    background-color: var(--login-background);
    font-family: var(--login-font);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;

    /* --- CAMBIOS CLAVE AQUÍ --- */
    opacity: 0; /* Totalmente invisible por defecto */
    pointer-events: none; /* No se puede interactuar con él cuando está oculto */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
}

.popup-container.active {
    opacity: 1; /* Se hace visible */
    pointer-events: all; /* Se puede interactuar */
    transform: translateY(0);
}

.popup-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Scroll si el contenido es mucho */
}

/* --- Botón de Cerrar --- */
#close-menu-log {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--login-border-color);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    color: var(--login-text-light);
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s, color 0.2s;
}

#close-menu-log:hover {
    background-color: #e9ecef;
    color: var(--login-text-color);
}


/* --- El lugar agradable para la imagen (Móvil) --- */
.illustration-column {
    order: -1; /* Mueve la imagen al principio */
    width: 100%;
    height: 180px; /* Una altura fija para el banner de imagen */
}

.login-illustration {
    width: 100%;
    height: 100%;
    object-fit: cover; /* La imagen cubre el área sin deformarse */
}

/* --- Formulario (Móvil) --- */
.login-form-column {
    padding: 24px;
    text-align: center;
}

.login-form-column h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--login-text-color);
    margin: 0 0 8px 0;
}

.login-form-column .subtitle {
    font-size: 1rem;
    color: var(--login-text-light);
    margin-bottom: 24px;
}

/* --- Botones Sociales (Móvil) --- */
.social-login-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-social {
    padding: 14px;
    border: 1px solid var(--login-border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background-color: transparent;
}

.btn-social i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.btn-social:hover {
    border-color: var(--login-primary-color);
    color: var(--login-primary-color);
}

/* ============================================ */
/* === VISTA DE ESCRITORIO (NO MÓVIL) === */
/* ============================================ */

@media (min-width: 768px) {

    /* --- Contenedor del Pop-up (Desktop) --- */
    .popup-container {
        /* Lo volvemos a centrar en la pantalla */
        top: 50%;
        left: 50%;
        bottom: auto; /* Reseteamos 'bottom' */
        width: 800px;
        max-height: 550px;
        border-radius: 12px; /* Bordes redondeados por todos lados */
        
        /* Animación de entrada con zoom y fade */
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .popup-container.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .popup-content {
        flex-direction: row; /* Columnas una al lado de la otra */
    }

    /* --- La imagen (Desktop) --- */
    .illustration-column {
        order: 0; /* Vuelve a su orden natural */
        flex: 1; /* Ocupa la mitad del espacio */
        height: auto;
    }

    .login-illustration {
        object-fit: cover;
    }

    /* --- Formulario (Desktop) --- */
    .login-form-column {
        flex: 1; /* Ocupa la otra mitad */
        padding: 40px;
        text-align: left;
    }

    /* --- Botones Sociales (Desktop) --- */
    .social-login-options {
        flex-direction: row; /* Botones uno al lado del otro */
    }
}