:root {
            --bg-primary: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
            --bg-card: rgba(255, 255, 255, 0.05);
            --bg-card-hover: rgba(255, 255, 255, 0.08);
            --border-color: rgba(255, 255, 255, 0.1);
            --text-primary: #ffffff;
            --text-secondary: rgba(255, 255, 255, 0.5);
            --text-muted: rgba(255, 255, 255, 0.35);
            --accent-primary: linear-gradient(135deg, #667eea, #764ba2);
            --accent-blue: #667eea;
            --accent-green: #48c78e;
            --accent-orange: #ffa726;
            --accent-purple: #764ba2;
            --accent-red: #ff6b6b;
            --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.3);
            --radius-sm: 10px;
            --radius-md: 12px;
            --radius-lg: 16px;
            --radius-xl: 24px;
        }

        *, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-primary);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
           /* overflow-x: hidden;  Запрещаем горизонтальный скролл из-за анимаций */
           /* overflow-y: auto;    Разрешаем вертикальный скролл при необходимости */
            min-height: 100vh;
            color: var(--text-primary);
            line-height: 1.5;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes slideIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0); }
            25% { transform: translate(30px, -30px); }
            50% { transform: translate(-20px, 20px); }
            75% { transform: translate(10px, -10px); }
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .page {
            display: none;
            animation: fadeIn 0.5s ease forwards;
            width: 100%;
            padding: 20px;
        }

        .page.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-xl);
            padding: 48px 40px;
            width: 100%;
            max-width: 440px;
            animation: slideIn 0.6s ease;
            box-shadow: var(--shadow-lg);
            max-height: 95vh;       /* Карточка не может быть выше 95% высоты экрана */
            overflow-y: auto;       /* Если содержимое не влезает, скроллится только карточка */
            scrollbar-width: thin;  /* Тонкий скроллбар для Firefox */
            scrollbar-color: rgba(255, 255, 255, 0.2) transparent; /* Цвет скроллбара */
        }
        .card::-webkit-scrollbar {
            width: 6px;
        }
        .card::-webkit-scrollbar-track {
            background: transparent;
        }
        .card::-webkit-scrollbar-thumb {
            background-color: rgba(255, 255, 255, 0.2);
            border-radius: 10px;
        }

        .logo {
            width: 60px;
            height: 60px;
            background: var(--accent-primary);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 24px;
        }

        .logo svg {
            width: 28px;
            height: 28px;
        }

        .card h1 {
            color: var(--text-primary);
            font-size: 28px;
            font-weight: 700;
            text-align: center;
            margin-bottom: 8px;
        }

        .card p.subtitle {
            color: var(--text-secondary);
            text-align: center;
            font-size: 14px;
            margin-bottom: 32px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 500;
            margin-bottom: 8px;
        }

        .input-wrapper {
            position: relative;
        }

        .input-wrapper svg {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            width: 18px;
            height: 18px;
            color: var(--text-muted);
            pointer-events: none;
        }

        .form-group input {
            width: 100%;
            padding: 14px 16px 14px 48px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            transition: all 0.3s ease;
            outline: none;
        }

        .form-group input:focus {
            border-color: var(--accent-blue);
            background: rgba(102, 126, 234, 0.08);
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
        }

        .form-group input::placeholder {
            color: var(--text-muted);
        }

        .password-toggle {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-muted);
            transition: color 0.2s ease;
            padding: 0;
            display: flex;
            align-items: center;
        }

        .password-toggle:hover {
            color: var(--text-secondary);
        }

        .password-toggle svg {
            position: static !important;
            transform: none !important;
            width: 18px;
            height: 18px;
        }

        .form-options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            flex-wrap: wrap;
            gap: 8px;
        }

        .checkbox-wrapper {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            user-select: none;
        }

        .checkbox-wrapper input[type="checkbox"] {
            display: none;
        }

        .checkmark {
            width: 18px;
            height: 18px;
            border: 2px solid var(--text-muted);
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            flex-shrink: 0;
        }

        .checkbox-wrapper input:checked + .checkmark {
            background: var(--accent-primary);
            border-color: transparent;
        }

        .checkmark svg {
            width: 12px;
            height: 12px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .checkbox-wrapper input:checked + .checkmark svg {
            opacity: 1;
        }

        .checkbox-wrapper span {
            color: var(--text-secondary);
            font-size: 13px;
        }

        .forgot-link {
            color: var(--accent-blue);
            font-size: 13px;
            text-decoration: none;
            font-weight: 500;
            transition: color 0.2s ease;
        }

        .forgot-link:hover {
            color: #8b9cf7;
        }

        .btn-primary {
            width: 100%;
            padding: 14px;
            background: var(--accent-primary);
            border: none;
            border-radius: var(--radius-md);
            color: #ffffff;
            font-size: 15px;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        .btn-primary .spinner {
            display: none;
            width: 20px;
            height: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .btn-primary.loading .btn-text {
            display: none;
        }

        .btn-primary.loading .spinner {
            display: inline-block;
        }

        .divider {
            display: flex;
            align-items: center;
            margin: 24px 0;
            gap: 16px;
        }

        .divider::before, .divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--border-color);
        }

        .divider span {
            color: var(--text-muted);
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .social-btns {
            display: flex;
            gap: 12px;
            margin-bottom: 24px;
        }

        .social-btn {
            flex: 1;
            padding: 12px;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .social-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
        }

        .social-btn svg {
            width: 20px;
            height: 20px;
            color: var(--text-secondary);
        }

        .switch-text {
            text-align: center;
            color: var(--text-secondary);
            font-size: 14px;
        }

        .switch-text a {
            color: var(--accent-blue);
            text-decoration: none;
            font-weight: 600;
            cursor: pointer;
            transition: color 0.2s ease;
        }

        .switch-text a:hover {
            color: #8b9cf7;
        }

        .error-msg {
            color: var(--accent-red);
            font-size: 12px;
            margin-top: 6px;
            display: none;
        }

        .error-msg.show {
            display: block;
        }

        .form-group input.error {
            border-color: var(--accent-red);
        }

        .toast {
            position: fixed;
            top: 24px;
            right: 24px;
            padding: 16px 24px;
            background: rgba(72, 199, 142, 0.95);
            backdrop-filter: blur(10px);
            border-radius: var(--radius-md);
            color: #fff;
            font-size: 14px;
            font-weight: 500;
            z-index: 1000;
            transform: translateX(120%);
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .toast.show {
            transform: translateX(0);
        }

        .toast.error {
            background: rgba(255, 107, 107, 0.95);
        }

        .floating-shapes {
            position: fixed;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
            z-index: -1;
        }

        .shape {
            position: absolute;
            border-radius: 50%;
            opacity: 0.03;
            background: #fff;
        }

        .shape:nth-child(1) {
            width: 400px;
            height: 400px;
            top: -100px;
            right: -100px;
            animation: float 20s ease-in-out infinite;
        }

        .shape:nth-child(2) {
            width: 300px;
            height: 300px;
            bottom: -50px;
            left: -50px;
            animation: float 15s ease-in-out infinite reverse;
        }

        .shape:nth-child(3) {
            width: 200px;
            height: 200px;
            top: 50%;
            left: 50%;
            animation: float 25s ease-in-out infinite;
        }
/* === АДАПТАЦИЯ ПОД МАЛУЮ ШИРИНУ ЭКРАНА === */
        @media (max-width: 768px) {
            .card {
                padding: 32px 24px;
            }

            .form-options {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }
        }
/* === АДАПТАЦИЯ ПОД МАЛУЮ ВЫСОТУ ЭКРАНА === */
@media (max-height: 700px) {
    .card {
        padding: 24px 24px; /* Уменьшаем внутренние отступы карточки */
        border-radius: var(--radius-lg); /* Чуть менее скругленные углы для экономии места */
    }
    
    .logo {
        width: 48px;
        height: 48px;
        margin: 0 auto 16px; /* Уменьшаем отступ под логотипом */
    }
    
    .logo svg {
        width: 24px;
        height: 24px;
    }
    
    .card h1 {
        font-size: 24px; /* Уменьшаем заголовок */
        margin-bottom: 4px;
    }
    
    .card p.subtitle {
        font-size: 13px;
        margin-bottom: 16px; /* Уменьшаем отступ до формы */
    }
    
    .form-group {
        margin-bottom: 12px; /* Уменьшаем расстояние между полями ввода */
    }
    
    .form-group label {
        margin-bottom: 4px;
        font-size: 12px;
    }
    
    .form-group input {
        padding: 10px 16px 10px 44px; /* Делаем поля ввода чуть ниже */
        font-size: 13px;
    }
    
    .input-wrapper svg {
        width: 16px;
        height: 16px;
    }
    
    .form-options {
        margin-bottom: 16px; /* Уменьшаем отступы в блоке опций */
    }
    
    .divider {
        margin: 16px 0; /* Уменьшаем отступы у разделителя "или" */
    }
    
    .social-btns {
        margin-bottom: 16px;
    }
    
    .btn-primary {
        padding: 12px; /* Чуть более компактная кнопка */
    }
    
    .switch-text {
        font-size: 13px;
    }
}