/* static/css/login_style.css */

/* 1. EL CONTENEDOR PRINCIPAL (Overlay) */
.login-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2. LA TARJETA (Namespace principal) */
/* Todo lo que estilicemos abajo dependerá de esta clase */
.card-header-fixed {
    padding: 20px 30px;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0; /* Una línea sutil separadora */
    flex-shrink: 0; /* Evita que se achique */
    position: relative; /* Para posicionar la X aquí dentro */
}
.card-header-fixed h2 {
    margin: 0; /* Quitamos márgenes extra */
    font-size: 1.5rem;
    text-align: center;
}
.card-body-scroll {
    padding: 30px;
    overflow-y: auto; /* AQUÍ ocurre el scroll solo de los inputs */
    flex-grow: 1; /* Ocupa todo el espacio restante */
}
.login-card {
    background: #ffffff;
    border-radius: 15px;
    width: 90%;
    max-width: 450px; /* Un poco más ancho para que respire */
    
    /* ESTO ES LO NUEVO: Limita la altura y activa Flexbox */
    max-height: 90vh; /* Nunca pasará del 90% de la altura de la pantalla */
    display: flex;
    flex-direction: column; /* Elementos uno debajo del otro */
    
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    z-index: 1001;
    overflow: hidden; /* Para que las esquinas redondeadas no se corten */
}

/* Títulos Específicos del Login */
.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-weight: 700;
}

/* Inputs Específicos del Login */
/* Usamos .login-card antes para no afectar otros forms de la web */
.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
}

.login-card .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background-color: #f9f9f9;
}

.login-card .form-control:focus {
    border-color: #ffd42d;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 212, 45, 0.2);
}

/* Botón de Login */
.login-card .btn-login {
    background-color: #ffd42d;
    color: #333;
    font-weight: bold;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.login-card .btn-login:hover {
    background-color: #e6be28;
}

/* Enlaces (Olvidaste contraseña / Registro) */
.login-card .forgot-password {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    text-decoration: none;
}

.login-card .forgot-password:hover {
    color: #333;
    text-decoration: underline;
}

.login-card .register-link {
    margin-top: 25px;
    text-align: center;
    font-size: 0.9rem;
}

.login-card .register-link a {
    color: #d4ac0d;
    font-weight: bold;
    text-decoration: none;
}

/* Botón de Cerrar (X) */
.login-card .btn-close {
    position: absolute;
    top: 50%;
    right: 20px;
    font-size: 2rem;
    color: #333;
    text-decoration: none;
    line-height: 1;
    transition: color 0.3s;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transform: translateY(-50%);
}

.login-card .btn-close:hover {
    color: #333;
    transform: translateY(-50%) scale(1.1);
}

/* Errores y Captcha */
.login-card .errorlist {
    color: #dc3545;
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: center;
}

.login-card .captcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    margin-top: 15px;
}