/* ── OAuth Buttons (injected into auth modal) ─────────────────────────────── */
/* Collapse the 1.5rem flex gap from .counter-card between the OAuth
   container and the .input-group so the "or" divider sits centered. */
#oauth-buttons-container {
    margin-bottom: -0.75rem;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Error text only takes space when it has content */
#auth-error {
    min-height: 0;
    margin: 0;
    padding: 0;
}
#auth-error:not(:empty) {
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.oauth-btn:hover {
    transform: translateY(-1px);
}

.oauth-btn:active {
    transform: translateY(1px) scale(0.98);
}

.oauth-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google */
.oauth-btn-google {
    background: #ffffff;
    color: #3c4043;
}

.oauth-btn-google:hover {
    background: #f1f3f4;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Discord */
.oauth-btn-discord {
    background: #5865F2;
    color: #ffffff;
}

.oauth-btn-discord:hover {
    background: #4752c4;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35);
}

/* ── "or" Divider ─────────────────────────────────────────────────────────── */
.oauth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

/* ── Username Prompt Modal (for new OAuth users) ──────────────────────────── */
.oauth-username-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: modalFadeIn 0.3s ease;
}

.oauth-username-card {
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    padding: 2.5rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.oauth-username-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.oauth-username-card p {
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
}

.oauth-username-card .input-field {
    width: 100%;
    box-sizing: border-box;
}

.oauth-username-card .btn-primary {
    width: 100%;
    margin-top: 0.75rem;
}

.oauth-username-error {
    color: #f87171;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

/* ── Auth mode switch animation ────────────────────────────────────────────── */
/* Equal height: use the taller mode's natural height for both */
#auth-section.counter-card.modal-content {
    min-height: var(--auth-modal-height, auto);
    box-sizing: border-box;
}

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

#auth-section.auth-animate > *:not(#close-auth-btn) {
    animation: authFadeIn 0.2s ease-out both;
}

/* Stagger the children */
#auth-section.auth-animate > *:nth-child(1) { animation-delay: 0s; }
#auth-section.auth-animate > *:nth-child(3) { animation-delay: 0.02s; }
#auth-section.auth-animate > *:nth-child(4) { animation-delay: 0.04s; }
#auth-section.auth-animate > *:nth-child(5) { animation-delay: 0.06s; }
#auth-section.auth-animate > *:nth-child(6) { animation-delay: 0.08s; }
#auth-section.auth-animate > *:nth-child(7) { animation-delay: 0.10s; }
#auth-section.auth-animate > *:nth-child(8) { animation-delay: 0.12s; }
#auth-section.auth-animate > *:nth-child(9) { animation-delay: 0.14s; }

/* Reuse the modal animations from style.css */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
