/* 
 * ESTILOS DE LOGIN - CoworkingByVimod 
 * Estilos para la página de autenticación/login
 */

body { transition: background 0.4s ease, color 0.4s ease; }

/* Sobrescribir colores para la página de login usando RGB más oscuros y vivos */
:root {
    --bg-main: rgb(12, 16, 28);
    --bg-glass: rgba(18, 24, 40, 0.92);
}

.glass-bg {
    background: rgb(12, 16, 28) !important;
}

body.light-mode .glass-bg {
    background: rgb(240, 244, 248) !important;
}

/* Fix for buttons to use solid colors instead of gradients */
.auth-container .btn-primary {
    background: rgb(5, 45, 97) !important;
}

.auth-container .btn-primary:hover {
    background: rgb(3, 30, 65) !important;
}

.auth-container { 
    max-width: 480px; 
    margin: clamp(4rem, 10vh, 10rem) auto; 
    padding: 0 1.5rem; 
}

.auth-header { 
    text-align: center; 
    margin-bottom: 2.5rem; 
}

/* Notificaciones de Alerta */
.alert { 
    padding: 1rem; 
    border-radius: var(--radius-md); 
    margin-bottom: 1.5rem; 
    font-size: 0.9rem; 
    text-align: center; 
    border: 1px solid transparent; 
    display: none; 
}

.alert-error { 
    background: rgba(244, 63, 94, 0.1); 
    color: #fb7185; 
    border-color: rgba(244, 63, 94, 0.2); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
}

.alert-success { 
    background: rgba(16, 185, 129, 0.1); 
    color: #34d399; 
    border-color: rgba(16, 185, 129, 0.2); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
}

/* Controles de Formulario */
.form-input { 
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid var(--glass-border); 
    padding: 1rem 1.25rem; 
    border-radius: var(--radius-md); 
    color: var(--text-main); 
    width: 100%; 
    transition: var(--transition); 
}

.form-input:focus { 
    outline: none; 
    border-color: var(--primary); 
    background: rgba(255, 255, 255, 0.06); 
    box-shadow: 0 0 0 4px var(--primary-glow); 
}

.form-label { 
    display: block; 
    font-size: 0.85rem; 
    font-weight: 600; 
    margin-bottom: 0.6rem; 
    color: var(--text-muted); 
}

/* Sobrescrituras para Modo Claro */
body.light-mode .form-input { 
    background: rgb(255, 255, 255); 
    border-color: rgb(200, 210, 225); 
    color: rgb(15, 30, 55); 
}

/* Corrección para visibilidad de botones y texto en modo claro */
body.light-mode .btn-primary {
    background: rgb(5, 45, 97) !important;
    color: rgb(255, 255, 255) !important;
    border: 2px solid rgb(5, 45, 97) !important;
    box-shadow: 0 4px 12px rgba(5, 45, 97, 0.2) !important;
}

body.light-mode .btn-primary span,
body.light-mode .btn-primary i {
    color: rgb(255, 255, 255) !important;
}

body.light-mode .btn-primary:hover {
    background: rgb(3, 30, 65) !important;
    border-color: rgb(3, 30, 65) !important;
    box-shadow: 0 6px 16px rgba(5, 45, 97, 0.3) !important;
}

/* Fix for card border and shadow in light mode */
body.light-mode .auth-container .card {
    border-color: rgb(170, 185, 205) !important;
    box-shadow: 0 15px 50px rgba(5, 45, 97, 0.22) !important;
}

/* Aplicar paleta azul oscuro a otros elementos de texto en modo claro */
body.light-mode .form-label,
body.light-mode .auth-header h1,
body.light-mode .auth-header p,
body.light-mode .auth-container {
    color: rgb(15, 30, 55) !important;
}

/* Animación del Cargador */
.loader { 
    width: 20px; 
    height: 20px; 
    border: 2px solid rgba(255,255,255,0.3); 
    border-radius: 50%; 
    border-top-color: #fff; 
    animation: spin 0.8s linear infinite; 
    display: none; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

.btn-loading .loader { 
    display: inline-block; 
}

.btn-loading .btn-text { 
    display: none; 
}

/* Corrección para enlaces invisibles */
.auth-link {
    color: #60a5fa; /* bright blue */
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #93c5fd; /* lighter blue on hover */
}

body.light-mode .auth-link {
    color: var(--primary);
}

body.light-mode .auth-link:hover {
    color: var(--primary-light);
}

/* Corrección para el hover de la tarjeta cambiando el color a uno más oscuro */
.auth-container .card:hover {
    background: var(--bg-glass);
    border-color: var(--glass-border);
}

/* ── Responsive móvil + Safari iPhone ── */
@media (max-width: 600px) {
    .auth-container {
        margin: 3rem auto 0;
        padding: 0 1rem;
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }

    .auth-container .card {
        padding: 2rem 1.25rem !important;
        border-radius: 20px !important;
    }

    .auth-header h2 {
        font-size: 1.3rem !important;
    }

    .auth-header p {
        font-size: 0.85rem !important;
    }

    .form-input {
        font-size: 1rem;
        padding: 0.9rem 1rem;
    }

    .nav .btn-sm {
        padding: 0.45rem 0.85rem !important;
        font-size: 0.78rem !important;
    }

    /* Evitar que "¿Olvidaste tu contraseña?" se rompa en dos líneas */
    .form-group [style*="justify-content: space-between"] {
        flex-wrap: wrap;
        gap: 4px;
    }
}
