/* ============================================
   Auth Page - Premium Dark Glassmorphism
   Complete Design Overhaul
   ============================================ */

/* Page Background - Dark by Default */
body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(34, 211, 238, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 60%);
    animation: floatSlow 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Floating Orbs */
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    background: var(--gradient-main);
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    top: -200px;
    right: -200px;
    pointer-events: none;
    animation: floatSlow 25s ease-in-out infinite reverse;
}

.light-mode body::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
}

.light-mode body::after {
    opacity: 0.08;
}

/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 480px;
    padding: var(--space-4);
    margin: 0 auto;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

/* Auth Box - Main Card */
.auth-box {
    background: var(--gradient-card);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-2xl), 0 0 100px rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-color);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-border);
    animation: gradientFlow 5s ease infinite;
    background-size: 200% 200%;
}

/* Decorative Glow */
.auth-box::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--gradient-main);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.1;
    bottom: -150px;
    left: -100px;
    pointer-events: none;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
    position: relative;
    z-index: 1;
}

.logo {
    margin-bottom: var(--space-4);
    display: inline-block;
}

.logo img {
    height: 80px !important;
    width: 80px !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-lg), 0 0 40px rgba(139, 92, 246, 0.3);
    transition: all var(--transition);
    animation: float 4s ease-in-out infinite;
}

.logo:hover img {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-xl), var(--shadow-glow-lg);
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
    animation: textGlow 4s ease-in-out infinite;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    gap: 6px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-light);
}

.tab-btn {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all var(--transition);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    background: var(--gradient-main);
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.2);
}

.tab-content {
    display: none;
    animation: fadeInUp 0.4s ease-out;
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block;
}

/* Form Styles */
.auth-form .form-group {
    margin-bottom: var(--space-5);
}

.auth-form .form-group label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.label-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary-400);
}

.auth-form .form-group input {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    font-size: 0.9375rem;
    font-family: var(--font-family);
    transition: all var(--transition);
}

.auth-form .form-group input::placeholder {
    color: var(--text-muted);
}

.auth-form .form-group input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), var(--shadow-glow);
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: var(--space-1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.password-toggle:hover {
    color: var(--primary-400);
    background: rgba(139, 92, 246, 0.1);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Form Help Text */
.form-help {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-top: var(--space-3);
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.form-help .help-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.form-help svg {
    width: 14px;
    height: 14px;
    stroke: var(--primary-400);
}

.form-help a {
    color: var(--primary-400);
    font-weight: 600;
}

.form-help a:hover {
    text-decoration: underline;
}

.telegram-link {
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.telegram-link:hover {
    background: rgba(139, 92, 246, 0.25);
}

.form-help code {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

/* Submit Button */
.auth-form .btn {
    width: 100%;
    padding: var(--space-4);
    font-size: 1rem;
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
}

.auth-form .btn-primary {
    background: var(--gradient-main);
    background-size: 200% 200%;
    animation: gradientFlow 5s ease infinite;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.3);
}

.auth-form .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), 0 0 50px rgba(139, 92, 246, 0.4);
}

/* Forgot Password */
.forgot-wrapper {
    text-align: center;
    margin-top: var(--space-4);
}

.forgot-wrapper a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.forgot-wrapper a:hover {
    color: var(--primary-400);
}

/* Forgot Password Modal */
.forgot-password-modal {
    display: none;
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
    animation: fadeInUp 0.4s ease-out;
}

.forgot-password-modal .card {
    background: var(--bg-secondary);
    padding: var(--space-6);
    margin-bottom: 0;
    border: 1px solid var(--border-color);
}

.forgot-password-modal h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-4);
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-4);
    line-height: 1.7;
}

.back-link {
    text-align: center;
    margin-top: var(--space-4);
}

.back-link a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
}

.back-link a:hover {
    color: var(--primary-400);
    transform: translateX(-4px);
}

/* Messages */
.message {
    padding: var(--space-4);
    border-radius: var(--radius);
    margin-top: var(--space-4);
    font-size: 0.875rem;
    display: none;
    text-align: center;
    animation: fadeInUp 0.3s ease-out;
    border: 1px solid;
}

.message.show {
    display: block;
}

.message.success {
    background: var(--success-light);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

.message.error {
    background: var(--danger-light);
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.3);
}

.message.info {
    background: var(--info-light);
    color: var(--info-color);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: var(--space-6) 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.divider span {
    padding: 0 var(--space-4);
}

/* Telegram Login Button */
.telegram-login-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: var(--space-4);
    position: relative;
    z-index: 1;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    color: var(--text-muted);
    font-size: 0.8125rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

/* Modal Quick Register */
.modal-quick-register {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.modal-dialog {
    position: relative;
    background: var(--gradient-card);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-color);
    animation: scaleIn 0.3s ease-out;
}

.modal-dialog h3 {
    font-size: 1.375rem;
    margin-bottom: var(--space-6);
    text-align: center;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: var(--space-4);
    }

    .auth-container {
        padding: var(--space-2);
    }

    .auth-box {
        padding: var(--space-6);
        border-radius: var(--radius-xl);
    }

    .logo img {
        height: 64px !important;
        width: 64px !important;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: var(--space-3);
    }

    .auth-container {
        padding: 0;
    }

    .auth-box {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }

    .tabs {
        padding: 4px;
        gap: 4px;
    }

    .tab-btn {
        padding: var(--space-2) var(--space-3);
        font-size: 0.875rem;
    }

    .auth-form .form-group input {
        padding: var(--space-3) var(--space-4);
    }

    .auth-form .btn {
        padding: var(--space-3);
    }
}