/* ─── Auth Widget in header ──────────────────────────────────── */

#auth-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding: 0 4px;
}

/* Logged out — login button */
.auth-login-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.auth-login-btn:hover {
    background: #2563eb;
}

/* Logged in — user info */
.auth-user {
    font-weight: 600;
    font-size: 13px;
    color: #e2e8f0;
    white-space: nowrap;
}

.auth-points {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    color: #fbbf24;
    white-space: nowrap;
}
.points-icon {
    font-size: 13px;
}
.points-value {
    font-weight: 600;
}

.auth-dash-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s;
}
.auth-dash-link:hover {
    color: #e2e8f0;
}

.auth-logout-btn {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.auth-logout-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* ─── Login / Register Modal ─────────────────────────────────── */

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authFadeIn 0.2s ease;
}

@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal-box {
    position: relative;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 28px 24px 20px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal-box h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #f1f5f9;
    font-weight: 600;
}

.auth-close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}
.auth-close-btn:hover {
    color: #ef4444;
}

/* Tabs */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid #334155;
}
.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #64748b;
    padding: 8px 0;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.auth-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}
.auth-tab:hover {
    color: #94a3b8;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.auth-field input:focus {
    border-color: #3b82f6;
}

.auth-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.auth-submit-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.auth-submit-btn:hover {
    background: #2563eb;
}
.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── CAPTCHA Row ────────────────────────────────────────────── */

.auth-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-captcha-q {
    display: inline-block;
    min-width: 90px;
    padding: 8px 12px;
    background: #1a3a5c;
    color: #60a5fa;
    font-size: 16px;
    font-weight: 700;
    font-family: "Courier New", monospace;
    border-radius: 6px;
    text-align: center;
    letter-spacing: 1px;
    user-select: none;
    white-space: nowrap;
}

.auth-captcha-row input {
    flex: 1;
    min-width: 0;
}

.auth-captcha-refresh {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}
.auth-captcha-refresh:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}
.auth-captcha-refresh:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ─── Email Code Row ─────────────────────────────────────────── */

.auth-emailcode-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-emailcode-row input {
    flex: 1;
    min-width: 0;
}

.auth-sendcode-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    background: transparent;
    color: #3b82f6;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}
.auth-sendcode-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}
.auth-sendcode-btn:disabled {
    border-color: #334155;
    color: #64748b;
    cursor: not-allowed;
    background: transparent;
}
