html, body {
            height: 100%;
            overflow: hidden;
        }

        body {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            padding: 20px;
            box-sizing: border-box;
        }
        
        /* Статичный фон (без анимации — фиксированный viewport) */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
        }
        
        .login-container {
            max-width: 420px;
            width: 100%;
            padding: 0;
            position: relative;
            z-index: 1;
            margin: auto;
        }
        
        .login-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            animation: slideIn 0.6s ease-out;
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .logo-container {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .logo-container img {
            max-width: 180px;
            height: auto;
            margin-bottom: 15px;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
        }
        
        .system-title {
            color: #4a5568;
            font-size: 1.4rem;
            font-weight: 600;
            margin: 0 0 10px 0;
            text-align: center;
        }
        
        .system-subtitle {
            color: #718096;
            font-size: 0.9rem;
            margin: 0 0 25px 0;
            text-align: center;
        }
        
        .form-group {
            margin-bottom: 20px;
            position: relative;
        }
        
        .form-group label {
            color: #4a5568;
            font-weight: 500;
            margin-bottom: 8px;
            display: block;
        }
        
        .form-control {
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            padding: 12px 15px 12px 52px !important;
            font-size: 16px;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.9);
            width: 100%;
        }
        
        .form-control:focus {
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
            outline: none;
            background: white;
        }
        
        .input-container {
            position: relative;
        }
        
        .input-icon {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: #a0aec0;
            font-size: 15px;
            pointer-events: none;
            z-index: 2;
            width: 15px;
            text-align: center;
        }
        
        .password-toggle {
            position: absolute;
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #a0aec0;
            cursor: pointer;
            padding: 4px 6px;
            font-size: 15px;
            z-index: 2;
            transition: color 0.2s ease;
        }
        .password-toggle:hover { color: #6366f1; }
        
        .btn-login .spinner-border {
            width: 18px;
            height: 18px;
            border-width: 2px;
            margin-right: 8px;
            display: none;
        }
        .btn-login.loading .spinner-border { display: inline-block; }
        .btn-login.loading .btn-text-icon { display: none; }
        
        @media (prefers-reduced-motion: reduce) {
            body::before { animation: none; }
            .login-card { animation: none; }
            .alert { animation: none; }
        }
        
.btn.btn-login {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            border: none;
            border-radius: 12px;
            padding: 14px;
            width: 100%;
            font-size: 16px;
            font-weight: 600;
            color: #fff !important;
            transition: all 0.3s ease;
            margin-top: 10px;
        }
        
        .btn.btn-login:hover,
        .btn.btn-login:focus,
        .btn.btn-login:active {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
            color: #fff !important;
        }
        
        .btn.btn-login:active {
            transform: translateY(0);
        }
        
        .alert {
            border-radius: 12px;
            border: none;
            margin-bottom: 20px;
            animation: fadeIn 0.4s ease-out;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .alert-danger {
            background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
            color: white;
        }
        
        .alert-success {
            background: linear-gradient(135deg, #68d391 0%, #48bb78 100%);
            color: white;
        }

        .alert-warning, .alert-message {
            background: rgba(102, 126, 234, 0.08);
            border: 1.5px solid rgba(102, 126, 234, 0.25);
            color: #4a5568;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
        }
        .alert-warning i, .alert-message i {
            color: #6366f1;
            font-size: 15px;
            flex-shrink: 0;
        }
        
        /* ── Remember me ── */
        .remember-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 9px 14px;
            border-radius: 10px;
            background: rgba(102, 126, 234, 0.05);
            border: 1.5px solid rgba(102, 126, 234, 0.18);
            transition: background 0.2s ease, border-color 0.2s ease;
            cursor: pointer;
            user-select: none;
            margin-bottom: 0;
        }
        .remember-row:hover {
            background: rgba(102, 126, 234, 0.09);
            border-color: rgba(102, 126, 234, 0.35);
        }

        /* Скрываем нативный чекбокс полностью */
        .remember-checkbox {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        /* Кастомный визуальный чекбокс */
        .remember-custom-box {
            width: 18px;
            height: 18px;
            min-width: 18px;
            border: 2px solid #c3cfe2;
            border-radius: 5px;
            background: white;
            position: relative;
            transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
            flex-shrink: 0;
        }
        .remember-custom-box::after {
            content: '';
            position: absolute;
            left: 4px;
            top: 1px;
            width: 6px;
            height: 10px;
            border: 2px solid white;
            border-top: none;
            border-left: none;
            transform: rotate(45deg) scale(0);
            transition: transform 0.18s ease;
        }
        .remember-checkbox:checked ~ .remember-label .remember-custom-box,
        .remember-row.is-checked .remember-custom-box {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            border-color: #6366f1;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
        }
        .remember-checkbox:checked ~ .remember-label .remember-custom-box::after,
        .remember-row.is-checked .remember-custom-box::after {
            transform: rotate(45deg) scale(1);
        }

        .remember-text {
            color: #4a5568;
            font-size: 13.5px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .remember-text i {
            color: #6366f1;
            font-size: 13px;
            opacity: 0.8;
        }
        .remember-label {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            cursor: pointer;
            margin: 0;
        }

        /* ── Divider before button ── */
        .form-divider {
            height: 1px;
            background: linear-gradient(to right, transparent, #e2e8f0, transparent);
            margin: 20px 0 2px;
        }

        .footer-text {
            text-align: center;
            margin-top: 25px;
            color: #718096;
            font-size: 0.85rem;
        }
        .footer-text .login-shield-muted { opacity: 0.5; }
        
        @media (max-width: 480px) {
            .login-card {
                padding: 30px 25px;
            }
            
            .login-container {
                margin: 0 auto;
                padding: 15px;
            }

            .logo-container img {
                max-width: 100px;
            }
            
            .system-title {
                font-size: 1.2rem;
            }
        }
        
        @media (max-height: 700px) {
            .login-card {
                padding: 25px 30px;
            }
            .logo-container {
                margin-bottom: 18px;
            }
            .logo-container img {
                max-width: 120px;
                margin-bottom: 10px;
            }
            .system-subtitle {
                margin-bottom: 16px;
            }
            .form-group {
                margin-bottom: 14px;
            }
        }
