/* --- Variables y Estilos Globales --- */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --background-card: rgba(255, 255, 255, 0.98); /* Fondo de la tarjeta ligeramente traslúcido */
    --text-light: #f8f9fa;
    --text-dark: #343a40;
    --error-color: #dc3545;
    --border-color: #ced4da;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
}

/* --- Contenedor principal que ocupa toda la pantalla --- */
.login-container {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    display: flex;
    justify-content: center; /* Centra horizontalmente */
    align-items: center;   /* Centra verticalmente */
    width: 100%;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    padding: 1rem;
    box-sizing: border-box;
}

/* --- LA TARJETA DEL LOGIN (El recuadro en medio) --- */
.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--background-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    backdrop-filter: blur(5px); /* Efecto "cristal" que desenfoca el fondo detrás de la tarjeta */
    
    /* ¡AQUÍ ESTÁ LA ANIMACIÓN DE ENTRADA! */
    animation: slideUp 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Encabezado de la tarjeta --- */
.login-header {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 2rem;
    text-align: center;
}

.login-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.login-header p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}

/* --- Formulario y sus campos --- */
.login-form {
    padding: 2rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    transition: color 0.3s;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.input-group input:focus + .input-icon {
    color: var(--primary-color);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Botón de Login con Animación --- */
.btn-login {
    width: 100%;
    padding: 1rem;
    border: none;
    background: var(--primary-color);
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px); /* Efecto de "levantarse" */
}

/* --- Mensaje de Error y Pie de página --- */
.error-message {
    color: var(--error-color);
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* --- Responsividad para celulares --- */
@media (max-width: 480px) {
    .login-header {
        padding: 1.5rem;
    }
    .login-header h1 {
        font-size: 1.5rem;
    }
    .login-form {
        padding: 1.5rem;
    }
}