/* Вход через ВК и окно кода 2FA (Влад, 20.10) — поверх login.css, в той же палитре DURAN SPACE.
 * Мягкие заливки без обводок; без inline-стилей (CSP style-src 'self'). */

/* ---------- «или» и кнопка ВК на странице входа ---------- */
.sl-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--sl-gray); font-size: 11px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; animation: sl-rise .6s var(--sl-ease) 1.2s both; }
.sl-or::before, .sl-or::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .09), transparent); }
.sl-vk {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding: 0 16px;
    border-radius: 10px;
    color: var(--sl-text);
    background: rgb(0 119 255 / .16);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s, transform .15s;
    animation: sl-rise .6s var(--sl-ease) 1.26s both;
}
.sl-vk:hover { background: rgb(0 119 255 / .26); color: #fff; }
.sl-vk:active { transform: translateY(1px); }
.sl-vk:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(0 119 255 / .55); }
.sl-vk .prov { width: 22px; height: 22px; vertical-align: 0; }

/* ---------- окно кода ---------- */
.otp-way { display: flex; align-items: center; gap: 6px; width: fit-content; margin-top: 10px; padding: 3px 10px 3px 8px; border-radius: 999px; background: rgb(var(--sl-acc) / .14); color: var(--sl-gold-hi); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.otp-way .prov { width: 13px; height: 13px; vertical-align: 0; }
.otp-way .fa { font-size: 10px; }

.otp-cells { display: flex; align-items: center; gap: 9px; margin: 0; padding: 0; border: 0; min-width: 0; }
.otp-gap { flex: none; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: rgb(255 255 255 / .14); }
.login-shell .otp-cell {
    flex: 1 1 0;
    min-width: 0;
    height: 62px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    outline: none;
    text-align: center;
    color: var(--sl-text);
    caret-color: var(--sl-gold-hi);
    font-family: "Cascadia Mono", Consolas, "JetBrains Mono", monospace;
    font-size: 27px;
    font-weight: 700;
    background: rgb(var(--sl-shade) / .62);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06);
    transition: box-shadow .18s, background .18s, transform .18s var(--sl-ease), color .18s;
}
.login-shell .otp-cell:hover { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); }
.login-shell .otp-cell:focus {
    background: rgb(var(--sl-shade) / .82);
    box-shadow: inset 0 0 0 1px rgb(var(--sl-acc) / .75), 0 0 0 4px rgb(var(--sl-acc) / .14), 0 0 26px rgb(var(--sl-acc) / .14);
    transform: translateY(-2px);
}
.login-shell .otp-cell.is-filled { background: rgb(var(--sl-acc) / .12); }
.otp-cells .otp-cell { animation: sl-rise .5s var(--sl-ease) both; }
.otp-cells .otp-cell:nth-of-type(1) { animation-delay: .9s; }
.otp-cells .otp-cell:nth-of-type(2) { animation-delay: .95s; }
.otp-cells .otp-cell:nth-of-type(3) { animation-delay: 1s; }
.otp-cells .otp-cell:nth-of-type(4) { animation-delay: 1.05s; }
.otp-cells .otp-cell:nth-of-type(5) { animation-delay: 1.1s; }
.otp-cells .otp-cell:nth-of-type(6) { animation-delay: 1.15s; }

/* отправка: ячейки мягко пульсируют золотом */
.otp-panel.is-sending .otp-cell { animation: otp-pulse 1s ease-in-out infinite; }
.otp-panel.is-sending .otp-cell:nth-of-type(2) { animation-delay: .08s; }
.otp-panel.is-sending .otp-cell:nth-of-type(3) { animation-delay: .16s; }
.otp-panel.is-sending .otp-cell:nth-of-type(4) { animation-delay: .24s; }
.otp-panel.is-sending .otp-cell:nth-of-type(5) { animation-delay: .32s; }
.otp-panel.is-sending .otp-cell:nth-of-type(6) { animation-delay: .4s; }
@keyframes otp-pulse { 0%, 100% { background: rgb(var(--sl-acc) / .12); } 50% { background: rgb(var(--sl-acc) / .3); } }

/* ошибка: ячейки краснеют и вздрагивают */
.otp-panel.has-error .otp-cell { background: rgb(232 110 106 / .12); box-shadow: inset 0 0 0 1px rgb(232 110 106 / .35); }
.otp-panel.has-error .otp-cell:focus { box-shadow: inset 0 0 0 1px rgb(232 110 106 / .7), 0 0 0 4px rgb(232 110 106 / .14); }
/* после ответа сервера окно уже на месте: без повторного появления панели и строк */
.login-shell > .otp-panel.has-error, .login-shell > .otp-panel.is-done,
.otp-panel.has-error > *, .otp-panel.is-done > *, .otp-panel.has-error .fl-step > *, .otp-panel.is-done .fl-step > *, .otp-panel.has-error .sl-form > *, .otp-panel.is-done .sl-form > *,
.otp-panel.has-error .sl-mark svg.brand-mark path, .otp-panel.is-done .sl-mark svg.brand-mark path { animation: none; }
.otp-panel.has-error .sl-mark svg.brand-mark path, .otp-panel.is-done .sl-mark svg.brand-mark path { fill-opacity: 1; stroke-opacity: 0; stroke-dashoffset: 0; }
.otp-panel.has-error .otp-cell { animation: none; }
.otp-panel.has-error .otp-cells { animation: sl-nudge .42s ease .15s; }

/* код принят: зелёные ячейки по очереди и галочка */
.otp-panel.is-done .otp-cell { color: #DFF6E6; background: rgb(76 175 110 / .26); box-shadow: inset 0 0 0 1px rgb(110 210 140 / .4); animation: otp-ok .5s var(--sl-ease) both; }
.otp-panel.is-done .otp-cell:nth-of-type(1) { animation-delay: 0.10s; }
.otp-panel.is-done .otp-cell:nth-of-type(2) { animation-delay: 0.16s; }
.otp-panel.is-done .otp-cell:nth-of-type(3) { animation-delay: 0.22s; }
.otp-panel.is-done .otp-cell:nth-of-type(4) { animation-delay: 0.28s; }
.otp-panel.is-done .otp-cell:nth-of-type(5) { animation-delay: 0.34s; }
.otp-panel.is-done .otp-cell:nth-of-type(6) { animation-delay: 0.40s; }
.otp-panel.is-done .otp-gap { background: rgb(110 210 140 / .5); }
@keyframes otp-ok { 0% { transform: scale(.9); background: rgb(var(--sl-shade) / .62); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.otp-panel.is-done .sl-title { color: #A9E5BC; }
.otp-cells:disabled .otp-cell { opacity: 1; cursor: default; }

a.sl-submit { text-decoration: none; }
.otp-go { background: rgb(76 175 110 / .9); box-shadow: 0 12px 30px rgb(76 175 110 / .22); color: #06120A; }
.otp-go:hover { background: rgb(110 210 140 / 1); box-shadow: 0 14px 36px rgb(76 175 110 / .3); color: #06120A; }

.otp-recovery summary { width: fit-content; cursor: pointer; color: var(--sl-desc); font-size: 12.5px; font-weight: 600; list-style: none; }
.otp-recovery summary::-webkit-details-marker { display: none; }
.otp-recovery summary::after { content: " →"; color: var(--sl-gold); }
.otp-recovery[open] summary { margin-bottom: 10px; color: var(--sl-gold-hi); }
.otp-recovery[open] summary::after { content: ""; }
.otp-recovery summary:hover { color: var(--sl-text); }

.otp-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 0; color: var(--sl-gray); font-size: 12px; }
.otp-meta .is-late { color: var(--sl-red); font-weight: 700; }
.otp-demo { padding: 2px 9px; border-radius: 999px; background: rgb(var(--sl-acc) / .14); color: var(--sl-gold-hi); font-weight: 700; }

/* кто входит — слева снизу окна: фото и имя из ВК */
.otp-face { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding: 10px 12px 10px 10px; border-radius: 14px; background: rgb(255 255 255 / .035); animation: sl-rise .6s var(--sl-ease) 1.2s both; }
.otp-face .ava { width: 42px; height: 42px; font-size: 17px; font-weight: 800; color: #fff; box-shadow: 0 0 0 2px rgb(var(--sl-acc) / .55), 0 6px 16px rgb(0 0 0 / .4); }
.otp-who { display: grid; gap: 3px; min-width: 0; }
.otp-who b { overflow: hidden; color: var(--sl-text); font-size: 13.5px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.otp-who small { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--sl-gray); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.otp-who .prov { width: 14px; height: 14px; vertical-align: 0; }
.otp-cancel { margin: 0 0 0 auto; }
.otp-cancel button { padding: 7px 12px; border: 0; border-radius: 8px; cursor: pointer; color: var(--sl-desc); background: rgb(255 255 255 / .05); font-size: 12px; font-weight: 700; transition: background .15s, color .15s; }
.otp-cancel button:hover { color: var(--sl-text); background: rgb(255 255 255 / .1); }

/* ---------- имитация шага ВК в ADMIN-DEMO ---------- */
.vk-demo-note { margin: -12px 0 20px; padding: 9px 12px; border-radius: 10px; background: rgb(var(--sl-acc) / .1); color: var(--sl-gold-hi); font-size: 12.5px; line-height: 1.45; }
.vk-who { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: rgb(0 119 255 / .1); }
.vk-who .ava { width: 54px; height: 54px; }
.vk-who b { display: block; font-size: 16px; font-weight: 800; color: var(--sl-text); }
.vk-who small { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--sl-desc); font-size: 12.5px; }
.vk-who .prov { width: 14px; height: 14px; vertical-align: 0; }
.vk-continue { background: #0077FF; color: #fff; box-shadow: 0 12px 30px rgb(0 119 255 / .25); }
.vk-continue:hover { background: #2B8CFF; color: #fff; box-shadow: 0 14px 36px rgb(0 119 255 / .32); }
.vk-back { display: block; width: fit-content; margin: 2px auto 0; color: var(--sl-desc); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.vk-back:hover { color: var(--sl-text); }

@media (max-width: 480px) {
    .otp-cells { gap: 6px; }
    .login-shell .otp-cell { height: 54px; font-size: 23px; border-radius: 10px; }
    .otp-gap { width: 4px; height: 4px; margin: 0; }
}
@media (max-height: 780px) {
    .login-shell .otp-cell { height: 54px; }
    .otp-face { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .sl-or, .sl-vk, .otp-face, .otp-cells .otp-cell, .otp-panel.is-sending .otp-cell, .otp-panel.is-done .otp-cell, .otp-panel.has-error .otp-cells { animation: none !important; }
}

/* ---------- «Вход только через ВКонтакте»: ВК — главная кнопка, формы нет ---------- */
:is(.sl-panel, .fl-step) > .sl-error { margin-bottom: 16px; }
.sl-vk.is-main { height: 50px; background: #0077FF; color: #fff; font-size: 14.5px; animation-delay: .86s; box-shadow: 0 12px 30px rgb(0 119 255 / .28); }
.sl-vk.is-main:hover { background: #1A86FF; }
.sl-vk.is-main .prov rect { fill: rgb(255 255 255 / .16); }
.sl-vk-arrow { width: 14px; height: 14px; margin-left: auto; fill: currentColor; transition: transform .2s var(--sl-ease); }
.sl-vk.is-main:hover .sl-vk-arrow { transform: translateX(3px); }
.sl-note { display: flex; gap: 9px; align-items: flex-start; margin: 16px 0 0; color: var(--sl-gray); font-size: 12.5px; font-weight: 600; line-height: 1.45; animation: sl-rise .6s var(--sl-ease) .98s both; }
.sl-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; fill: currentColor; opacity: .8; }
.sl-note.is-warn { padding: 10px 12px; border-radius: 10px; background: rgb(var(--sl-acc) / .12); color: var(--sl-gold-hi); }
@media (prefers-reduced-motion: reduce) { .sl-note, .sl-vk.is-main { animation: none !important; } }
