/* =========================================
   1. VARIABLES Y FUENTES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1e3a8a;
    /* Azul oscuro institucional */
    --primary-hover: #1e40af;
    /* Azul un poco más claro para hover */
    --accent-color: #3b82f6;
    /* Azul brillante para detalles */
    --text-main: #1e293b;
    /* Texto oscuro */
    --text-secondary: #64748b;
    /* Texto gris */
    --bg-input: #f8fafc;
    /* Fondo de inputs */
    --border-color: #e2e8f0;
    /* Bordes suaves */
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    position: relative;
    overflow: hidden;
    /* Evita scrollbars innecesarios */
}

/* =========================================
   2. FONDO DECORATIVO
   ========================================= */
.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Degradado elegante de azul */
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    /* Forma curva en la parte inferior (opcional, para estilo moderno) */
    clip-path: polygon(0 0, 100% 0, 100% 60%, 0 100%);
}

/* =========================================
   3. TARJETA DE LOGIN
   ========================================= */
.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    margin: 0 15px;
    /* Margen para móviles */
    position: relative;
}

/* LOGO */
.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-container img {
    max-width: 140px;
    height: auto;
    display: inline-block;
}

/* TEXTO DE BIENVENIDA */
.welcome-text {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-text h2 {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

/* =========================================
   4. FORMULARIO E INPUTS
   ========================================= */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
}

/* Iconos dentro del input (Material Icons) */
.input-field .material-icons-round {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 1.3rem;
    pointer-events: none;
    /* Permite hacer clic a través del icono */
    transition: color 0.3s ease;
}

.input-field input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    /* Padding izquierdo para dejar espacio al icono */
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    outline: none;
}

.input-field input::placeholder {
    color: #cbd5e1;
}

/* Efectos al hacer click (Focus) */
.input-field input:focus {
    border-color: var(--accent-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field input:focus+.material-icons-round,
.input-field:focus-within .material-icons-round {
    color: var(--accent-color);
}

/* =========================================
   5. BOTONES Y ENLACES
   ========================================= */
.btn-login {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(30, 58, 138, 0.2);
}

.btn-login:hover {
    background-color: var(--primary-hover);
}

.btn-login:active {
    transform: scale(0.98);
}

.recovery-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.recovery-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* =========================================
   6. MENSAJES DE ALERTA (Dinámicos PHP)
   ========================================= */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* =========================================
   7. FOOTER
   ========================================= */
.footer {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.5rem;
}

.footer p {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* =========================================
   8. RESPONSIVE (Móvil)
   ========================================= */
@media (max-width: 480px) {
    .background-overlay {
        clip-path: none;
        /* Fondo plano en móviles */
        height: 100%;
        background: #f1f5f9;
        /* Quitar degradado fuerte en móvil para legibilidad */
    }

    .login-card {
        box-shadow: none;
        padding: 20px;
        background: transparent;
    }

    .welcome-text h2 {
        font-size: 1.5rem;
    }
}