/* Contenedor de autenticación */
.auth-container {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.85) 100%);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.auth-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(var(--primary-rgb), 0.2);
    max-width: 500px;
    width: 100%;
    animation: slideUp 0.4s ease;
    border: 2px solid var(--border-color);
}

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

.auth-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    gap: 10px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.3s;
    border-radius: 8px 8px 0 0;
}

.auth-tab:hover {
    opacity: 1;
    background: rgba(var(--primary-rgb), 0.1);
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    opacity: 1;
    font-weight: 700;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.auth-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.auth-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.auth-btn:disabled {
    background: var(--border-color);
    color: var(--text-color);
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    display: none;
    font-weight: 500;
}

.auth-message.success {
    background: rgba(var(--success-color), 0.15);
    color: var(--success-color);
    border: 2px solid var(--success-color);
    display: block;
}

.auth-message.error {
    background: rgba(var(--error-color), 0.15);
    color: var(--error-color);
    border: 2px solid var(--error-color);
    display: block;
}

.auth-message.info {
    background: rgba(var(--info-color), 0.15);
    color: var(--info-color);
    border: 2px solid var(--info-color);
    display: block;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 14px;
    padding: 10px;
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 8px;
}

/* ============================================================
   BOTONES DE ENTRADA (dentro del accountModal, sin sesión)
   ============================================================ */

.auth-entry-wrap {
    margin-top: 16px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    background: rgba(var(--primary-rgb), 0.04);
    text-align: center;
}

.auth-entry-tagline {
    font-size: 0.88rem;
    color: var(--text-color);
    opacity: 0.75;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.auth-entry-tagline i {
    color: var(--primary-color);
    font-size: 1rem;
}

.auth-entry-btns {
    display: flex;
    gap: 10px;
}

.auth-entry-btn {
    flex: 1;
    padding: 13px 10px;
    border-radius: 10px;
    border: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.auth-entry-btn.primary {
    background: var(--primary-color);
    color: white;
}

.auth-entry-btn.primary:hover {
    background: var(--primary-dark, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.auth-entry-btn.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.auth-entry-btn.secondary:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateY(-2px);
}

/* ============================================================
   OVERLAY DE AUTENTICACIÓN (ventana flotante sobre el modal)
   ============================================================ */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(135deg, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.78) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Reutiliza .auth-box del CSS original + agrega posición relativa para el botón X */
.auth-overlay .auth-box {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.auth-overlay .auth-box::-webkit-scrollbar { width: 3px; }
.auth-overlay .auth-box::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Botón cerrar del overlay */
.auth-overlay-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    z-index: 1;
}

.auth-overlay-close:hover {
    background: rgba(var(--error-color, 255,68,68), 0.15);
    border-color: var(--error-color);
    color: var(--error-color);
    transform: scale(1.1);
}

/* Animación de entrada del overlay */
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

.auth-overlay {
    animation: overlayFadeIn 0.25s ease;
}

/* El auth-box ya tiene slideUp, pero lo reforzamos para el overlay */
.auth-overlay .auth-box {
    animation: slideUp 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@media (max-width: 480px) {
    .auth-entry-btns {
        flex-direction: column;
    }
    .auth-overlay .auth-box {
        padding: 22px 18px;
    }
}