/* ============================================
   Auth Modal - Full Page Overlay
   ============================================ */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}

.auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Left Panel - Form */
.auth-panel-left {
    width: 480px;
    min-width: 480px;
    height: 100vh;
    background: #0f0f12;
    overflow-y: auto;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-overlay.active .auth-panel-left {
    transform: translateX(0);
}

/* Custom scrollbar for auth panel */
.auth-panel-left::-webkit-scrollbar {
    width: 4px;
}

.auth-panel-left::-webkit-scrollbar-track {
    background: transparent;
}

.auth-panel-left::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Right Panel - Decorative */
.auth-panel-right {
    flex: 1;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(220, 38, 38, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(185, 28, 28, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(239, 68, 68, 0.03) 0%, transparent 50%),
        #09090b;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.auth-panel-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 40%, rgba(220, 38, 38, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(127, 29, 29, 0.03) 0%, transparent 40%);
    animation: authBgPulse 8s ease-in-out infinite;
}

@keyframes authBgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.auth-close-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
    pointer-events: none;
}

.auth-close-hint svg {
    display: block;
    margin: 0 auto 12px;
    opacity: 0.3;
}

/* Auth Header */
.auth-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.auth-back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: var(--gray-300);
    cursor: pointer;
    transition: all var(--transition-base);
}

.auth-back-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--primary-light);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.2);
}

.auth-header-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

/* Auth Title */
.auth-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-title span {
    color: var(--primary);
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.6;
}

/* Auth Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-300);
    letter-spacing: 0.02em;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.auth-input-wrap input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--white);
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.auth-input-wrap input::placeholder {
    color: var(--gray-600);
}

.auth-input-wrap input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
    outline: none;
}

.auth-input-wrap input:focus ~ .auth-input-icon,
.auth-input-wrap input:focus + .auth-input-icon {
    color: var(--primary-light);
}

.auth-input-wrap:has(input:focus) .auth-input-icon {
    color: var(--primary-light);
}

/* Password Toggle */
.auth-pw-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color var(--transition-fast);
}

.auth-pw-toggle:hover {
    color: var(--gray-300);
}

/* Password Strength */
.pw-strength {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.pw-strength-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.pw-strength-bar.active.weak { background: #ef4444; }
.pw-strength-bar.active.medium { background: #f59e0b; }
.pw-strength-bar.active.strong { background: #22c55e; }
.pw-strength-bar.active.very-strong { background: #10b981; }

.pw-strength-text {
    font-size: 0.72rem;
    margin-top: 4px;
    color: var(--gray-500);
    transition: color 0.3s ease;
}

.pw-strength-text.weak { color: #ef4444; }
.pw-strength-text.medium { color: #f59e0b; }
.pw-strength-text.strong { color: #22c55e; }
.pw-strength-text.very-strong { color: #10b981; }

/* Security Notice */
.auth-security-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-top: -4px;
}

.auth-security-notice svg {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 1px;
}

.auth-security-notice p {
    font-size: 0.75rem;
    color: var(--gray-400);
    line-height: 1.5;
}

/* Auth Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.auth-submit-btn:hover::before {
    transform: translateX(100%);
}

.auth-submit-btn:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.25);
    transform: translateY(-1px);
}

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

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

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinAnim 0.8s linear infinite;
}

@keyframes spinAnim {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 4px 0;
}

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

.auth-divider span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Social Buttons Container */
.auth-social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

/* Google Button */
.auth-google-btn {
    width: 100%;
    padding: 13px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-base);
}

.auth-google-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
}

/* Discord Button */
.auth-discord-btn {
    width: 100%;
    padding: 13px;
    background: #5865F2;
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-base);
}

.auth-discord-btn:hover {
    background: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.3);
}

/* Auth Footer Link */
.auth-footer-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-400);
    margin-top: 20px;
    padding-bottom: 20px;
}

.auth-footer-text a {
    color: var(--primary-light);
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.auth-footer-text a:hover {
    color: var(--red-300);
    text-decoration: underline;
}

/* Error & Success States */
.auth-field.error .auth-input-wrap input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.auth-field.success .auth-input-wrap input {
    border-color: #22c55e;
}

.auth-field-error {
    font-size: 0.72rem;
    color: #ef4444;
    margin-top: 2px;
    display: none;
}

.auth-field.error .auth-field-error {
    display: block;
    animation: shakeError 0.4s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Toast Notification */
.auth-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10001;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 380px;
}

.auth-toast.show {
    transform: translateX(0);
}

.auth-toast.success {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.auth-toast.error {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.auth-toast.warning {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

/* Rate Limit Lockout */
.auth-lockout {
    text-align: center;
    padding: 20px;
}

.auth-lockout-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
}

.auth-lockout h3 {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.auth-lockout p {
    font-size: 0.85rem;
    color: var(--gray-400);
    line-height: 1.6;
}

.auth-lockout-timer {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin: 16px 0;
}

/* Logged In State - User Menu */
.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.nav-user-menu:hover,
.nav-user-menu.active {
    background: rgba(255, 255, 255, 0.05);
}

.nav-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
    transition: all var(--transition-base);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-user-menu:hover .nav-user-avatar,
.nav-user-menu.active .nav-user-avatar {
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.nav-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    user-select: none;
}

/* User Dropdown Menu */
.nav-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 200px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.nav-user-menu:hover .nav-user-dropdown,
.nav-user-menu.active .nav-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Item styling */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    background: none;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item svg {
    color: var(--gray-500);
    transition: color 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.dropdown-item:hover svg {
    color: var(--primary-light);
}

/* Special logout styling inside dropdown */
.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout svg {
    color: rgba(239, 68, 68, 0.6);
}

.dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.dropdown-item.logout:hover svg {
    color: #ef4444;
}

/* Divider inside dropdown */
.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 0;
}

/* ============================================
   Promo Card
   ============================================ */
.auth-promo-card {
    position: absolute;
    bottom: 32px;
    right: 32px;
    width: 320px;
    max-width: calc(100% - 64px);
    z-index: 10;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 22px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    animation: promoSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards;
}

.auth-promo-card:hover {
    background: rgba(10, 10, 10, 0.8);
    border-color: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.08), 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

@keyframes promoSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.promo-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    margin-top: 5px;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: promoDotPulse 2s ease-in-out infinite;
}

@keyframes promoDotPulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.5), 0 0 0 0 rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.6), 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

.promo-content strong {
    display: block;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.promo-content p {
    font-size: 0.8rem;
    color: var(--gray-400);
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   Responsive Auth
   ============================================ */
@media (max-width: 768px) {
    .auth-panel-left {
        width: 100%;
        min-width: 100%;
        padding: 32px 24px;
    }

    .auth-panel-right {
        display: none;
    }

    .auth-form-row {
        grid-template-columns: 1fr;
    }

    .auth-title {
        font-size: 1.6rem;
    }

    .auth-toast {
        top: auto;
        bottom: 24px;
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth-panel-left {
        padding: 24px 20px;
    }

    .auth-header {
        margin-bottom: 28px;
    }
}
