/* ==========================================================================
LOGIN.CSS - Página de Inicio de Sesión DNBLP (Optimizado para Móviles)
========================================================================== */

/* ==========================================================================
WRAPPER CON GRADIENTE INSTITUCIONAL
========================================================================== */
.auth-wrapper {
    min-height: 100vh;
    min-height: 100dvh; /* ✅ Unidad dinámica para móviles: evita problemas con la barra de navegación */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dnblp-teal) 0%, var(--dnblp-cyan) 50%, var(--dnblp-sage) 100%);
    padding: 20px;
    box-sizing: border-box;
}

.auth-container {
    width: 100%;
    max-width: 400px; /* ✅ Ligeramente más compacto para mejor proporción */
}

/* ==========================================================================
LOGO INSTITUCIONAL
========================================================================== */
.branding-header {
    text-align: center;
    margin-bottom: 24px;
}

.dnblp-logo {
    max-width: 240px;
    width: 100%;
    height: auto;
    display: inline-block;
    /* ✅ CLAVE: Hace que el fondo blanco de la imagen se vuelva transparente 
       y se fusione perfectamente con el gradiente de fondo */
    mix-blend-mode: multiply;
    /* Eliminamos cualquier drop-shadow que pueda marcar el recuadro */
}



/* ==========================================================================
TARJETA DE LOGIN
========================================================================== */
.auth-card {
    background: #ffffff;
    width: 100%;
    padding: 32px 28px;
    border-radius: var(--radius-xl);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    animation: fadeInModal 0.4s ease-out;
}

.auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 8px 0;
    text-align: center;
}

.auth-card .auth-description {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
    text-align: center;
    line-height: 1.5;
}

/* ==========================================================================
CAMPOS DEL FORMULARIO (Optimizados para Táctil)
========================================================================== */
.auth-field {
    margin-bottom: 20px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.auth-field input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px; /* ✅ CRÍTICO: Evita el zoom automático en iOS Safari al enfocar */
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    box-sizing: border-box;
    font-family: inherit;
    color: var(--gray-800);
    transition: all 0.2s ease;
    min-height: 48px; /* ✅ Área táctil recomendada por Apple/Google */
}

.auth-field input::placeholder {
    color: var(--gray-400);
}

.auth-field input:focus {
    outline: none;
    border-color: var(--dnblp-teal);
    box-shadow: 0 0 0 4px rgba(10, 102, 119, 0.1);
}

/* ==========================================================================
OPCIONES Y ENLACES
========================================================================== */
.auth-options {
    display: flex;
    justify-content: flex-end;
    margin: 8px 0 24px 0;
    font-size: 13px;
}

.auth-options a {
    color: var(--dnblp-teal);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0; /* ✅ Mejora el área de toque del enlace */
}

.auth-options a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* ==========================================================================
BOTÓN DE INGRESO
========================================================================== */
.btn-auth {
    width: 100%;
    padding: 14px 16px;
    background: var(--dnblp-teal);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 52px; /* ✅ Área táctil generosa */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(10, 102, 119, 0.2);
}

.btn-auth:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(10, 102, 119, 0.3);
}

.btn-auth:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(10, 102, 119, 0.2);
}

/* ==========================================================================
FOOTER DE LA TARJETA
========================================================================== */
.auth-footer-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
    color: var(--gray-600);
}

.auth-footer-link a {
    color: var(--dnblp-teal);
    text-decoration: none;
    font-weight: 700;
}

.auth-footer-link a:hover {
    text-decoration: underline;
}

/* ==========================================================================
ALERTAS
========================================================================== */
.alert {
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 13px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start; /* ✅ Mejor alineación si el texto es largo */
    gap: 10px;
    line-height: 1.4;
}

.alert-error {
    background-color: var(--error-light);
    border-left-color: var(--error);
    color: var(--error-dark);
}

.alert-success {
    background-color: var(--success-light);
    border-left-color: var(--success);
    color: var(--success-dark);
}

.alert-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================================================
FOOTER INFERIOR GLOBAL
========================================================================== */
.auth-bottom-footer {
    text-align: center;
    margin-top: 24px;
    padding: 0 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ==========================================================================
RESPONSIVE: MÓVILES PEQUEÑOS (Hasta 400px)
========================================================================== */
@media (max-width: 400px) {
    .auth-wrapper {
        padding: 16px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
    }

    /* Ajuste del logo para móviles: más pequeño pero manteniendo la fusión */
    .dnblp-logo {
        max-width: 180px;
        margin-bottom: 8px;
        /* mix-blend-mode: multiply se hereda, así que sigue funcionando perfecto */
    }

    .auth-card h2 {
        font-size: 20px;
    }

    .auth-card .auth-description {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .auth-field input {
        padding: 10px 12px;
        font-size: 16px; /* Mantener 16px sí o sí para evitar zoom en iOS */
    }

    .btn-auth {
        padding: 12px 16px;
        font-size: 15px;
        min-height: 48px;
    }

    .auth-bottom-footer {
        font-size: 11px;
        margin-top: 16px;
    }
}

/* ==========================================================================
ANIMACIÓN DE ENTRADA
========================================================================== */
@keyframes fadeInModal {
    from { 
        opacity: 0; 
        transform: translateY(15px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}