/* users/static/css/modal_login.css */

/* === VARIABLES (para mantener consistencia) === */
:root {
    --navy-primary: #1a237e;
    --navy-light: #3949ab;
    --navy-transparent: rgba(26, 35, 126, 0.7);
    --error-red: #ff4d4d;
    --warning-yellow: #f1c40f;
    --success-green: #2ecc71;
    --gray-light: #f8fafc;
    --gray-border: #e2e8f0;
    --gray-text: #5a6b8a;
    --shadow-sm: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 20px 40px rgba(0, 0, 0, 0.15);
    --transition-default: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === CONTENEDOR PRINCIPAL === */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0; /* shorthand para top/left/right/bottom */
    background-color: rgba(10, 18, 51, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

/* === TARJETA PRINCIPAL === */
.modal-content {
    background: #ffffff;
    color: var(--navy-primary);
    width: 90%;
    max-width: 480px;
    border-radius: 16px; /* Ligeramente más redondeado */
    position: relative;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-default);
    animation: modalPopIn 0.4s ease forwards;
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

/* Animación de entrada mejorada */
@keyframes modalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* === LÍNEA AZUL SUPERIOR === */
.modal-header-line {
    height: 6px;
    background: linear-gradient(90deg, var(--navy-primary), var(--navy-light));
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* === BOTÓN DE CIERRE === */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--navy-primary);
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    transition: var(--transition-default);
    line-height: 1;
    background: transparent;
}

.close-modal:hover {
    color: var(--error-red);
    background-color: rgba(255, 77, 77, 0.1);
    transform: rotate(90deg);
}

/* === CONTENIDO INTERNO === */
.modal-body {
    padding: 2.5rem;
    padding-top: 3rem;
}

.modal-body h3 {
    font-size: 1.6rem; /* Un poco más grande */
    margin-bottom: 8px;
    color: var(--navy-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-body p {
    font-size: 0.95rem;
    color: var(--gray-text);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* === SPLASH DE ERROR MEJORADO === */
.error-splash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 2rem;
    border-radius: 16px;
    animation: splashFadeIn 0.3s ease;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.error-splash i {
    font-size: 5rem;
    margin-bottom: 20px;
    color: var(--error-red);
    animation: shakeX 0.5s ease;
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-splash p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--error-red);
    margin: 0;
    text-align: center;
    max-width: 280px;
}

/* === FORMULARIO === */
.modal-body form {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* === INPUTS MEJORADOS === */
.modal-body .input-field {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: var(--gray-light);
    color: var(--navy-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-default);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.modal-body .input-field:hover {
    background: #ffffff;
    border-color: var(--gray-border);
}

.modal-body .input-field:focus {
    border-color: var(--navy-primary);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.1);
    transform: translateY(-1px);
}

/* Placeholder styling */
.modal-body .input-field::placeholder {
    color: #a0b0c9;
    font-size: 0.9rem;
}

/* === MEDIDOR DE FUERZA MEJORADO === */
.strength-meter {
    width: 100%;
    background: var(--gray-border);
    height: 8px; /* Un poco más alto */
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.3s ease;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Clases dinámicas del meter con degradados suaves */
.strength-bar.weak { 
    width: 33%; 
    background: linear-gradient(90deg, #ff4d4d, #ff7070);
}
.strength-bar.medium { 
    width: 66%; 
    background: linear-gradient(90deg, #f1c40f, #f5d142);
}
.strength-bar.strong { 
    width: 100%; 
    background: linear-gradient(90deg, #2ecc71, #4eda8c);
}

#strength-text {
    font-size: 0.8rem;
    font-weight: 600;
    position: absolute;
    right: 0;
    top: -20px;
    color: var(--gray-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === BOTÓN GUARDAR MEJORADO === */
.modal-body .login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-light));
    color: #ffffff;
    font-weight: 600;
    border: none;
    padding: 16px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-default);
    font-size: 1rem;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.2);
}

/* Efecto de onda al hacer hover */
.modal-body .login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.modal-body .login-btn:hover {
    background: linear-gradient(135deg, var(--navy-light), var(--navy-primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 35, 126, 0.3);
}

.modal-body .login-btn:hover::before {
    width: 300px;
    height: 300px;
}

.modal-body .login-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(26, 35, 126, 0.2);
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .modal-body {
        padding: 2rem 1.5rem;
        padding-top: 2.5rem;
    }
    
    .modal-body h3 {
        font-size: 1.4rem;
    }
    
    .modal-body p {
        font-size: 0.9rem;
    }
    
    .close-modal {
        top: 12px;
        right: 16px;
    }
}

/* === ESTADOS DE CARGA (OPCIONAL) === */
.modal-body .login-btn.loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
    color: transparent;
}

.modal-body .login-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

/* === MEJORAS DE ACCESIBILIDAD === */
.modal-body .login-btn:focus-visible,
.close-modal:focus-visible,
.modal-body .input-field:focus-visible {
    outline: 3px solid rgba(26, 35, 126, 0.3);
    outline-offset: 2px;
}

/* Reducir animaciones si el usuario prefiere */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.message-box {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Color Rojo para errores */
.message-box.error {
    background-color: #ffe5e5;
    color: #d63031;
    border: 1px solid #ff7675;
}

/* Color Verde para éxito */
.message-box.success {
    background-color: #e3fcef;
    color: #00875a;
    border: 1px solid #abf5d1;
}

/* === ESTILOS PARA EL RESET MODAL (REEMPLAZO DE INLINE) === */
.modal-reset-container {
    display: none; 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(10, 18, 51, 0.8); 
    backdrop-filter: blur(4px);
    z-index: 3000; 
    align-items: center; 
    justify-content: center;
}

.modal-reset-card {
    background: white; 
    padding: 30px; 
    border-radius: 16px; 
    width: 340px; 
    position: relative;
    box-shadow: var(--shadow-md);
    animation: modalPopIn 0.3s ease;
}

.modal-reset-card h4 {
    margin-bottom: 20px; 
    color: var(--navy-primary); 
    font-family: 'Segoe UI', sans-serif;
    font-size: 1.4rem;
}

.close-reset {
    position: absolute; 
    right: 20px; 
    top: 15px; 
    cursor: pointer; 
    font-size: 24px;
    color: var(--gray-text);
}

.input-reset {
    width: 100%; 
    margin-bottom: 15px; 
    padding: 12px; 
    border: 2px solid var(--gray-border); 
    border-radius: 8px; 
    box-sizing: border-box;
    outline: none;
    transition: var(--transition-default);
}

.input-reset:focus {
    border-color: var(--navy-primary);
}

.btn-reset {
    width: 100%; 
    background: var(--navy-primary); 
    color: white; 
    border: none; 
    padding: 14px; 
    border-radius: 8px; 
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-default);
}

.btn-reset:hover {
    background: var(--navy-light);
    transform: translateY(-2px);
}

/* Estilo base para los mensajes */
.alert-box {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* Cuando el mensaje es de éxito (VERDE) */
.alert-box.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Cuando el mensaje es de error (ROJO) */
.alert-box.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}