/* ──────────────────────────────────────────────────────────────────────────
   Auth Modal Styles
   ────────────────────────────────────────────────────────────────────────── */

#auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
#auth-overlay.active { opacity: 1; pointer-events: all; }

#auth-modal {
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border, #475569);
    border-radius: 16px;
    width: 420px;
    max-width: 95vw;
    padding: 2.5rem 2rem 2rem;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.25s ease;
}
#auth-overlay.active #auth-modal { transform: translateY(0); }

.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo img { height: 52px; }
.auth-logo h2 { font-size: 1.3rem; font-weight: 700; margin-top: 0.5rem; color: var(--text-primary, #f1f5f9); }

.auth-tabs {
    display: flex;
    background: var(--bg-primary, #0f172a);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.5rem;
}
.auth-tab {
    flex: 1; padding: 0.5rem; border: none; border-radius: 8px;
    background: transparent; color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.auth-tab.active { background: var(--bg-card, #334155); color: var(--text-primary, #f1f5f9); }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form.hidden { display: none; }

.auth-field { display: flex; flex-direction: column; gap: 0.4rem; }
.auth-field label { font-size: 0.8rem; color: var(--text-secondary, #94a3b8); font-weight: 500; }
.auth-field input {
    padding: 0.65rem 0.9rem; border: 1px solid var(--border, #475569);
    border-radius: 8px; background: var(--bg-primary, #0f172a);
    color: var(--text-primary, #f1f5f9); font-size: 0.9rem; outline: none;
    transition: border-color 0.2s;
}
.auth-field input:focus { border-color: var(--accent, #22c55e); }
.auth-field input::placeholder { color: var(--text-secondary, #475569); }

.auth-submit {
    margin-top: 0.5rem; padding: 0.75rem; background: var(--accent, #22c55e);
    color: #fff; border: none; border-radius: 10px;
    font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.auth-submit:hover { background: var(--accent-hover, #16a34a); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error {
    padding: 0.6rem 0.8rem; background: rgba(239,68,68,0.15);
    border: 1px solid var(--danger, #ef4444); border-radius: 8px;
    color: var(--danger, #ef4444); font-size: 0.85rem; display: none;
}
.auth-error.visible { display: block; }

.auth-divider { text-align: center; color: var(--text-secondary, #94a3b8); font-size: 0.8rem; margin: 0.5rem 0; }

.server-url-row {
    margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border, #475569);
}
.server-url-row label { font-size: 0.75rem; color: var(--text-secondary, #94a3b8); margin-bottom: 0.3rem; display: block; }
.server-url-row input {
    width: 100%; padding: 0.5rem 0.7rem; border: 1px solid var(--border, #475569);
    border-radius: 7px; background: var(--bg-primary, #0f172a);
    color: var(--text-primary, #f1f5f9); font-size: 0.85rem; outline: none;
}
.server-url-row input:focus { border-color: var(--accent, #22c55e); }
.server-url-row input::placeholder { color: var(--text-secondary, #94a3b8); }
.server-url-row .url-hint { font-size: 0.72rem; color: var(--text-secondary, #94a3b8); margin-top: 0.25rem; }

.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--text-secondary, #94a3b8); }
.auth-switch button { background: none; border: none; color: var(--accent, #22c55e); cursor: pointer; font-size: 0.85rem; font-weight: 500; padding: 0; }
.auth-switch button:hover { text-decoration: underline; }

.user-badge {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.8rem;
    background: var(--bg-card, #334155); border-radius: 8px;
    font-size: 0.85rem; color: var(--text-primary, #f1f5f9);
}
.user-badge .logout-btn { background: none; border: none; color: var(--text-secondary, #94a3b8); cursor: pointer; font-size: 0.8rem; padding: 0 4px; }
.user-badge .logout-btn:hover { color: var(--danger, #ef4444); }

.server-url-btn {
    background: none; border: none; color: var(--text-secondary, #94a3b8);
    cursor: pointer; font-size: 0.8rem; padding: 4px 8px; border-radius: 6px;
}
.server-url-btn:hover { background: var(--bg-card, #334155); color: var(--text-primary, #f1f5f9); }

#auth-modal .modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: var(--text-secondary, #94a3b8);
    cursor: pointer; font-size: 1rem; padding: 4px 8px; border-radius: 6px;
    line-height: 1;
}
#auth-modal .modal-close:hover { color: var(--text-primary, #f1f5f9); background: rgba(255,255,255,0.1); }
