/* KKOO auth — layout tokens from Yandex ID screenshot-to-code reference */

@font-face {
    font-family: "YS Text";
    src: url("/static/fonts/ys/YSText-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "YS Text";
    src: url("/static/fonts/ys/YSText-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "YS Text";
    src: url("/static/fonts/ys/YSText-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "YS Text";
    src: url("/static/fonts/ys/YSText-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ys-font: "YS Text", Roboto, Arial, sans-serif;
    --ys-ink: #292a35;
    --ys-ink-btn: #292a35;
    --ys-ink-strong: #282934;
    --ys-muted: #484954;
    --ys-muted-2: #9294a0;
    --ys-placeholder: #b7b8c1;
    --ys-line: #e1e1e3;
    --ys-card: #ffffff;
    --ys-danger: #f33;
    --ys-ok: #00a878;
    --ys-card-w: 376px;
    --ys-radius-card: 40px;
    --ys-radius-ctrl: 19px;
    --ys-ctrl-h: 56px;
    --ys-gap: 9px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    height: 100%;
}

body.auth-page {
    font-family: var(--ys-font);
    color: var(--ys-ink);
    background: #0b0f14;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-stage {
    position: relative;
    min-height: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 88px;
    overflow: hidden;
}

.auth-stage__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(29, 50, 64, 0.13), rgba(17, 39, 51, 0.12)),
        url("/static/images/a1d97737.webp");
    background-size: cover;
    background-position: center;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(100%, var(--ys-card-w));
    min-height: 605px;
    background: var(--ys-card);
    border-radius: var(--ys-radius-card);
    padding: 36px 32px 32px;
    text-align: left;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto 36px;
    text-decoration: none;
    color: var(--ys-ink-strong);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
}

.auth-logo__text {
    font-family: var(--ys-font);
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.auth-logo__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 4px;
    border-radius: 7px;
    background: var(--ys-ink-strong);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

.auth-body {
    flex: 1;
    padding: 0 4px;
}

.auth-title {
    margin: 0;
    text-align: center;
    font-family: var(--ys-font);
    font-size: 20px;
    font-weight: 500;
    line-height: 23px;
    color: var(--ys-ink);
}

.auth-title--lg {
    font-size: 22px;
    line-height: 26px;
}

.auth-device {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: var(--ys-ink);
    text-align: center;
}

.auth-device__dot {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f34723;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.auth-device__dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-hint {
    margin: 8px 0 0;
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    color: var(--ys-muted);
}

.auth-field {
    margin: 18px 0 0;
}

.auth-input-shell {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 69px;
    padding: 14px 20px;
    border-radius: 23px;
    background: #fff;
    border: 2px solid #2f3037;
    transition: border-color 0.15s ease;
}

.auth-input-shell:focus-within {
    border-color: #2f3037;
}

.auth-input-shell.is-error {
    border-color: var(--ys-danger);
}

.auth-prefix {
    font-size: 20px;
    font-weight: 400;
    line-height: 26px;
    color: var(--ys-ink);
    flex-shrink: 0;
}

.auth-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: var(--ys-font);
    font-size: 20px;
    font-weight: 400;
    line-height: 26px;
    color: var(--ys-ink);
    height: 26px;
    padding: 0;
}

.auth-input::placeholder {
    color: var(--ys-placeholder);
    opacity: 1;
}

.auth-code-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    width: 100%;
    min-height: 69px;
    padding: 10px 16px;
    border-radius: 23px;
    background: #fff;
    border: 2px solid #2f3037;
}

.auth-code-grid input {
    width: 100%;
    height: 36px;
    border: 0;
    outline: 0;
    background: transparent;
    text-align: center;
    font-family: var(--ys-font);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--ys-ink);
    caret-color: var(--ys-ink);
}

.auth-code-grid input::placeholder {
    color: var(--ys-placeholder);
    opacity: 1;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: var(--ys-gap);
    margin-top: 32px;
}

.auth-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: var(--ys-ctrl-h);
    height: 57px;
    padding: 0 24px;
    border-radius: var(--ys-radius-ctrl);
    border: 0;
    font-family: var(--ys-font);
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.auth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-btn--primary {
    background: var(--ys-ink-btn);
    color: #fff;
}

.auth-btn--primary:hover:not(:disabled) {
    background: #171820;
}

.auth-btn--secondary {
    background: #fff;
    color: var(--ys-ink);
    border: 1px solid var(--ys-line);
    height: 56px;
}

.auth-btn--secondary:hover:not(:disabled) {
    background: #f9fafb;
}

.auth-btn__icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    color: var(--ys-ink);
    flex-shrink: 0;
}

.auth-btn__icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.auth-msg {
    min-height: 20px;
    margin: 12px 0 0;
    text-align: center;
    font-size: 14px;
    line-height: 20px;
    color: var(--ys-danger);
}

.auth-msg.is-ok {
    color: var(--ys-ok);
}

.auth-below {
    position: relative;
    z-index: 1;
    margin-top: 12px;
    text-align: center;
    font-size: 16px;
    line-height: 28px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.auth-below a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.auth-below a:hover {
    text-decoration: underline;
}

.auth-page-foot {
    position: absolute;
    z-index: 1;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 21px 17px;
    pointer-events: none;
}

.auth-page-foot * {
    pointer-events: auto;
}

.auth-page-foot__note,
.auth-page-foot__links,
.auth-page-foot a,
.auth-page-foot span {
    font-family: var(--ys-font);
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.auth-page-foot__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-page-foot a {
    text-decoration: none;
}

.auth-page-foot a:hover {
    text-decoration: underline;
}

.auth-step {
    display: none;
}

.auth-step.is-active {
    display: block;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.auth-btn:focus-visible,
.auth-input:focus-visible,
.auth-code-grid input:focus-visible {
    outline: 2px solid #4c8bf5;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .auth-stage {
        padding: 28px 16px 80px;
    }

    .auth-card {
        width: calc(100vw - 32px);
        max-width: 376px;
        min-height: 0;
        border-radius: 30px;
        padding: 32px 28px 28px;
    }

    .auth-page-foot__note {
        display: none;
    }

    .auth-page-foot {
        padding: 18px 20px;
        font-size: 12px;
        justify-content: center;
    }

    .auth-page-foot__links {
        justify-content: center;
        gap: 16px;
        font-size: 12px;
    }
}
