/* ═══════════════════════════════════════════════════════════
   auth.css — Login/Register modal & account UI
   ═══════════════════════════════════════════════════════════ */

/* ── Auth Modal Overlay ── */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Auth Modal ── */
.auth-modal {
    background: linear-gradient(145deg, #1a1a2e, #16162a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.auth-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-modal-header .auth-logo {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.auth-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e0e0f0;
    margin: 0 0 6px 0;
}

.auth-modal-header p {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
}

/* ── Auth Tabs ── */
.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #888;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab:hover {
    color: #ccc;
}

.auth-tab.active {
    background: rgba(139, 92, 246, 0.3);
    color: #e0e0f0;
}

/* ── Auth Forms ── */
.auth-form {
    display: none;
}

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

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-field input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e0e0f0;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.auth-field input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.auth-field input::placeholder {
    color: #555;
}

/* ── Submit Button ── */
.auth-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Auth Error ── */
.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    color: #f87171;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
}

.auth-error.visible {
    display: block;
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #555;
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* ── Social / Patreon Button ── */
.auth-social-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-social-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-social-btn.patreon {
    background: rgba(249, 104, 84, 0.15);
    border-color: rgba(249, 104, 84, 0.3);
    color: #f96854;
}

.auth-social-btn.patreon:hover {
    background: rgba(249, 104, 84, 0.25);
}

.auth-social-btn.discord {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.3);
    color: #5865f2;
}

.auth-social-btn.discord:hover {
    background: rgba(88, 101, 242, 0.25);
}

/* ── Close Button ── */
.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #666;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.auth-close:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.1);
}

/* ── Nav Account Badge ── */
.nav-account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    color: #c4b5fd;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-account:hover {
    background: rgba(139, 92, 246, 0.3);
}

.nav-account .tier-badge {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.nav-signin {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #aaa;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-signin:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}

/* ── Account Dropdown ── */
.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(145deg, #1a1a2e, #16162a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    z-index: 500;
    display: none;
}

.account-dropdown.active {
    display: block;
}

.account-dropdown-item {
    padding: 10px 14px;
    border-radius: 10px;
    color: #ccc;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.account-dropdown-item.danger {
    color: #f87171;
}

.account-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ── Flux Meter ── */
.flux-meter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #888;
    padding: 4px 0;
}

.flux-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.flux-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.flux-fill.low {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.flux-fill.empty {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}