/*
 * Экран входа CRM (26.10.2026).
 *
 * Токены — из дизайн-системы CRM (detagram-ui.css): фиолетовый #7166a7,
 * белые поверхности, крупные скругления. Фон экрана тёмный, как и раньше:
 * по нему мост приложения красит строку состояния (mobile-bridge.js), и
 * светлый фон дал бы светлую полосу над тёмными значками.
 *
 * Всё живёт внутри .lg — правила не выходят за экран входа. Анимации —
 * только transform и opacity: на слабом телефоне фон не должен мешать
 * набирать пароль. При «уменьшить движение» в системе фон стоит на месте.
 */

.lg {
    --lg-bg: #0b0a12;
    --lg-ink: #3c4255;
    --lg-muted: #747b8e;
    --lg-line: #e3e5ee;
    --lg-field: #f6f7fb;
    --lg-purple: #7166a7;
    --lg-purple-dark: #5c528e;
    --lg-purple-soft: #eeebfa;
    --lg-magenta: #ce44e8;
    --lg-pink: #e17af5;
    --lg-rose: #ce305b;
    --lg-gold: #f5b400;
    --lg-cream: #f9f7db;
    --lg-danger: #c43d5f;
    --lg-radius: 26px;
    --lg-field-radius: 14px;
    --lg-ease: cubic-bezier(.2, .8, .2, 1);

    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(28px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 16px calc(20px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    color: var(--lg-ink);
    font-feature-settings: "tnum" 1;
    isolation: isolate;
}

/* Макет Orchid кладёт страницу в колонку col-lg-9 с полями — двухколоночной
   карточке там тесно. На экранах входа колонка во всю ширину. */
body:is(.page-login, .page-two-factor-login),
body:has(.lg) {
    background: #0b0a12;
}

body:has(.lg) > .container-fluid,
body:has(.lg) > .container-fluid > .row > [class*="col"] {
    max-width: none;
    flex: 0 0 100%;
    padding-left: 0;
    padding-right: 0;
}

body:has(.lg) > .container-fluid > .row { margin: 0; }

/* Кнопка блокировки экрана из crm-lock.js на входе ни к чему: блокировать
   ещё нечего. */
body:has(.lg) .crm-lock-btn { display: none !important; }

/* ————————————————————————— Фон ————————————————————————— */

.lg-scene {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 50% 120%, #1c1430 0%, transparent 60%),
        radial-gradient(90% 70% at 50% -20%, #171226 0%, transparent 65%),
        var(--lg-bg);
    pointer-events: none;
}

/* Сияние: четыре размытых пятна цветов логотипа медленно плывут.
   Сдвиг от мыши — через --px/--py, их ставит crm-login.js. */
.lg-aurora {
    position: absolute;
    inset: -20%;
    transform: translate3d(calc(var(--px, 0) * -18px), calc(var(--py, 0) * -14px), 0);
    transition: transform 1.2s var(--lg-ease);
}

.lg-aurora i {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(72px);
    opacity: .7;
    will-change: transform;
}

.lg-aurora .a1 { width: 46vmax; height: 46vmax; left: 4%;  top: 6%;  background: radial-gradient(circle, #7166a7 0%, transparent 68%); animation: lg-drift-1 26s ease-in-out infinite; }
.lg-aurora .a2 { width: 38vmax; height: 38vmax; right: 2%; top: 0;   background: radial-gradient(circle, #ce44e8 0%, transparent 66%); opacity: .38; animation: lg-drift-2 31s ease-in-out infinite; }
.lg-aurora .a3 { width: 40vmax; height: 40vmax; right: 12%; bottom: -4%; background: radial-gradient(circle, #f5b400 0%, transparent 64%); opacity: .22; animation: lg-drift-3 34s ease-in-out infinite; }
.lg-aurora .a4 { width: 34vmax; height: 34vmax; left: 16%; bottom: 0; background: radial-gradient(circle, #ce305b 0%, transparent 66%); opacity: .32; animation: lg-drift-2 29s ease-in-out infinite reverse; }

@keyframes lg-drift-1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    33%      { transform: translate3d(12vw, 8vh, 0) scale(1.12); }
    66%      { transform: translate3d(-6vw, 14vh, 0) scale(.94); }
}

@keyframes lg-drift-2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-14vw, 12vh, 0) scale(1.15); }
}

@keyframes lg-drift-3 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
    40%      { transform: translate3d(-10vw, -10vh, 0) scale(.9); }
    75%      { transform: translate3d(6vw, -4vh, 0) scale(1.1); }
}

/* Изометрическая сетка — «пол», уходящий вдаль. Едет на один шаг узора и
   начинает заново, поэтому шва не видно. */
.lg-grid {
    position: absolute;
    inset: 0;
    -webkit-mask-image: radial-gradient(70% 60% at 50% 55%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 85%);
            mask-image: radial-gradient(70% 60% at 50% 55%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 85%);
}

.lg-grid::before {
    content: "";
    position: absolute;
    top: -64px;
    left: -112px;
    right: -112px;
    bottom: -64px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='112' height='64.66' viewBox='0 0 112 64.66'%3E%3Cpath d='M0 0L112 64.66M0 64.66L112 0M56 0v64.66' stroke='%23ffffff' stroke-opacity='.055' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    background-size: 112px 64.66px;
    animation: lg-grid-pan 14s linear infinite;
    will-change: transform;
}

@keyframes lg-grid-pan {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(112px, 64.66px, 0); }
}

/* Каркасные кубики. Слой сдвигается от мыши сильнее сияния — глубина. */
.lg-cubes {
    position: absolute;
    inset: 0;
    transform: translate3d(calc(var(--px, 0) * 26px), calc(var(--py, 0) * 20px), 0);
    transition: transform 1.2s var(--lg-ease);
}

.lg-cube {
    position: absolute;
    width: var(--s, 60px);
    height: calc(var(--s, 60px) * 1.155);
    left: var(--x);
    top: var(--y);
    opacity: var(--o, .5);
    animation: lg-bob var(--d, 9s) ease-in-out var(--dl, 0s) infinite;
    will-change: transform;
}

.lg-cube svg { width: 100%; height: 100%; display: block; overflow: visible; }

.lg-cube.is-solid { filter: drop-shadow(0 18px 30px rgba(206, 68, 232, .25)); }

@keyframes lg-bob {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50%      { transform: translate3d(0, -26px, 0) rotate(var(--r, 4deg)); }
}

/* Искры: точки, которые поднимаются и гаснут. Создаёт crm-login.js. */
.lg-sparks { position: absolute; inset: 0; }

.lg-sparks i {
    position: absolute;
    bottom: -10px;
    width: var(--z, 3px);
    height: var(--z, 3px);
    border-radius: 50%;
    background: var(--c, #fff);
    box-shadow: 0 0 8px 1px var(--c, #fff);
    opacity: 0;
    animation: lg-rise var(--d, 14s) linear var(--dl, 0s) infinite;
    will-change: transform, opacity;
}

@keyframes lg-rise {
    0%   { transform: translate3d(0, 0, 0); opacity: 0; }
    10%  { opacity: var(--o, .7); }
    80%  { opacity: var(--o, .7); }
    100% { transform: translate3d(var(--dx, 20px), -105vh, 0); opacity: 0; }
}

/* Зерно убирает полосы на градиентах тёмного фона. */
.lg-grain {
    position: absolute;
    inset: 0;
    opacity: .06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ————————————————————————— Карточка ————————————————————————— */

.lg-card {
    position: relative;
    z-index: 1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    border-radius: var(--lg-radius);
    background: #fff;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .6) inset,
        0 40px 90px -30px rgba(0, 0, 0, .75),
        0 18px 50px -24px rgba(113, 102, 167, .55);
    animation: lg-enter .9s var(--lg-ease) both;
}

/* Живая кайма: градиент цветов логотипа медленно обходит карточку. Кольцо
   вырезано маской, а не подложено под карточку: анимация входа делает
   карточку отдельным слоем, и подложка легла бы поверх белого фона. */
.lg-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--lg-ang, 0deg), #7166a7, #ce44e8, #f5b400, #ce305b, #7166a7);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: .9;
    pointer-events: none;
    animation: lg-spin 9s linear infinite;
}

.lg-stage {
    position: relative;
    width: 100%;
    max-width: 440px;
    display: flex;
    justify-content: center;
}

/* Свечение за карточкой — отдельный слой позади неё. */
.lg-glow {
    position: absolute;
    inset: 12% 8% -4%;
    border-radius: 50%;
    background: conic-gradient(from var(--lg-ang, 0deg), #7166a7, #ce44e8, #f5b400, #ce305b, #7166a7);
    filter: blur(60px);
    opacity: .32;
    pointer-events: none;
    animation: lg-spin 9s linear infinite;
}

@property --lg-ang {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes lg-spin { to { --lg-ang: 360deg; } }

@keyframes lg-enter {
    from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.975); }
    to   { opacity: 1; transform: none; }
}

/* Неверный пароль — карточка вздрагивает, чтобы ошибку заметили сразу. */
.lg-card.has-error { animation: lg-enter .9s var(--lg-ease) both, lg-shake .5s .25s ease-in-out; }

@keyframes lg-shake {
    0%, 100% { transform: none; }
    20% { transform: translate3d(-9px, 0, 0); }
    40% { transform: translate3d(8px, 0, 0); }
    60% { transform: translate3d(-5px, 0, 0); }
    80% { transform: translate3d(3px, 0, 0); }
}

/* ——— Левая панель: бренд ——— */

.lg-brand {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 40px 40px 36px;
    border-radius: var(--lg-radius) 0 0 var(--lg-radius);
    color: #fff;
    background:
        radial-gradient(120% 80% at 0% 0%, rgba(206, 68, 232, .35) 0%, transparent 55%),
        radial-gradient(90% 70% at 100% 100%, rgba(245, 180, 0, .22) 0%, transparent 60%),
        linear-gradient(160deg, #2a2346 0%, #1a1530 55%, #120f22 100%);
}

.lg-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='32.33' viewBox='0 0 56 32.33'%3E%3Cpath d='M0 0L56 32.33M0 32.33L56 0' stroke='%23ffffff' stroke-opacity='.05' fill='none'/%3E%3C/svg%3E");
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 55%, #000 100%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 55%, #000 100%);
}

.lg-brand > * { position: relative; z-index: 1; }

.lg-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.lg-logo img { display: block; }
.lg-logo .cube { width: 40px; height: auto; }
.lg-logo .word { width: 132px; height: auto; }

.lg-brand h2 {
    margin: 34px 0 10px;
    font-size: 1.6rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #fff;
}

.lg-brand h2 span {
    background: linear-gradient(90deg, #f5c8fa, #e17af5 40%, #f0d358);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}

.lg-brand p {
    margin: 0;
    max-width: 30em;
    color: rgba(255, 255, 255, .66);
    font-size: .92rem;
    line-height: 1.55;
}

.lg-art {
    display: block;
    width: 100%;
    max-width: 360px;
    height: auto;
    margin: 18px auto 6px;
    overflow: visible;
}

.lg-art .fl { animation: lg-float 6s ease-in-out infinite; transform-box: fill-box; }
.lg-art .fl-2 { animation-duration: 7.5s; animation-delay: -2s; }
.lg-art .fl-3 { animation-duration: 5.5s; animation-delay: -4s; }
.lg-art .fl-4 { animation-duration: 8s; animation-delay: -1s; }

@keyframes lg-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.lg-art .orbit { stroke-dasharray: 4 9; animation: lg-dash 18s linear infinite; }
.lg-art .orbit-2 { animation-duration: 26s; animation-direction: reverse; }

@keyframes lg-dash { to { stroke-dashoffset: -260; } }

.lg-art .glow { animation: lg-pulse 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.lg-art .glow-2 { animation-delay: -1.3s; }
.lg-art .glow-3 { animation-delay: -2.6s; }

@keyframes lg-pulse {
    0%, 100% { opacity: .35; transform: scale(.8); }
    50%      { opacity: 1; transform: scale(1.15); }
}

.lg-art .shadow { animation: lg-shadow 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes lg-shadow {
    0%, 100% { transform: scale(1); opacity: .5; }
    50%      { transform: scale(.86); opacity: .3; }
}

.lg-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lg-points li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .82);
    font-size: .78rem;
    line-height: 1;
    backdrop-filter: blur(6px);
}

.lg-points li::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c, #e17af5);
    box-shadow: 0 0 10px var(--c, #e17af5);
}

/* ——— Правая часть: форма ——— */

.lg-main {
    position: relative;
    padding: 34px 30px 30px;
}

.lg-mobile-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
    text-decoration: none;
    animation: lg-enter .9s var(--lg-ease) both;
}

.lg-mobile-logo .cube {
    width: 64px;
    height: auto;
    filter: drop-shadow(0 12px 26px rgba(206, 68, 232, .35));
    animation: lg-float 6s ease-in-out infinite;
}

.lg-mobile-logo .word { width: 148px; height: auto; opacity: .95; }

.lg-hello {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 5px 11px 5px 8px;
    border-radius: 999px;
    background: var(--lg-purple-soft);
    color: var(--lg-purple-dark);
    font-size: .78rem;
    font-weight: 600;
}

.lg-hello svg { width: 16px; height: 16px; }

.lg-title {
    margin: 0 0 6px;
    font-size: 1.55rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.015em;
    color: #262a3a;
}

.lg-sub {
    margin: 0 0 24px;
    color: var(--lg-muted);
    font-size: .9rem;
    line-height: 1.5;
}

/* ——— Поля ——— */

.lg-field {
    position: relative;
    margin-bottom: 14px;
}

.lg-field input {
    display: block;
    width: 100%;
    height: 58px;
    margin: 0;
    padding: 24px 50px 8px 50px;
    border: 1.5px solid var(--lg-line);
    border-radius: var(--lg-field-radius);
    background: var(--lg-field);
    color: #232736;
    font-size: 16px; /* меньше — и iPhone приближает страницу при вводе */
    font-weight: 500;
    letter-spacing: .01em;
    outline: none;
    box-shadow: none;
    transition: border-color .25s, background-color .25s, box-shadow .25s;
    -webkit-appearance: none;
            appearance: none;
}

.lg-field input:hover { border-color: #d3d6e3; }

/* Фокус: кайма из цветов логотипа и мягкое свечение. */
.lg-field input:focus {
    border-color: transparent;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(120deg, #7166a7, #ce44e8 55%, #f5b400) border-box;
    box-shadow: 0 0 0 5px rgba(113, 102, 167, .13), 0 10px 24px -14px rgba(113, 102, 167, .55);
}

/* Подпись лежит в поле, пока оно пустое, и поднимается при вводе. */
.lg-field label {
    position: absolute;
    left: 50px;
    top: 50%;
    margin: 0;
    color: var(--lg-muted);
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left center;
    transition: transform .22s var(--lg-ease), color .22s, top .22s var(--lg-ease);
}

.lg-field input:focus + label,
.lg-field input:not(:placeholder-shown) + label,
.lg-field input:-webkit-autofill + label {
    top: 17px;
    transform: translateY(-50%) scale(.78);
    color: var(--lg-purple);
    font-weight: 600;
}

.lg-field input::placeholder { color: transparent; }

.lg-field input:focus::placeholder { color: #b4b8c7; transition: color .2s .1s; }

/* Автозаполнение браузера красит поле в жёлтый или голубой — возвращаем
   свой фон. */
.lg-field input:-webkit-autofill,
.lg-field input:-webkit-autofill:hover,
.lg-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #232736;
    -webkit-box-shadow: 0 0 0 40px #f2f0fb inset;
    caret-color: #232736;
    transition: background-color 9999s;
}

.lg-ico {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 21px;
    height: 21px;
    margin-top: -10.5px;
    color: #9aa0b3;
    pointer-events: none;
    transition: color .25s, transform .35s var(--lg-ease);
}

.lg-field:focus-within .lg-ico { color: var(--lg-purple); transform: scale(1.08); }

.lg-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #9aa0b3;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.lg-eye:hover { background: var(--lg-purple-soft); color: var(--lg-purple); }
.lg-eye:focus-visible { outline: 2px solid var(--lg-purple); outline-offset: 1px; }
.lg-eye svg { width: 20px; height: 20px; }
.lg-eye .off { display: none; }
.lg-eye.is-on .on { display: none; }
.lg-eye.is-on .off { display: block; }

/* Галочка «телефон набран целиком». */
.lg-ok {
    position: absolute;
    right: 16px;
    top: 50%;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #4d8478;
    color: #fff;
    opacity: 0;
    transform: scale(.4);
    transition: opacity .25s, transform .35s cubic-bezier(.3, 1.6, .5, 1);
    pointer-events: none;
}

.lg-ok svg { width: 13px; height: 13px; }
.lg-field.is-complete .lg-ok { opacity: 1; transform: scale(1); }

.lg-field.is-invalid input {
    border-color: rgba(196, 61, 95, .55);
    background-color: #fff7f9;
}

.lg-field.is-invalid .lg-ico { color: var(--lg-danger); }

/* ——— Сообщения ——— */

.lg-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 13px;
    background: #fdf0f3;
    border: 1px solid #f6d3dd;
    color: #8f2a45;
    font-size: .86rem;
    line-height: 1.45;
    animation: lg-enter .5s var(--lg-ease) both;
}

.lg-alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--lg-danger); }

/* Подсказка про раскладку и Caps Lock из signin.blade.php. */
.lg #pass-hint {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: -4px 0 14px;
    padding: 9px 12px;
    border-radius: 11px;
    background: #fbf3e4;
    color: #8a5a12;
    font-size: .82rem;
}

.lg #pass-hint[hidden] { display: none; }

.lg #pass-hint::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lg-gold);
    box-shadow: 0 0 0 4px rgba(245, 180, 0, .2);
}

/* ——— Строка «Запомнить» ——— */

.lg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
}

.lg-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--lg-ink);
    font-size: .88rem;
    cursor: pointer;
    user-select: none;
}

.lg-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.lg-switch .track {
    position: relative;
    flex: none;
    width: 40px;
    height: 24px;
    border-radius: 999px;
    background: #dcdfe9;
    transition: background-color .25s;
}

.lg-switch .track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(37, 33, 66, .25);
    transition: transform .3s cubic-bezier(.3, 1.4, .5, 1);
}

.lg-switch input:checked + .track { background: linear-gradient(120deg, #7166a7, #9b6fd0); }
.lg-switch input:checked + .track::after { transform: translateX(16px); }
.lg-switch input:focus-visible + .track { outline: 2px solid var(--lg-purple); outline-offset: 2px; }

.lg-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lg-muted);
    font-size: .78rem;
    white-space: nowrap;
}

.lg-secure svg { width: 14px; height: 14px; color: #4d8478; }

/* ——— Кнопка ——— */

.lg #button-login,
.lg .lg-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: none;
    height: 56px;
    margin: 0;
    padding: 0 22px;
    overflow: hidden;
    border: 0;
    border-radius: var(--lg-field-radius);
    background: linear-gradient(120deg, #7d71b8 0%, #6a5ea6 45%, #8b5cc7 100%);
    background-size: 160% 100%;
    background-position: 0 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: 0 14px 30px -14px rgba(113, 102, 167, .9), inset 0 1px 0 rgba(255, 255, 255, .22);
    cursor: pointer;
    transition: transform .25s var(--lg-ease), box-shadow .25s, background-position .6s var(--lg-ease);
}

/* Блик пробегает по кнопке при наведении. */
.lg #button-login::before,
.lg .lg-btn::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-18deg);
    transition: left .8s var(--lg-ease);
}

.lg #button-login:hover,
.lg .lg-btn:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 20px 36px -16px rgba(113, 102, 167, 1), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.lg #button-login:hover::before,
.lg .lg-btn:hover::before { left: 120%; }

.lg #button-login:active,
.lg .lg-btn:active { transform: translateY(0) scale(.99); }

.lg #button-login:focus-visible,
.lg .lg-btn:focus-visible { outline: 3px solid rgba(113, 102, 167, .45); outline-offset: 3px; }

.lg #button-login svg.arrow {
    width: 20px;
    height: 20px;
    transition: transform .3s var(--lg-ease);
}

.lg #button-login:hover svg.arrow { transform: translateX(4px); }

.lg #button-login .spin {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg-rot .8s linear infinite;
}

/* Orchid на отправке сам блокирует кнопку, ставит .btn-loading и
   дописывает свою крутилку по центру — она легла бы поверх текста.
   Прячем её и показываем свою рядом со словом «Войти». */
.lg #button-login .spinner-loading { display: none !important; }
.lg #button-login:disabled { opacity: 1; cursor: wait; }

.lg #button-login:is(.is-loading, .btn-loading) { pointer-events: none; color: #fff; }
.lg #button-login:is(.is-loading, .btn-loading) .spin { display: block; }
.lg #button-login:is(.is-loading, .btn-loading) svg.arrow { display: none; }

@keyframes lg-rot { to { transform: rotate(360deg); } }

/* ——— Вход по сохранённому пользователю (lockme) ——— */

.lg-who {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--lg-field);
    border: 1px solid var(--lg-line);
}

.lg-who img {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--lg-purple-soft);
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(113, 102, 167, .35);
}

.lg-who b { display: block; color: #262a3a; font-size: .95rem; line-height: 1.3; }
.lg-who span { display: block; color: var(--lg-muted); font-size: .8rem; }
.lg-who > div { min-width: 0; }
.lg-who b, .lg-who span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.lg-link {
    display: block;
    margin-top: 16px;
    color: var(--lg-purple);
    font-size: .88rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
}

.lg-link:hover { color: var(--lg-purple-dark); text-decoration: underline; }

/* ——— Двухфакторный вход: поля Orchid в карточке ——— */

.lg-main .form-control {
    border: 1.5px solid var(--lg-line);
    border-radius: var(--lg-field-radius);
    background: var(--lg-field);
    min-height: 52px;
}

.lg-main .form-control:focus {
    border-color: var(--lg-purple);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(113, 102, 167, .13);
}

.lg-main .form-label { color: var(--lg-muted); font-size: .85rem; }
.lg-main .command-bar a { color: var(--lg-purple); font-size: .88rem; }

/* ——— Подвал ——— */

.lg-foot {
    margin-top: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .42);
    font-size: .76rem;
    letter-spacing: .02em;
    animation: lg-enter 1.1s .15s var(--lg-ease) both;
}

.lg-foot i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
}

/* ————————————————————————— Ширина ————————————————————————— */

@media (min-width: 992px) {
    .lg-stage { max-width: 960px; }

    .lg-card {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        min-height: 580px;
    }

    .lg-brand { display: flex; flex-direction: column; }
    .lg-brand .lg-points { margin-top: auto; }
    .lg-mobile-logo { display: none; }
    .lg-main { padding: 56px 52px 44px; display: flex; flex-direction: column; justify-content: center; }
    .lg-title { font-size: 1.85rem; }
}

@media (max-width: 575.98px) {
    .lg-card { border-radius: 24px; }
    .lg-main { padding: 26px 20px 22px; }
    .lg-title { font-size: 1.35rem; }
    .lg-sub { margin-bottom: 20px; }
    .lg-row { flex-wrap: wrap; }
    .lg-cube.is-far { display: none; }
}

@media (max-height: 640px) and (max-width: 991.98px) {
    .lg-mobile-logo { flex-direction: row; margin-bottom: 16px; }
    .lg-mobile-logo .cube { width: 40px; }
    .lg-mobile-logo .word { width: 124px; }
}

/* Система просит меньше движения — фон и кнопки стоят на месте. */
@media (prefers-reduced-motion: reduce) {
    .lg *,
    .lg *::before,
    .lg *::after,
    .lg-card,
    .lg-card::before,
    .lg-glow {
        animation: none !important;
        transition: none !important;
    }

    .lg-sparks { display: none; }
}
