:root {
            --bg-base: #111318;
            --bg-surface: #181a20;
            --bg-card: #1c1e25;
            --bg-elevated: #21232b;
            --bg-header: #141519;
            --bg-input: #1a1c23;
            --border: rgba(255, 255, 255, 0.06);
            --border-light: rgba(255, 255, 255, 0.04);
            --border-active: rgba(255, 255, 255, 0.12);
            --text-primary: #e4e6ec;
            --text-secondary: #9599a3;
            --text-tertiary: #6b6f78;
            --text-muted: #52565e;
            --accent: #e63946;
            --accent-soft: rgba(230, 57, 70, 0.12);
            --accent-glow: rgba(230, 57, 70, 0.25);
            --green: #4ade80;
            --green-soft: rgba(74, 222, 128, 0.12);
            --red: #f87171;
            --red-soft: rgba(248, 113, 113, 0.12);
            --amber: #fbbf24;
            --amber-soft: rgba(251, 191, 36, 0.12);
            --blue: #60a5fa;
            --blue-soft: rgba(96, 165, 250, 0.12);
            --purple: #a78bfa;
            --purple-soft: rgba(167, 139, 250, 0.12);
            --radius-xs: 6px;
            --radius-sm: 10px;
            --radius-md: 14px;
            --radius-lg: 18px;
            --radius-xl: 22px;
            --radius-full: 999px;
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
            --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
            --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
            --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
            --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
            --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;
            --transition-fast: 0.15s ease;
            --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

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

        html {
            font-size: 15px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            scroll-behavior: smooth;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: var(--font-sans);
            background: var(--bg-base);
            color: var(--text-primary);
            min-height: 100vh;
            min-height: 100dvh;
            line-height: 1.5;
            overflow-x: hidden;
            letter-spacing: -0.01em;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            background-image:
                radial-gradient(ellipse at 20% 50%, rgba(230, 57, 70, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(96, 165, 250, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 0%, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
        }

        /* Фоновые частицы */
        .particles {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 0;
        }
        .particle {
            position: absolute;
            width: 2px;
            height: 2px;
            background: var(--accent);
            border-radius: 50%;
            opacity: 0;
            animation: floatUp 6s infinite;
        }
        @keyframes floatUp {
            0% {
                opacity: 0;
                transform: translateY(100vh) scale(0);
            }
            20% {
                opacity: 0.6;
            }
            80% {
                opacity: 0.3;
            }
            100% {
                opacity: 0;
                transform: translateY(-20vh) scale(1.5);
            }
        }

        .auth-container {
            width: 100%;
            max-width: 480px;
            position: relative;
            z-index: 1;
        }

        /* Логотип */
        .auth-logo {
            text-align: center;
            margin-bottom: 28px;
        }
        .auth-logo a {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            font-weight: 700;
            font-size: 1.65rem;
            letter-spacing: -0.02em;
            color: var(--text-primary);
            text-decoration: none;
        }
        .auth-logo svg {
            width: 48px;
            height: 48px;
            flex-shrink: 0;
        }
        .auth-logo .dot {
            color: var(--accent);
        }
        .auth-logo .site-logo-link {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            font-weight: 700;
            font-size: 1.65rem;
            letter-spacing: -0.02em;
            color: var(--text-primary);
            text-decoration: none;
        }
        .auth-logo .site-logo-img,
        .auth-logo .site-logo-img--auth {
            height: 56px !important;
            width: auto !important;
            max-width: min(280px, 85vw) !important;
            object-fit: contain;
        }
        .auth-logo .site-logo-svg {
            width: 48px;
            height: 48px;
        }
        .auth-subtitle {
            font-size: 0.8rem;
            color: var(--text-tertiary);
            margin-top: 6px;
        }

        /* Карточка */
        .auth-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            padding: 28px 24px;
            box-shadow: var(--shadow-xl);
            animation: fadeInUp 0.5s ease;
        }
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Переключатель */
        .auth-switcher {
            display: flex;
            background: var(--bg-elevated);
            border-radius: var(--radius-full);
            padding: 3px;
            margin-bottom: 24px;
            position: relative;
        }
        .auth-switch-btn {
            flex: 1;
            padding: 10px;
            border: none;
            background: transparent;
            color: var(--text-tertiary);
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            border-radius: var(--radius-full);
            transition: all var(--transition-smooth);
            font-family: var(--font-sans);
            letter-spacing: -0.01em;
            position: relative;
            z-index: 1;
            white-space: nowrap;
        }
        .auth-switch-btn.active {
            background: var(--accent);
            color: white;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
        }

        /* Формы */
        .auth-form {
            display: none;
            flex-direction: column;
            gap: 14px;
            animation: fadeIn 0.3s ease;
        }
        .auth-form.active {
            display: flex;
        }
        .install-form {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateX(-10px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .input-group {
            position: relative;
        }
        .input-group .input-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
            pointer-events: none;
            font-size: 1rem;
            z-index: 1;
        }
        .input-group .input-icon-right {
            left: auto;
            right: 14px;
            cursor: pointer;
            pointer-events: auto;
            color: var(--text-muted);
            transition: color var(--transition-fast);
        }
        .input-group .input-icon-right:hover {
            color: var(--text-secondary);
        }
        .auth-input {
            width: 100%;
            padding: 12px 14px 12px 42px;
            background: var(--bg-input);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            font-size: 0.875rem;
            font-family: var(--font-sans);
            letter-spacing: -0.01em;
            transition: all var(--transition-fast);
            outline: none;
        }
        .auth-input.with-right-icon {
            padding-right: 42px;
        }
        .auth-input::placeholder {
            color: var(--text-muted);
        }
        .auth-input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-soft);
            background: var(--bg-elevated);
        }
        .auth-input.error {
            border-color: var(--red);
            box-shadow: 0 0 0 3px var(--red-soft);
        }
        .auth-input.valid {
            border-color: var(--green);
            box-shadow: 0 0 0 3px var(--green-soft);
        }

        .input-error-text {
            font-size: 0.7rem;
            color: var(--red);
            margin-top: 4px;
            display: none;
            padding-left: 4px;
        }
        .input-error-text.visible {
            display: block;
        }

        .input-helper {
            font-size: 0.7rem;
            color: var(--text-tertiary);
            margin-top: 4px;
            padding-left: 4px;
        }

        /* Индикатор силы пароля */
        .password-strength {
            display: flex;
            gap: 4px;
            margin-top: 8px;
        }
        .password-strength-bar {
            flex: 1;
            height: 3px;
            background: var(--border);
            border-radius: var(--radius-full);
            transition: all var(--transition-fast);
        }
        .password-strength-bar.weak {
            background: var(--red);
        }
        .password-strength-bar.medium {
            background: var(--amber);
        }
        .password-strength-bar.strong {
            background: var(--green);
        }
        .password-strength-text {
            font-size: 0.65rem;
            color: var(--text-tertiary);
            margin-top: 4px;
            text-align: right;
        }

        /* Чекбокс */
        .checkbox-group {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            cursor: pointer;
        }
        .checkbox-custom {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border-active);
            border-radius: var(--radius-xs);
            background: var(--bg-input);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all var(--transition-fast);
            cursor: pointer;
            margin-top: 1px;
        }
        .checkbox-custom.checked {
            background: var(--accent);
            border-color: var(--accent);
        }
        .checkbox-custom.checked::after {
            content: '✓';
            color: white;
            font-size: 0.7rem;
            font-weight: 700;
        }
        .checkbox-label {
            font-size: 0.78rem;
            color: var(--text-secondary);
            user-select: none;
        }
        .checkbox-label a {
            color: var(--accent);
            text-decoration: none;
        }
        .checkbox-label a:hover {
            text-decoration: underline;
        }

        /* Кнопки */
        .auth-submit {
            width: 100%;
            padding: 13px;
            background: var(--accent);
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-fast);
            font-family: var(--font-sans);
            letter-spacing: -0.01em;
            position: relative;
            overflow: hidden;
        }
        .auth-submit:hover {
            opacity: 0.9;
            box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
        }
        .auth-submit:active {
            transform: scale(0.98);
        }
        .auth-submit.loading {
            pointer-events: none;
            color: transparent;
        }
        .auth-submit.loading::after {
            content: '';
            position: absolute;
            width: 20px;
            height: 20px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            top: 50%;
            left: 50%;
            margin: -10px;
        }
        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* Социальные кнопки */
        .social-divider {
            display: flex;
            align-items: center;
            gap: 10px;
            color: var(--text-muted);
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin: 6px 0;
        }
        .social-divider::before,
        .social-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border);
        }
        .social-buttons {
            display: flex;
            gap: 8px;
        }
        .social-btn {
            flex: 1;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-elevated);
            color: var(--text-primary);
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 500;
            transition: all var(--transition-fast);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-family: var(--font-sans);
        }
        .social-btn:hover {
            border-color: var(--border-active);
            background: var(--bg-input);
            box-shadow: var(--shadow-sm);
        }
        .social-btn.google:hover {
            border-color: #ea4335;
            background: rgba(234, 67, 53, 0.1);
        }
        .social-btn.vk:hover {
            border-color: #0077ff;
            background: rgba(0, 119, 255, 0.1);
        }
        .social-btn.telegram:hover {
            border-color: #0088cc;
            background: rgba(0, 136, 204, 0.1);
        }
        .social-btn.yandex:hover {
            border-color: #ffcc00;
            background: rgba(255, 204, 0, 0.1);
        }

        /* Ссылки */
        .auth-footer {
            text-align: center;
            margin-top: 16px;
            font-size: 0.78rem;
            color: var(--text-tertiary);
        }
        .auth-footer a {
            color: var(--accent);
            text-decoration: none;
            font-weight: 500;
            transition: opacity var(--transition-fast);
        }
        .auth-footer a:hover {
            opacity: 0.8;
            text-decoration: underline;
        }

        /* Модальное окно */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            z-index: 200;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-smooth);
            padding: 16px;
        }
        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        .modal-content {
            background: var(--bg-elevated);
            border: 1px solid var(--border);
            border-radius: var(--radius-xl);
            padding: 24px;
            width: 100%;
            max-width: 420px;
            box-shadow: var(--shadow-lg);
            transform: scale(0.95);
            transition: transform var(--transition-smooth);
        }
        .modal-overlay.active .modal-content {
            transform: scale(1);
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        .modal-close {
            background: none;
            border: none;
            color: var(--text-tertiary);
            cursor: pointer;
            font-size: 1.4rem;
            padding: 4px 8px;
            border-radius: var(--radius-xs);
            transition: all var(--transition-fast);
        }
        .modal-close:hover {
            background: var(--bg-card);
            color: var(--text-primary);
        }

        /* Успешная анимация */
        .success-checkmark {
            text-align: center;
            padding: 20px 0;
        }
        .success-checkmark .check-icon {
            font-size: 4rem;
            color: var(--green);
            animation: bounceIn 0.5s ease;
        }
        @keyframes bounceIn {
            0% {
                transform: scale(0);
            }
            60% {
                transform: scale(1.2);
            }
            100% {
                transform: scale(1);
            }
        }

        @media (min-width: 520px) {
            .auth-logo .site-logo-img,
            .auth-logo .site-logo-img--auth {
                height: 64px !important;
                max-width: 320px !important;
            }
            .auth-logo .site-logo-svg {
                width: 56px;
                height: 56px;
            }
            .auth-logo .site-logo-link {
                font-size: 1.85rem;
            }
        }

        /* Адаптивность */
        @media (max-width: 480px) {
            .auth-card {
                padding: 24px 16px;
                border-radius: var(--radius-lg);
            }
            .social-buttons {
                flex-wrap: wrap;
            }
            .social-btn {
                flex: 1 1 45%;
                font-size: 0.72rem;
                padding: 8px;
            }
            .auth-switch-btn {
                font-size: 0.78rem;
                padding: 8px;
            }
        }
        @media (min-width: 768px) {
            body {
                padding: 24px;
            }
            .auth-card {
                padding: 32px 28px;
            }
        }
