/* auth-modal.css - Scoped to avoid conflicts with index.html sidebar */

/* Fondo oscuro overlay (Backdrop) - SOLO para el modal inyectado */
#auth-guard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    /* Fondo semitransparente oscuro */
    backdrop-filter: blur(5px);
    /* Efecto de desenfoque */
    z-index: 9999;
    /* Por encima de todo */
    display: none;
    /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Contenedores de las tarjetas (Welcome y Login) */
/* Usamos selectores descendientes del ID para asegurar especificidad */
#auth-guard-modal .auth-welcome-container,
#auth-guard-modal .auth-login-container {
    background-color: #ffffff;
    width: 100%;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Títulos y Subtítulos */
#auth-guard-modal h2,
#auth-guard-modal h3 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 700;
}

#auth-guard-modal .auth-subtitle {
    color: #666;
    margin-top: 5px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Botones Principales */
#auth-guard-modal .btn-auth-primary,
#auth-guard-modal #btnLogin {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    background-color: #3483fa;
    color: white;
}

#auth-guard-modal .btn-auth-primary:hover,
#auth-guard-modal #btnLogin:hover {
    background-color: #2968c8;
}

#auth-guard-modal .btn-auth-primary:active,
#auth-guard-modal #btnLogin:active {
    transform: scale(0.98);
}

/* Wrapper de la sección de botones en Welcome */
#auth-guard-modal .auth-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Divisor "¿Ya tienes cuenta?" */
#auth-guard-modal .auth-divider-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.9rem;
    color: #666;
}

/* Link Button (Ingresar) */
#auth-guard-modal .btn-auth-link {
    background: none;
    border: none;
    color: #3483fa;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
}

#auth-guard-modal .btn-auth-link:hover {
    text-decoration: underline;
}

/* Header del Formulario de Login */
#auth-guard-modal .login-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#auth-guard-modal .login-header h3 {
    text-align: left;
    font-size: 1.1rem;
    flex: 1;
}

#auth-guard-modal .btn-icon-back {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #333;
    padding: 5px;
}

#auth-guard-modal .btn-icon-back:hover {
    color: #3483fa;
}

/* Inputs del Formulario */
#auth-guard-modal .auth-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

#auth-guard-modal .input-label {
    font-size: 0.85rem;
    color: #444;
    font-weight: 500;
    margin-bottom: -5px;
}

#auth-guard-modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    /* Importante para inputs */
}

#auth-guard-modal input:focus {
    border-color: #3483fa;
}

/* Divisor "o" */
#auth-guard-modal .divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 10px 0;
    color: #999;
    font-size: 0.85rem;
}

#auth-guard-modal .divider::before,
#auth-guard-modal .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #eee;
}

#auth-guard-modal .divider::before {
    margin-right: .5em;
}

#auth-guard-modal .divider::after {
    margin-left: .5em;
}

/* Botón Google */
#auth-guard-modal .google-btn {
    background-color: white;
    color: #333;
    border: 1px solid #ddd;
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s;
}

#auth-guard-modal .google-btn:hover {
    background-color: #f5f5f5;
}

#auth-guard-modal .google-btn::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background: url('https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg') no-repeat center center;
    background-size: contain;
}

/* Botón Crear Cuenta (formulario login) */
#auth-guard-modal .btn-text-only {
    background: none;
    border: none;
    color: #3483fa;
    margin-top: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

#auth-guard-modal .btn-text-only:hover {
    text-decoration: underline;
}

/* Mensaje de error/éxito */
#auth-guard-modal #mensajeAuth {
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 1.2em;
}