
        :root {
            --font-base: "Public Sans", Arial, Helvetica, sans-serif;
            --primary: #6b5dd3;
            --primary-hover: #5a4cb1;
            --primary-light: rgba(107, 93, 211, 0.2);
            --text-main: #11142d;
            --text-body: #2c2d3e;
            --text-muted: #808191;
            --text-placeholder: #9ca3af;
            --bg-card: #ffffff;
            --bg-input: #fcfcfd;
            --border-light: #f3f4f6;
            --border-input: #e5e7eb;
            --error-bg: #fef2f2;
            --error-text: #dc2626;
            --error-border: #fee2e2;
            --success-bg: #4f1f9b;
            --warning: #f59e0b;
            --shadow-sm: 0 8px 30px rgba(0, 0, 0, 0.04);
            --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
            --shadow-primary: 0 10px 15px -3px rgba(107, 93, 211, 0.25);
        }

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

        html {
            min-height: 100%;
        }

        body {
            font-family: var(--font-base);
            color: var(--text-body);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            /* Фон входа (06.10.2026): иллюстрация, карточка — в пустой середине. Пока картинка
               грузится — ровный цвет в её тон. Прежний «переливающийся» градиент убран: его
               анимация двигала background-position и сдвигала бы картинку. */
            background: #eceefb url("/image/login-bg.webp") center / cover no-repeat;
        }

        button,
        input {
            font: inherit;
        }

        button:focus-visible,
        input:focus-visible,
        a:focus-visible {
            outline: 3px solid var(--primary-light);
            outline-offset: 2px;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes float {
            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-6px);
            }
        }

        @keyframes shake {
            0%,
            100% {
                transform: translateX(0);
            }

            25% {
                transform: translateX(-8px);
            }

            50% {
                transform: translateX(8px);
            }

            75% {
                transform: translateX(-8px);
            }
        }

        @keyframes spin {
            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        .animate-fade-up {
            animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            opacity: 0;
        }

        .animate-float {
            animation: float 4s ease-in-out infinite;
        }

        .animate-shake {
            animation: shake 0.4s ease-in-out !important;
        }

        .animate-spin {
            animation: spin 1s linear infinite;
        }

        .d-1 {
            animation-delay: 100ms;
        }

        .d-2 {
            animation-delay: 200ms;
        }

        .d-3 {
            animation-delay: 300ms;
        }

        .d-4 {
            animation-delay: 400ms;
        }

        .d-5 {
            animation-delay: 500ms;
        }

        /* 3D-сцена за карточкой: проявляется после первого кадра, клики проходят сквозь. */
        .login-scene {
            position: fixed;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.8s ease;
        }

        .login-scene.is-ready {
            opacity: 1;
        }

        .login-card {
            position: relative;
            z-index: 1;
            background: var(--bg-card);
            width: 100%;
            max-width: 28rem;
            border-radius: 8px;
            box-shadow: var(--shadow-sm);
            padding: 2rem;
            border: 1px solid var(--border-light);
            position: relative;
            z-index: 10;
            transition: box-shadow 0.5s;
        }

        .login-card:hover {
            box-shadow: var(--shadow-md);
        }

        /* ── Вход через 3D-сцену (public/js/core/login-gate.js, scripts/login-scene) ──
           html.scene-gate — карточка скрыта до нажатия на офис; .scene-live — сцена
           отрисована (видны метка и подсказка); .scene-open — карточка раскрыта.
           Своё появление карточки — переходом (её fadeInUp с forwards перебил бы
           opacity); у полей — прежний каскад fadeInUp, стоит на паузе до раскрытия. */
        .scene-enter,
        .scene-hint,
        .login-card-close {
            display: none;
        }

        html.scene-gate .login-card {
            animation: none;
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transform: translateY(18px) scale(0.96);
            transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s, box-shadow 0.5s;
        }

        html.scene-gate.scene-open .login-card {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
            transform: none;
            transition: opacity 0.4s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s, box-shadow 0.5s;
        }

        html.scene-gate:not(.scene-open) .login-card .animate-fade-up {
            animation-play-state: paused;
        }

        html.scene-gate.scene-live:not(.scene-open) .login-scene {
            pointer-events: auto;
        }

        html.scene-gate .login-card-close {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 0;
            border-radius: 50%;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
        }

        html.scene-gate .login-card-close:hover {
            background: var(--border-light);
            color: var(--text-main);
        }

        /* Метка «Войти» над офисом: left/top — точка над крышей (ставит сцена), хвостик — к зданию. */
        html.scene-gate.scene-live:not(.scene-open) .scene-enter {
            position: fixed;
            left: 50%;
            top: 30%;
            z-index: 5;
            display: block;
            padding: 0;
            border: 0;
            background: none;
            transform: translate(-50%, calc(-100% - 8px));
            cursor: pointer;
            animation: sceneEnterIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
        }

        .scene-enter-label {
            position: relative;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 11px 22px;
            border-radius: 999px;
            background: var(--primary);
            color: #fff;
            font-size: 16px;
            font-weight: 700;
            letter-spacing: 0.02em;
            white-space: nowrap;
            box-shadow: 0 12px 28px rgba(107, 93, 211, 0.45);
            transition: background 0.2s, transform 0.2s;
            animation: float 3s ease-in-out infinite;
        }

        .scene-enter-label::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            border: 2px solid var(--primary);
            animation: scenePulse 2s ease-out infinite;
            pointer-events: none;
        }

        .scene-enter-label::after {
            content: "";
            position: absolute;
            left: 50%;
            bottom: -8px;
            border: 8px solid transparent;
            border-bottom: 0;
            border-top-color: var(--primary);
            transform: translateX(-50%);
            transition: border-color 0.2s;
        }

        .scene-enter:hover .scene-enter-label,
        .scene-enter:focus-visible .scene-enter-label {
            background: var(--primary-hover);
        }

        .scene-enter:hover .scene-enter-label::after,
        .scene-enter:focus-visible .scene-enter-label::after {
            border-top-color: var(--primary-hover);
        }

        .scene-enter:focus-visible {
            outline: none;
        }

        .scene-enter:focus-visible .scene-enter-label {
            outline: 3px solid var(--primary-light);
            outline-offset: 3px;
        }

        html.scene-gate.scene-live:not(.scene-open) .scene-hint {
            position: fixed;
            left: 50%;
            bottom: 28px;
            z-index: 5;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 18px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.92);
            box-shadow: var(--shadow-md);
            color: var(--text-main);
            font-size: 14px;
            font-weight: 600;
            white-space: nowrap;
            transform: translateX(-50%);
            pointer-events: none;
            animation: sceneHintIn 0.6s ease 0.9s both;
        }

        .scene-hint .icon {
            width: 18px;
            height: 18px;
            color: var(--primary);
        }

        /* Подписи-статусы сцены: left/top — точка над объектом (ставит сцена), хвостик — вниз к нему;
           .is-side — сбоку слева (у офиса: над крышей — «Войти»). Видна — .is-on (ставит сцена по времени). */
        .scene-tags {
            display: none;
        }

        html.scene-gate.scene-live:not(.scene-open) .scene-tags {
            display: block;
        }

        .scene-tag {
            position: fixed;
            left: 0;
            top: 0;
            z-index: 4;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 7px 13px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.96);
            box-shadow: 0 10px 24px rgba(107, 93, 211, 0.22);
            color: var(--text-main);
            font-size: 13px;
            font-weight: 700;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            transform: translate(-50%, calc(-100% - 8px)) scale(0.85);
            transform-origin: 50% 100%;
            transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .scene-tag.is-on {
            opacity: 1;
            transform: translate(-50%, calc(-100% - 8px)) scale(1);
        }

        .scene-tag::after {
            content: "";
            position: absolute;
            left: 50%;
            bottom: -6px;
            border: 6px solid transparent;
            border-bottom: 0;
            border-top-color: rgba(255, 255, 255, 0.96);
            transform: translateX(-50%);
        }

        .scene-tag.is-side {
            transform: translate(calc(-100% - 10px), -50%) scale(0.85);
            transform-origin: 100% 50%;
        }

        .scene-tag.is-side.is-on {
            transform: translate(calc(-100% - 10px), -50%) scale(1);
        }

        .scene-tag.is-side::after {
            left: auto;
            right: -6px;
            bottom: auto;
            top: 50%;
            border: 6px solid transparent;
            border-right: 0;
            border-left-color: rgba(255, 255, 255, 0.96);
            transform: translateY(-50%);
        }

        .scene-tag .icon {
            width: 16px;
            height: 16px;
            color: var(--primary);
        }

        .scene-tag.is-done .icon {
            color: #28c76f;
        }

        .scene-tag.is-pay .icon {
            color: #ff9f43;
        }

        .scene-tag.is-debt .icon {
            color: #ea5455;
        }

        @keyframes sceneEnterIn {
            from {
                opacity: 0;
                transform: translate(-50%, calc(-100% + 10px));
            }
        }

        @keyframes sceneHintIn {
            from {
                opacity: 0;
            }
        }

        @keyframes scenePulse {
            from {
                opacity: 0.8;
                transform: scale(1);
            }

            to {
                opacity: 0;
                transform: scale(1.35, 1.7);
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .scene-tag {
                transition: none;
            }

            .scene-enter-label,
            .scene-enter-label::before {
                animation: none;
            }
        }

        .header-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 2rem;
        }

        /* Логотип входа NEXTRA (logo_login.png) — прозрачный PNG, ложится
           прямо на карточку без подложки. Кроп по контенту. */
        .brand-logo {
            display: inline-flex;
            margin-bottom: 1.5rem;
        }

        .brand-logo-img {
            display: block;
            width: 249px;
            height: 166px;
            background: url("/image/logo_login.png") 0 0 / 249px 166px no-repeat;
        }

        .page-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-main);
            margin-bottom: 0.5rem;
        }

        .page-subtitle {
            color: var(--text-muted);
            font-size: var(--text-base);
            text-align: center;
            line-height: 1.25rem;
        }

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

        .form-label {
            display: block;
            font-size: var(--text-sm);
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            margin-bottom: 0.4rem;
            margin-left: 0.25rem;
        }

        .input-wrapper {
            position: relative;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .input-wrapper:focus-within {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px -5px rgba(107, 93, 211, 0.15);
        }

        .input-icon-left {
            position: absolute;
            top: 50%;
            left: 1rem;
            transform: translateY(-50%);
            color: var(--text-placeholder);
            pointer-events: none;
            display: flex;
        }

        .form-input {
            width: 100%;
            padding: 0.875rem 1rem 0.875rem 2.75rem;
            background: var(--bg-input);
            border: 1px solid var(--border-input);
            border-radius: 8px;
            font-size: 15px;
            font-weight: 500;
            color: var(--text-main);
            transition: all 0.2s;
            outline: none;
        }

        .form-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px var(--primary-light);
            background: transparent;
        }

        .btn-toggle-pwd,
        .input-action-btn {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-placeholder);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .actions-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            margin: 0.5rem 0 1rem;
        }

        .checkbox-label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            font-size: var(--text-base);
            color: var(--text-muted);
            user-select: none;
        }

        .checkbox-input {
            appearance: none;
            width: 1.25rem;
            height: 1.25rem;
            border: 2px solid var(--border-input);
            border-radius: 0.25rem;
            cursor: pointer;
            position: relative;
            flex-shrink: 0;
        }

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

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

        .link-primary {
            font-size: var(--text-base);
            color: var(--primary);
            text-decoration: none;
            white-space: nowrap;
        }

        .link-primary:hover {
            color: var(--primary-hover);
            text-decoration: underline;
        }

        .btn-submit {
            width: 100%;
            background: var(--primary);
            color: white;
            font-weight: 600;
            font-size: 15px;
            padding: 1rem;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            box-shadow: var(--shadow-primary);
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-submit:hover:not(:disabled) {
            background: var(--primary-hover);
            box-shadow: 0 10px 20px -3px rgba(107, 93, 211, 0.4);
        }

        .btn-submit:active:not(:disabled) {
            transform: scale(0.98);
        }

        .btn-submit:disabled {
            opacity: 0.8;
            cursor: wait;
        }

        .btn-authorized {
            background: linear-gradient(135deg, #6b5dd3 0%, #4f46e5 100%) !important;
            box-shadow: 0 10px 20px -3px rgba(79, 70, 229, 0.35) !important;
        }

        .btn-authorized:hover:not(:disabled) {
            background: linear-gradient(135deg, #5a4cb1 0%, #4338ca 100%) !important;
            box-shadow: 0 12px 24px -4px rgba(79, 70, 229, 0.42) !important;
        }

        .btn-success {
            background: var(--success-bg) !important;
            box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.25) !important;
        }

        .error-box {
            margin-bottom: 1rem;
            padding: 0.75rem;
            background: var(--error-bg);
            border: 1px solid var(--error-border);
            border-radius: 8px;
            display: none;
            align-items: center;
            gap: 0.5rem;
            color: var(--error-text);
            font-size: var(--text-sm);
            font-weight: 700;
            transition: all 0.3s;
        }

        .footer-text {
            margin-top: 2rem;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border-light);
            text-align: center;
            font-size: var(--text-sm);
            color: var(--text-muted);
        }

        /* Плашка языка (public/js/core/login-lang.js): сегменты RU · KZ · EN, выбранный — белой заливкой. */
        .login-lang {
            display: inline-flex;
            gap: 2px;
            margin-bottom: 0.9rem;
            padding: 3px;
            border-radius: 999px;
            background: var(--border-light);
        }

        .login-lang-btn {
            min-width: 42px;
            padding: 5px 10px;
            border: 0;
            border-radius: 999px;
            background: transparent;
            color: var(--text-muted);
            font: inherit;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.04em;
            cursor: pointer;
            transition: background 0.2s, color 0.2s, box-shadow 0.2s;
        }

        .login-lang-btn:hover {
            color: var(--text-main);
        }

        .login-lang-btn[aria-pressed="true"] {
            background: var(--bg-card);
            color: var(--primary);
            box-shadow: var(--shadow-sm);
        }

        .login-lang-btn:focus-visible {
            outline: 2px solid var(--primary-light);
            outline-offset: 1px;
        }

        /* Та же плашка на сцене — внизу справа, в стиле подсказки; только пока карточка скрыта. */
        .scene-lang {
            display: none;
        }

        html.scene-gate.scene-live:not(.scene-open) .scene-lang {
            position: fixed;
            right: 28px;
            bottom: 28px;
            z-index: 5;
            display: inline-flex;
            margin: 0;
            padding: 4px;
            background: rgba(255, 255, 255, 0.92);
            box-shadow: var(--shadow-md);
            animation: sceneHintIn 0.6s ease 0.9s both;
        }

        .scene-lang .login-lang-btn {
            min-width: 44px;
            padding: 7px 12px;
            font-size: 13px;
        }

        .scene-lang .login-lang-btn[aria-pressed="true"] {
            background: var(--primary);
            color: #fff;
        }

        .modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 50;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
        }

        .modal-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(17, 20, 45, 0.3);
            backdrop-filter: blur(2px);
            transition: opacity 0.4s ease;
        }

        .modal-content {
            background: var(--bg-card);
            width: 90%;
            max-width: 24rem;
            border-radius: 8px;
            padding: 2rem;
            position: relative;
            z-index: 10;
            border: 1px solid var(--border-light);
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
        }

        .modal-title {
            color: var(--text-main);
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .modal-subtitle {
            color: var(--text-muted);
            font-size: var(--text-base);
            margin-bottom: 1.5rem;
        }

        #resetModal.hidden,
        #resetModal:not(.is-open) {
            display: none !important;
            opacity: 0 !important;
            pointer-events: none !important;
            visibility: hidden !important;
        }

        #resetModal.is-open {
            display: flex !important;
            opacity: 1 !important;
            pointer-events: auto !important;
            visibility: visible !important;
        }

        #resetModal .modal-backdrop {
            z-index: 1;
        }

        #resetModal .modal-content {
            z-index: 2;
        }

        .icon {
            width: 20px;
            height: 20px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .hidden {
            display: none !important;
        }

        .opacity-0 {
            opacity: 0;
        }

        .pointer-events-none {
            pointer-events: none;
        }

        .scale-95 {
            transform: scale(0.95);
        }

        .scale-100 {
            transform: scale(1);
        }

        #toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-width: min(360px, calc(100vw - 40px));
        }

        .toast {
            padding: 12px 20px;
            border-radius: 8px;
            background: #fff;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
            font-size: 13px;
            font-weight: 600;
            border-left: 4px solid var(--primary);
            animation: slideIn 0.3s ease forwards;
            word-break: break-word;
            transition: opacity 0.3s ease; /* Добавить эту строку */
        }

        @media (max-width: 480px) {
            .login-card {
                padding: 1.5rem;
                border-radius: 8px;
            }

            .actions-row {
                align-items: flex-start;
                flex-direction: column;
            }

            .modal-content {
                width: 100%;
                padding: 1.5rem;
            }
        }

        /* Телефон: шрифт полей ≥ 16px — iOS Safari иначе увеличивает страницу
           при фокусе. Как в панели (6-utils/helpers.css), сюда тот не подключён. */
        @media (max-width: 768px), (pointer: coarse) {
            input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
            select,
            textarea {
                font-size: 16px;
            }
        }

/* Подсказки (nx-tooltip.js) — тот же вид, что в панели (tables.css .nx-floating-tip). */
.nx-floating-tip {
    position: fixed;
    z-index: 100000;
    background-color: #2f3349;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: pre-line;
    width: max-content;
    max-width: min(320px, calc(100vw - 8px));
    box-shadow: 0 4px 10px rgba(47, 43, 61, 0.2);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
}
.nx-floating-tip.is-visible { visibility: visible; }
.nx-floating-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--nx-tip-arrow, 50%);
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #2f3349;
}
.nx-floating-tip.nx-floating-tip--below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #2f3349;
}
