/* Extracted from PHP template; preserve original cascade position. */
:root {
            --med-primary: #0e7490;
            --med-primary-dark: #155e75;
            --med-accent: #06b6d4;
            --med-bg: #f8fbfd;
            --med-text: #0f172a;
            --med-muted: #64748b;
            --med-border: #e2e8f0;
            --med-danger-bg: #fef2f2;
            --med-danger-border: #fecaca;
            --med-danger-text: #b91c1c;
        }

        * { box-sizing: border-box; }

        html, body { height: 100%; }

        body {
            margin: 0;
            min-height: 100vh;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            color: var(--med-text);
            background: var(--med-bg);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            position: relative;
            overflow-x: hidden;
        }

        /* Мягкие световые пятна на фоне */
        body::before,
        body::after {
            content: "";
            position: fixed;
            border-radius: 50%;
            filter: blur(80px);
            pointer-events: none;
            z-index: 0;
        }
        body::before {
            width: 420px; height: 420px;
            top: -140px; left: -120px;
            background: rgba(6, 182, 212, 0.18);
        }
        body::after {
            width: 460px; height: 460px;
            bottom: -160px; right: -140px;
            background: rgba(14, 116, 144, 0.14);
        }

        /* Карточка */
        .login-card {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 420px;
            background: #ffffff;
            border-radius: 20px;
            padding: 44px 40px 36px;
            box-shadow:
                0 1px 2px rgba(15, 23, 42, 0.04),
                0 12px 32px -12px rgba(14, 116, 144, 0.16),
                0 0 0 1px rgba(226, 232, 240, 0.6);
            animation: rise 0.5s cubic-bezier(.22, 1, .36, 1) both;
        }

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

        /* Шапка карточки */
        .card-head {
            text-align: center;
            margin-bottom: 32px;
        }

        .logo {
            width: 56px;
            height: 56px;
            margin: 0 auto 18px;
            display: grid;
            place-items: center;
            background: #ffffff;
            border-radius: 16px;
            box-shadow:
                0 0 0 1px rgba(226, 232, 240, 0.9),
                0 8px 20px -10px rgba(14, 116, 144, 0.35);
        }

        .logo img {
            width: 40px;
            height: 40px;
            object-fit: contain;
        }

        .card-head h1 {
            font-size: 21px;
            font-weight: 700;
            letter-spacing: -0.01em;
            margin: 0 0 6px;
            color: var(--med-text);
        }

        .card-head p {
            font-size: 13.5px;
            color: var(--med-muted);
            margin: 0;
        }

        /* Ошибка */
        .alert-danger {
            display: flex;
            align-items: center;
            gap: 9px;
            background: var(--med-danger-bg);
            border: 1px solid var(--med-danger-border);
            color: var(--med-danger-text);
            border-radius: 10px;
            padding: 11px 14px;
            font-size: 13px;
            line-height: 1.4;
            margin-bottom: 20px;
            animation: shake 0.35s ease;
        }

        .alert-danger svg { flex-shrink: 0; width: 16px; height: 16px; }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-3px); }
            75% { transform: translateX(3px); }
        }

        /* Поля */
        .field { margin-bottom: 16px; }

        .field label {
            display: block;
            font-size: 12.5px;
            font-weight: 600;
            color: var(--med-text);
            margin-bottom: 6px;
        }

        .input-wrap {
            position: relative;
            display: flex;
            align-items: center;
            background: #f8fafc;
            border: 1.5px solid var(--med-border);
            border-radius: 11px;
            transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
        }

        .input-wrap:focus-within {
            background: #ffffff;
            border-color: var(--med-primary);
            box-shadow: 0 0 0 3.5px rgba(14, 116, 144, 0.1);
        }

        .input-wrap svg {
            width: 17px;
            height: 17px;
            color: #94a3b8;
            margin-left: 14px;
            flex-shrink: 0;
            transition: color 0.18s;
        }

        .input-wrap:focus-within svg { color: var(--med-primary); }

        .input-wrap input {
            flex: 1;
            width: 100%;
            padding: 12px 14px 12px 10px;
            font-size: 14px;
            font-family: inherit;
            color: var(--med-text);
            background: transparent;
            border: none;
            outline: none;
        }

        .input-wrap input::placeholder { color: #94a3b8; }

        /* Показ пароля */
        .pw-toggle {
            background: none;
            border: none;
            color: #94a3b8;
            padding: 8px 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: color 0.18s;
        }
        .pw-toggle:hover { color: var(--med-primary); }
        .pw-toggle svg { width: 17px; height: 17px; margin: 0; }

        /* Запомнить меня */
        .form-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 4px 0 22px;
        }

        .checkbox {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: var(--med-muted);
            cursor: pointer;
            user-select: none;
        }

        .checkbox input {
            width: 16px;
            height: 16px;
            accent-color: var(--med-primary);
            cursor: pointer;
        }

        /* Кнопка */
        .btn-login {
            width: 100%;
            padding: 13px 20px;
            font-size: 14.5px;
            font-weight: 600;
            font-family: inherit;
            color: #ffffff;
            background: linear-gradient(135deg, var(--med-primary) 0%, var(--med-primary-dark) 100%);
            border: none;
            border-radius: 11px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
            box-shadow: 0 8px 18px -8px rgba(14, 116, 144, 0.55);
        }

        .btn-login svg { width: 17px; height: 17px; }

        .btn-login:hover {
            filter: brightness(1.05);
            box-shadow: 0 12px 24px -8px rgba(14, 116, 144, 0.65);
            transform: translateY(-1px);
        }

        .btn-login:active { transform: translateY(0); }

        /* Регистрация */
        .register-link {
            text-align: center;
            margin-top: 20px;
            font-size: 13px;
            color: var(--med-muted);
        }

        .register-link a {
            color: var(--med-primary);
            font-weight: 600;
            text-decoration: none;
            transition: color 0.18s;
        }
        .register-link a:hover { color: var(--med-primary-dark); text-decoration: underline; }

        /* Подвал */
        .card-foot {
            text-align: center;
            margin-top: 26px;
            padding-top: 20px;
            border-top: 1px solid var(--med-border);
            font-size: 11.5px;
            color: #94a3b8;
            line-height: 1.5;
        }

        /* Адаптив */
        @media (max-width: 480px) {
            body { padding: 16px; }
            .login-card { padding: 34px 24px 28px; border-radius: 16px; }
            .card-head h1 { font-size: 19px; }
        }
