        :root[data-theme="dark"] {
            /* Main colors */
            --primary: #6366f1;
            --primary-dark: #4f46e5;
            --secondary: #10b981;
            --accent: #f59e0b;
            --danger: #ef4444;
            --success: #22c55e;
            
            /* Background */
            --bg-main: #0a0a0f;
            --bg-card: #12121a;
            --bg-input: #1a1a26;
            --bg-hover: #22222e;
            
            /* Text */
            --text-primary: #ffffff;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            
            /* Borders */
            --border: #2d2d3a;
            --border-light: #3d3d4a;
            
            /* Effects */
            --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
            --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
            --glow: 0 0 20px rgba(99, 102, 241, 0.3);
        }

        :root[data-theme="light"] {
            /* Main colors */
            --primary: #6366f1;
            --primary-dark: #4f46e5;
            --secondary: #10b981;
            --accent: #f59e0b;
            --danger: #ef4444;
            --success: #22c55e;
            
            /* Background */
            --bg-main: #ffffff;
            --bg-card: #ffffff;
            --bg-input: #f8fafc;
            --bg-hover: #f1f5f9;
            
            /* Text */
            --text-primary: #1e293b;
            --text-secondary: #475569;
            --text-muted: #64748b;
            
            /* Borders */
            --border: #e2e8f0;
            --border-light: #cbd5e1;
            
            /* Effects */
            --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
            --glow: 0 0 20px rgba(99, 102, 241, 0.2);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: var(--bg-main);
            color: var(--text-primary);
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }

        /* Animated background */
        .bg-animation {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            background: 
                radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
            animation: float 20s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(1deg); }
        }

        /* Main container */
        .auth-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2rem;
        }

        .auth-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 24px;
            box-shadow: var(--shadow-lg);
            width: 100%;
            max-width: 480px;
            padding: 3rem;
            position: relative;
            overflow: hidden;
        }

        .auth-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
            border-radius: 24px 24px 0 0;
        }

        .auth-card::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(99, 102, 241, 0.03), transparent 70%);
            animation: pulse 4s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 0.5; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.05); }
        }

        /* Header */
        .auth-header {
            text-align: center;
            margin-bottom: 2rem;
            position: relative;
            z-index: 2;
        }

        .logo {
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        .logo-icon {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.5rem;
            box-shadow: var(--glow);
            animation: glow 3s ease-in-out infinite;
        }

        @keyframes glow {
            0%, 100% { box-shadow: var(--glow); }
            50% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.5); }
        }

        .logo-text {
            font-size: 2rem;
            font-weight: 800;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .auth-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .auth-subtitle {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        /* Tab switcher */
        .tab-switcher {
            display: flex;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 4px;
            margin-bottom: 2rem;
            position: relative;
        }

        .tab-switcher::before {
            content: '';
            position: absolute;
            top: 4px;
            left: 4px;
            width: calc(50% - 4px);
            height: calc(100% - 8px);
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            border-radius: 12px;
            transition: transform 0.3s ease;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .tab-switcher.register::before {
            transform: translateX(100%);
        }

        .tab-btn {
            flex: 1;
            padding: 1rem;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: color 0.3s ease;
            position: relative;
            z-index: 2;
            border-radius: 12px;
        }

        .tab-btn.active {
            color: white;
        }

        /* Form */
        .auth-form {
            position: relative;
            z-index: 2;
        }

        .form-section {
            display: none;
            animation: fadeIn 0.4s ease;
        }

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

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

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            display: block;
            color: var(--text-primary);
            font-weight: 600;
            font-size: 0.875rem;
            margin-bottom: 0.5rem;
        }

        .input-wrapper {
            position: relative;
        }

        .form-input {
            width: 100%;
            padding: 1rem 1.25rem;
            background: var(--bg-input);
            border: 2px solid var(--border);
            border-radius: 12px;
            color: var(--text-primary);
            font-size: 1rem;
            transition: all 0.3s ease;
            font-family: 'Inter', sans-serif;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
            background: var(--bg-hover);
        }

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

        .input-icon {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .input-icon:hover {
            color: var(--primary);
        }

        /* ReCAPTCHA */
        .recaptcha {
            background: var(--bg-input);
            border: 2px solid var(--border);
            border-radius: 12px;
            padding: 1rem;
            margin-bottom: 1.5rem;
            transition: border-color 0.3s ease;
        }

        .recaptcha:hover {
            border-color: var(--primary);
        }

        .recaptcha-content {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .recaptcha-checkbox {
            position: relative;
        }

        .recaptcha-checkbox input {
            appearance: none;
            width: 24px;
            height: 24px;
            border: 2px solid var(--border);
            border-radius: 4px;
            background: var(--bg-card);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .recaptcha-checkbox input:checked {
            background: var(--primary);
            border-color: var(--primary);
        }

        .recaptcha-checkbox input:checked::after {
            content: '✓';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: white;
            font-size: 14px;
            font-weight: bold;
        }

        .recaptcha-text {
            flex: 1;
        }

        .recaptcha-main {
            color: var(--text-primary);
            font-weight: 500;
            margin-bottom: 0.25rem;
        }

        .recaptcha-sub {
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        /* Submit button */
        .submit-btn {
            width: 100%;
            padding: 1rem 2rem;
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 1.5rem;
            position: relative;
            overflow: hidden;
        }

        .submit-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
        }

        .submit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
        }

        .submit-btn:hover::before {
            left: 100%;
        }

        .submit-btn:disabled {
            background: var(--text-muted);
            cursor: not-allowed;
            transform: none;
        }

        /* Divider */
        .divider {
            display: flex;
            align-items: center;
            margin: 1.5rem 0;
            color: var(--text-muted);
            font-size: 0.875rem;
        }

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

        .divider span {
            padding: 0 1rem;
        }

        /* Social buttons */
        .social-buttons {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .social-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            padding: 1rem;
            border: 2px solid var(--border);
            border-radius: 12px;
            background: var(--bg-input);
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 600;
            font-size: 0.9rem;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .social-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .social-btn.vk::before {
            background: linear-gradient(135deg, #4680c2, #5a9bd4);
        }

        .social-btn.telegram::before {
            background: linear-gradient(135deg, #0088cc, #00a0e6);
        }

        .social-btn:hover {
            border-color: transparent;
            transform: translateY(-2px);
            box-shadow: var(--shadow);
        }

        .social-btn:hover::before {
            opacity: 1;
        }

        .social-btn:hover * {
            color: white;
            position: relative;
            z-index: 2;
        }

        .social-icon {
            font-size: 1.25rem;
        }

        /* Switch link */
        .switch-link {
            text-align: center;
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        .switch-link a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            transition: color 0.3s ease;
        }

        .switch-link a:hover {
            color: var(--secondary);
        }

        /* Messages */
        .message {
            padding: 1rem;
            border-radius: 12px;
            margin-bottom: 1rem;
            font-size: 0.875rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            opacity: 0;
            transform: translateY(-10px);
            transition: all 0.3s ease;
        }

        .message.show {
            opacity: 1;
            transform: translateY(0);
        }

        .message.success {
            background: rgba(34, 197, 94, 0.1);
            border: 1px solid rgba(34, 197, 94, 0.3);
            color: var(--success);
        }

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

        /* Responsive */
        @media (max-width: 580px) {
            .auth-container {
                padding: 1rem;
            }

            .auth-card {
                padding: 2rem;
                max-width: 420px;
            }

            .social-buttons {
                grid-template-columns: 1fr;
            }
        }

        /* Loading animation */
        .loading {
            position: relative;
        }

        .loading::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 20px;
            height: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top: 2px solid white;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            transform: translate(-50%, -50%);
        }

        @keyframes spin {
            0% { transform: translate(-50%, -50%) rotate(0deg); }
            100% { transform: translate(-50%, -50%) rotate(360deg); }
        }

        .loading .btn-text {
            opacity: 0;
        }

        /* Header Controls Row */
        .header-controls-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            padding: 0 0.5rem;
        }

        .header-control-btn {
            background: var(--bg-input);
            border: 2px solid var(--border);
            border-radius: 12px;
            padding: 0.75rem 1rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.875rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            text-decoration: none;
            font-family: 'Inter', sans-serif;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
            min-width: 100px;
        }

        .header-control-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transition: left 0.5s ease;
        }

        .header-control-btn:hover::before {
            left: 100%;
        }

        .header-control-btn:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
        }

        .header-control-btn:active {
            transform: translateY(0);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .header-control-btn i {
            font-size: 1rem;
            transition: transform 0.3s ease;
        }

        .header-control-btn:hover i {
            transform: scale(1.1);
        }

        .back-btn {
            background: linear-gradient(135deg, var(--bg-input), var(--bg-hover));
        }

        .back-btn:hover {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            border-color: var(--primary);
        }

        .back-btn:hover .fas.fa-arrow-left {
            transform: translateX(-3px) scale(1.1);
        }

        .theme-btn {
            background: linear-gradient(135deg, var(--bg-input), var(--bg-hover));
            justify-content: center;
        }

        .theme-btn:hover {
            background: linear-gradient(135deg, var(--accent), var(--primary));
            color: white;
            border-color: var(--accent);
        }

        .control-text {
            font-size: 0.8125rem;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        /* Mobile responsive */
        @media (max-width: 768px) {
            .header-control-btn {
                padding: 0.625rem 0.875rem;
                font-size: 0.8125rem;
                gap: 0.375rem;
                min-width: 80px;
            }

            .header-control-btn i {
                font-size: 0.9375rem;
            }

            .control-text {
                font-size: 0.75rem;
            }
        }

        @media (max-width: 480px) {
            .header-controls-row {
                margin-bottom: 1.5rem;
                padding: 0;
            }

            .header-control-btn {
                padding: 0.5rem 0.75rem;
                font-size: 0.75rem;
                gap: 0.375rem;
                border-radius: 10px;
                min-width: 70px;
            }

            .header-control-btn i {
                font-size: 0.875rem;
            }

            .control-text {
                font-size: 0.7rem;
            }
        }

        @media (max-width: 380px) {
            .control-text {
                display: none;
            }

            .header-control-btn {
                min-width: 44px;
                width: 44px;
                height: 44px;
                padding: 0.5rem;
                justify-content: center;
            }
        }