body.vk-auth-doc,
body.vk-auth-doc * {
    box-sizing: border-box;
}

body.vk-auth-doc {
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: #22322a;
    font-family: var(--font-ui, 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif);
    -webkit-font-smoothing: antialiased;
}

body.vk-auth-doc button,
body.vk-auth-doc input {
    font-family: inherit;
}

.vk-stage {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: radial-gradient(120% 120% at 20% 8%, oklch(0.36 0.06 158) 0%, oklch(0.28 0.05 158) 46%, oklch(0.20 0.04 158) 100%);
}

.vk-bgcritters,
.vk-waves {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vk-waves {
    z-index: 0;
}

.vk-waves svg {
    position: absolute;
    inset: 0;
    width: 200%;
    height: 100%;
    overflow: visible;
}

.vk-wave-anim {
    animation: vk-wave linear infinite;
}

.vk-wave-anim:nth-child(1) {
    animation-duration: 30s;
}

.vk-wave-anim:nth-child(2) {
    animation-duration: 24s;
    animation-direction: reverse;
}

.vk-wave-anim:nth-child(3) {
    animation-duration: 27s;
}

.vk-waves path {
    fill: none;
    stroke: oklch(0.66 0.08 158 / .15);
    stroke-width: 2;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

@keyframes vk-wave {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.vk-bgcritters .crit {
    position: absolute;
    color: oklch(0.62 0.07 158 / .22);
    font-size: 54px;
    will-change: transform;
    animation: vk-float 12s cubic-bezier(.45, 0, .55, 1) infinite;
}

.vk-bgcritters .c1 { top: 12%; left: 8%; font-size: 64px; --r: -8deg; }
.vk-bgcritters .c2 { top: 68%; left: 12%; font-size: 76px; --r: 6deg; animation-delay: 1.2s; }
.vk-bgcritters .c3 { top: 20%; left: 84%; font-size: 58px; --r: 10deg; animation-delay: .6s; }
.vk-bgcritters .c4 { top: 74%; left: 86%; font-size: 52px; --r: -12deg; animation-delay: 2s; }
.vk-bgcritters .c5 { top: 46%; left: 92%; font-size: 46px; --r: 8deg; animation-delay: .3s; }
.vk-bgcritters .c6 { top: 40%; left: 4%; font-size: 40px; --r: -4deg; animation-delay: 1.6s; }
.vk-bgcritters .c7 { top: 88%; left: 46%; font-size: 38px; --r: 14deg; animation-delay: .9s; }

@keyframes vk-float {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50% { transform: translateY(-18px) rotate(calc(var(--r, 0deg) + 5deg)); }
}

.vk-card {
    position: relative;
    z-index: 2;
    width: min(1040px, 92vw);
    min-height: 560px;
    max-height: 94vh;
    overflow: hidden;
    --panel-w: 440px;
    border-radius: 28px;
    background: #fffdf8;
    box-shadow: 0 30px 80px -20px oklch(0.12 0.04 158 / .65), 0 8px 24px oklch(0.12 0.04 158 / .35);
}

.vk-form {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #fffdf8;
}

.vk-form-inner {
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--panel-w);
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    padding: 38px 52px;
    overflow-y: auto;
    transition: left .62s cubic-bezier(.2, .8, .2, 1);
}

.vk-stage[data-vk-auth-stage="login"] .vk-form-inner {
    left: calc(100% - var(--panel-w));
}

.vk-stage[data-vk-auth-stage="connect"] .vk-form-inner {
    left: 0;
}

.vk-art {
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc(100% - var(--panel-w));
    z-index: 2;
    overflow: hidden;
    border-radius: 28px;
    background: radial-gradient(140% 120% at 30% 16%, oklch(0.44 0.078 158) 0%, oklch(0.34 0.07 158) 50%, oklch(0.26 0.06 158) 100%);
    box-shadow: 0 0 40px oklch(0.12 0.04 158 / .35);
    transition: left .62s cubic-bezier(.2, .8, .2, 1);
}

.vk-stage[data-vk-auth-stage="login"] .vk-art {
    left: 0;
}

.vk-stage[data-vk-auth-stage="connect"] .vk-art {
    left: var(--panel-w);
}

.vk-art::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .5;
    pointer-events: none;
    background: radial-gradient(60% 50% at 82% 88%, oklch(0.52 0.08 158 / .35), transparent 70%), radial-gradient(50% 40% at 12% 14%, oklch(0.52 0.08 158 / .30), transparent 70%);
}

.vk-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    opacity: 0;
    pointer-events: none;
    transform: scale(.96);
    transition: opacity .5s cubic-bezier(.2, .8, .2, 1), transform .55s cubic-bezier(.2, .8, .2, 1);
}

.vk-layer.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.vk-poster {
    width: 62%;
    max-width: 300px;
    filter: drop-shadow(0 18px 30px oklch(0.10 0.04 158 / .5));
    transform-origin: 50% 8%;
    animation: vk-sway 6.5s cubic-bezier(.45, 0, .55, 1) infinite;
}

.vk-poster img {
    display: block;
    width: 100%;
}

@keyframes vk-sway {
    0%, 100% { transform: rotate(-1.6deg); }
    50% { transform: rotate(1.6deg); }
}

.vk-brandline {
    margin-top: 14px;
    color: #f7fff9;
    text-align: center;
}

.vk-brandline .name,
.vk-promo-logo .wm {
    font-family: var(--font-display, Georgia, 'Times New Roman', serif);
    font-size: 26px;
    font-weight: 600;
    line-height: 1;
}

.vk-brandline .name {
    font-size: 23px;
}

.vk-brandline .sub,
.vk-promo-logo .tag {
    margin-top: 3px;
    font-size: 12px;
    opacity: .8;
}

.vk-promo {
    width: 100%;
    max-width: 330px;
    color: #f7fff9;
}

.vk-promo-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.vk-promo-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px oklch(0.10 0.04 158 / .5));
}

.vk-promo h2 {
    margin: 0 0 6px;
    font-family: var(--font-display, Georgia, 'Times New Roman', serif);
    font-size: 27px;
    font-weight: 600;
    line-height: 1.15;
}

.vk-promo .lead {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    opacity: .85;
}

.vk-feat {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 11px 0;
    border-top: 1px solid oklch(1 0 0 / .12);
}

.vk-feat:first-of-type {
    border-top: 0;
}

.vk-feat .fi {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #f7fff9;
    background: oklch(1 0 0 / .14);
    border-radius: 11px;
}

.vk-feat .fi i {
    font-size: 20px;
}

.vk-feat .ft {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.vk-feat .fs {
    margin-top: 1px;
    font-size: 12.5px;
    line-height: 1.35;
    opacity: .78;
}

.vk-crit-art,
.vk-leaf {
    position: absolute;
    z-index: 1;
    color: oklch(0.78 0.09 158 / .5);
    pointer-events: none;
    animation: vk-float 10s cubic-bezier(.45, 0, .55, 1) infinite;
}

.vk-crit-art.a1 { top: 14%; left: 14%; font-size: 26px; --r: -10deg; }
.vk-crit-art.a2 { top: 76%; left: 72%; font-size: 30px; --r: 8deg; animation-delay: 1.4s; }
.vk-crit-art.a3 { top: 20%; left: 74%; font-size: 28px; --r: -6deg; animation-delay: .7s; }

.vk-leaf {
    width: 42px;
    height: 42px;
}

.vk-leaf::before,
.vk-leaf::after {
    content: "";
    position: absolute;
    border-radius: 60% 0 60% 0;
    background: currentColor;
}

.vk-leaf::before {
    width: 20px;
    height: 34px;
    transform: rotate(28deg);
}

.vk-leaf::after {
    top: 12px;
    left: 18px;
    width: 18px;
    height: 30px;
    opacity: .78;
    transform: rotate(-34deg);
}

.vk-leaf.l1 { top: 8%; left: 64%; --r: 22deg; }
.vk-leaf.l2 { top: 60%; left: 6%; width: 52px; height: 52px; --r: -14deg; animation-delay: .8s; }
.vk-leaf.l3 { top: 88%; left: 60%; width: 34px; height: 34px; --r: 30deg; animation-delay: 1.5s; }

.vk-eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    flex: 0 0 auto;
    gap: 7px;
    margin-bottom: 16px;
    padding: 5px 11px;
    color: #0c5638;
    background: #e0f5e9;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.vk-eyebrow i {
    font-size: 15px;
}

.vk-mode {
    display: none;
}

.vk-mode.is-active {
    display: block;
}

.vk-h {
    margin: 0;
    color: #22322a;
    font-family: var(--font-display, Georgia, 'Times New Roman', serif);
    font-size: 35px;
    font-weight: 600;
    line-height: 1.06;
}

.vk-sub {
    margin: 8px 0 0;
    color: #58665f;
    font-size: 15px;
    line-height: 1.45;
}

.vk-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 22px;
}

.vk-field {
    display: block;
    margin: 0;
}

.vk-flabel {
    display: block;
    margin-bottom: 7px;
    color: #58665f;
    font-size: 12.5px;
    font-weight: 600;
}

.vk-input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 14px;
    background: #fffdf8;
    border: 1.5px solid #cfd6cf;
    border-radius: 12px;
    transition: border-color .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s cubic-bezier(.2, .8, .2, 1);
}

.vk-input:focus-within {
    border-color: #2f6d4f;
    box-shadow: 0 0 0 3px oklch(0.46 0.09 158 / .2);
}

.vk-input i {
    flex: 0 0 auto;
    color: #82908a;
    font-size: 19px;
}

.vk-input:focus-within i {
    color: #2f6d4f;
}

.vk-input input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #22322a;
    font-size: 15px;
}

.vk-input input::placeholder {
    color: #82908a;
}

.vk-eye,
.vk-link {
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.vk-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 4px;
    color: #82908a;
    border-radius: 8px;
}

.vk-eye:hover {
    background: #f0f3ed;
    color: #58665f;
}

.vk-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.vk-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #58665f;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.vk-check input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.vk-box {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    color: #fff;
    border: 1.5px solid #cfd6cf;
    border-radius: 6px;
    transition: background .14s ease, border-color .14s ease;
}

.vk-box i {
    font-size: 13px;
    opacity: 0;
    transform: scale(.6);
    transition: opacity .14s ease, transform .14s ease;
}

.vk-check input:checked + .vk-box {
    background: #2f6d4f;
    border-color: #2f6d4f;
}

.vk-check input:checked + .vk-box i {
    opacity: 1;
    transform: none;
}

.vk-link {
    padding: 0;
    color: #0c5638;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.vk-link:hover {
    text-decoration: underline;
}

.vk-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 50px;
    margin-top: 22px;
    border: 0;
    border-radius: 999px;
    background: #2f6d4f;
    color: #f7fff9;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 18px -6px oklch(0.46 0.09 158 / .55);
    transition: background .14s ease, transform .14s ease, box-shadow .18s ease;
}

.vk-submit:hover {
    background: #265c41;
    box-shadow: 0 10px 22px -6px oklch(0.46 0.09 158 / .6);
}

.vk-submit:active {
    transform: scale(.98);
}

.vk-submit i {
    font-size: 20px;
}

.vk-switch {
    margin-top: 22px;
    color: #58665f;
    font-size: 13.5px;
    text-align: center;
}

.vk-status {
    display: none;
    margin: 0;
    color: #238457;
    font-size: 12.5px;
    font-weight: 600;
}

.vk-status.is-visible {
    display: block;
}

.vk-err {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 11px 13px;
    color: oklch(0.50 0.16 28);
    background: oklch(0.585 0.19 28 / .08);
    border: 1px solid oklch(0.585 0.19 28 / .25);
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.vk-err.show {
    display: flex;
    animation: vk-err-in .22s cubic-bezier(.2, .8, .2, 1);
}

.vk-err i {
    flex: 0 0 auto;
    color: oklch(0.585 0.19 28);
    font-size: 17px;
}

@keyframes vk-err-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.vk-spin {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid oklch(1 0 0 / .35);
    border-top-color: #f7fff9;
    border-radius: 50%;
    animation: vk-rot .7s linear infinite;
}

@keyframes vk-rot {
    to { transform: rotate(360deg); }
}

.vk-submit:disabled {
    cursor: default;
    opacity: .92;
}

@media (prefers-reduced-motion: reduce) {
    .vk-err.show {
        animation: none;
    }

    .vk-spin {
        animation-duration: 1.4s;
    }
}

@media (max-width: 780px) {
    body.vk-auth-doc {
        overflow: auto;
    }

    .vk-stage {
        position: relative;
        min-height: 100vh;
        padding: 18px;
    }

    .vk-card {
        display: flex;
        flex-direction: column;
        width: 94vw;
        min-height: 0;
        max-height: none;
    }

    .vk-form {
        position: static;
    }

    .vk-form-inner {
        position: static;
        width: 100%;
        padding: 30px 26px 36px;
        transition: none;
    }

    .vk-art {
        position: static;
        order: -1;
        width: 100%;
        height: 200px;
        border-radius: 0;
        box-shadow: none;
        transition: none;
    }

    .vk-layer {
        padding: 16px;
    }

    .vk-poster {
        max-width: 130px;
    }

    .vk-brandline,
    .vk-promo .lead,
    .vk-feat .fs {
        display: none;
    }

    .vk-h {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vk-poster,
    .vk-leaf,
    .vk-crit-art,
    .vk-bgcritters .crit,
    .vk-qr-status .vk-pulse::after,
    .vk-wave-anim {
        animation: none !important;
    }

    .vk-form-inner,
    .vk-art,
    .vk-layer {
        transition: none !important;
    }
}

/* ============ Подключение клиники: QR (eGov Mobile) ============ */

/* QR-панель — всегда в колонку (узкая колонка формы → без бокового скролла) */
.vk-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
}

.vk-qr-frame {
    position: relative;
    flex: 0 0 auto;
    width: 200px;
    height: 200px;
    padding: 12px;
    background: #fff;
    border: 1.5px solid #cfd6cf;
    border-radius: 18px;
    box-shadow: 0 6px 18px -8px oklch(0.20 0.04 158 / .45);
}

.vk-qr-frame img,
.vk-qr-frame svg {
    display: block;
    width: 100%;
    height: 100%;
}

.vk-qr-skeleton {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: repeating-linear-gradient(45deg, #eef3ec, #eef3ec 6px, #f6f9f4 6px, #f6f9f4 12px);
}

.vk-qr-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #2f6d4f;
    color: #fff;
    box-shadow: 0 0 0 5px #fff;
}

.vk-qr-badge i {
    font-size: 21px;
}

.vk-qr-steps {
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vk-qr-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #58665f;
    font-size: 13.5px;
    line-height: 1.35;
}

.vk-qr-steps li > span:last-child {
    flex: 1;
    min-width: 0;
}

.vk-qr-steps b {
    color: #22322a;
}

.vk-qr-steps .n {
    flex: 0 0 22px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e0f5e9;
    color: #0c5638;
    font-size: 12px;
    font-weight: 700;
}

.vk-qr-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef6f0;
    border: 1px solid #cfe6d6;
    color: #2f6d4f;
    font-size: 13.5px;
    font-weight: 600;
}

/* Ожидание подписи — спокойный «пульс» (ждём действие пользователя), а не крутящийся спиннер */
.vk-qr-status .vk-pulse {
    position: relative;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2f6d4f;
}

.vk-qr-status .vk-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #2f6d4f;
    animation: vk-ping 1.8s ease-out infinite;
}

@keyframes vk-ping {
    0% { transform: scale(1); opacity: .5; }
    70% { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}

.vk-qr-status.is-ok {
    background: #e7f6ec;
    border-color: #9fd9b4;
    color: #1f7a4d;
}

.vk-qr-status .mdi {
    font-size: 19px;
}

.vk-hint {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    color: #82908a;
    font-size: 12px;
    line-height: 1.4;
}

.vk-hint i {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 15px;
}

/* страховка от бокового скролла в узкой колонке формы */
.vk-form-inner {
    overflow-x: hidden;
}

/* Иконки шагов eGov — vetka-* масками (self-contained; работают и без глобального vetkaicon) */
.vk-auth-doc .vetka-password::before,
.vk-auth-doc .vetka-scan::before,
.vk-auth-doc .vetka-tick-square::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    vertical-align: -0.125em;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-image: var(--vetka-icon-url); mask-image: var(--vetka-icon-url);
}
.vk-auth-doc .vetka-scan::before { --vetka-icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22.582 12.8001H1.44995M2.99605 8.71995C3.56605 5.23995 5.28605 3.51995 8.76605 2.94995M8.76605 20.9901C5.28605 20.4101 3.56605 18.7001 2.99605 15.2201L2.99505 15.2241C2.87405 14.5041 2.80505 13.6941 2.78505 12.8041M21.2446 12.804C21.2246 13.694 21.1546 14.504 21.0346 15.224L21.0366 15.22C20.4656 18.7 18.7456 20.41 15.2656 20.99M15.2661 2.94995C18.7461 3.51995 20.4661 5.23995 21.0361 8.71995'/%3E%3C/svg%3E"); }
.vk-auth-doc .vetka-password::before { --vetka-icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.072 12.8744L19.3908 8.64282L20.6312 11.3745M16.4603 13.2684L15.2199 10.5368M10.0675 12.8764C10.7527 14.3853 10.0851 16.1633 8.57626 16.8485C7.06737 17.5336 5.28939 16.8661 4.60422 15.3572C3.91905 13.8484 4.58656 12.0704 6.09545 11.3852L6.09988 11.3832C7.60796 10.7002 9.38299 11.369 10.0675 12.8764Z'/%3E%3C/svg%3E"); }
.vk-auth-doc .vetka-tick-square::before { --vetka-icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.44016 12.0001L10.8142 14.3731L15.5602 9.62712M2.74976 12.0001C2.74976 18.9371 5.06276 21.2501 11.9998 21.2501C18.9368 21.2501 21.2498 18.9371 21.2498 12.0001C21.2498 5.06312 18.9368 2.75012 11.9998 2.75012C5.06276 2.75012 2.74976 5.06312 2.74976 12.0001Z'/%3E%3C/svg%3E"); }
