/* 
   SISTEMA DE DISEÑO DE AUTENTICACIÓN - NORTHWIPE 
   Define los tokens visuales para el portal de acceso y registro.
*/
:root {
    --auth-bg-overlay: rgba(15, 23, 42, 0.7);
    --auth-card-bg: rgba(255, 255, 255, 0.85);
    --auth-primary: #3b82f6;
    --auth-primary-hover: #2563eb;
    --auth-text: #1e293b;
    --auth-text-muted: #64748b;
}

/* RESET GLOBAL: Asegura consistencia en el box-model en todos los navegadores */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: auto; /* Permite el scroll en formularios largos (especialmente en móviles) */
}

/* CONTENEDOR PRINCIPAL: Imagen de fondo a pantalla completa con paralaje */
.auth-wrapper {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../img/fondo_northwipe.png') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    padding: 40px 20px; /* Espacio para el scroll en dispositivos pequeños */
}

/* CAPA DE SUPERPOSICIÓN: Graduado oscuro que mejora la legibilidad del texto */
.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--auth-bg-overlay) 0%, rgba(15, 23, 42, 0.6) 100%);
    position: fixed; /* Mantiene el overlay fijo durante el desplazamiento */
}

/* CONTENEDOR DE LA TARJETA: Ajusta el ancho máximo y la perspectiva 3D */
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 550px; /* Aumentado para acomodar mejor el grid de registro */
    padding: 0;
    perspective: 1000px;
}

/* TARJETA GLASSMORPISM: Fondo semi-translúcido con desenfoque de fondo */
.auth-card {
    background: var(--auth-card-bg);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--auth-text);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.auth-logo span {
    color: var(--auth-primary);
}

.auth-subtitle {
    color: var(--auth-text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-muted);
}

/* CONTROLES DE FORMULARIO: Estilos para los campos de entrada de texto */
.form-control {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.875rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text-muted);
    cursor: pointer;
}

.forgot-password {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

/* BOTÓN DE ACCIÓN PRINCIPAL: Estilo premium con efectos de elevación y hover */
.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--auth-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-auth:hover {
    background: var(--auth-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.auth-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
}

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}

/* ANIMACIONES Y ALTERNANCIA DE FORMULARIOS */
#register-form {
    display: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* MICRO-INTERACCIONES: Botones sociales y divisores visuales */
.social-login {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.social-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--auth-text-muted);
    font-size: 0.8rem;
}

/* SEPARADOR VISUAL: Línea divisoria para secciones alternativas (como login social) */
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.divider:not(:empty)::before { margin-right: 1em; }
.divider:not(:empty)::after { margin-left: 1em; }

/* --- DISEÑO ADAPTATIVO (RESPONSIVE) --- */
@media (max-width: 600px) {
    .auth-wrapper {
        padding: 20px 12px;
        align-items: flex-start;
    }

    .auth-container {
        max-width: 100%;
    }

    .auth-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .auth-header { margin-bottom: 22px; }
    .auth-logo { font-size: 1.6rem; }
    .auth-subtitle { font-size: 0.85rem; }

    .form-group { margin-bottom: 14px; }
    .form-control {
        padding: 11px 14px 11px 44px;
        font-size: 0.95rem;
    }
    .input-wrapper i { left: 14px; }

    /* Colapsar grids inline 2-columnas a 1 columna en móvil */
    .auth-card form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 18px;
    }

    .btn-auth {
        padding: 13px;
        font-size: 0.95rem;
    }

    .social-login { gap: 8px; margin-top: 18px; }

    .modal-card {
        border-radius: 18px;
        max-height: 92vh;
    }
    .modal-header { padding: 18px; }
    .modal-header h3 { font-size: 1.05rem; }
    .modal-body {
        padding: 20px 18px;
        font-size: 0.9rem;
    }
    .modal-body h4 { font-size: 1rem; margin: 18px 0 8px; }
    .modal-footer { padding: 14px 18px; }
}

@media (max-width: 380px) {
    .auth-card { padding: 20px 14px; }
    .auth-logo { font-size: 1.4rem; }
}
