/* PT Root UI — Regular (400) */
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/pt-root-regular-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/pt-root-regular-cyrillic-ext.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/pt-root-regular-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/pt-root-regular-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* PT Root UI — Medium (500) */
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/pt-root-medium-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/pt-root-medium-cyrillic-ext.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/pt-root-medium-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/pt-root-medium-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* PT Root UI — Bold (700) */
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/pt-root-bold-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/pt-root-bold-cyrillic-ext.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/pt-root-bold-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'PT Root';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/pt-root-bold-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Commissioner — Regular (400) */
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/commissioner-cyrillic.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/commissioner-cyrillic-ext.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/commissioner-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/commissioner-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Commissioner — Bold (700) */
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/commissioner-cyrillic-bold.woff2') format('woff2');
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/commissioner-cyrillic-ext-bold.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/commissioner-latin-bold.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Commissioner';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/commissioner-latin-ext-bold.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

html {
    border-radius: 8px;
    overflow: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.auth-container {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

:root {
    --primary: #2962f9;
    --primary-hover: #264eb1;
    --error: #fd4b4b;
    --resend-success: #65b846;
    --disabled-bg: #d4d7de;
    --input-border: #e7e7e7;
    --warning-bg: #fff3d4;
    --muted: #5c5c5c;
    --close-icon: #969698;
    --visited: #7142d6;
    --text: #000;
    --main-font: 'PT Root', 'Arial', sans-serif;
    --second-font: 'Commissioner', 'Trebuchet MS', sans-serif;
}

body {
    font-family: var(--main-font);
    margin: 0;
    padding: 16px;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text);
}

@media (min-width: 480px) {
    body {
        padding: 32px;
    }
}

/* When embedded as iframe — no overlay background, no outer padding */
body.embedded {
    padding: 0;
    min-height: unset;
    background: transparent;
}

.auth-card {
    padding: 48px 16px;
    position: relative;
    background: white;
}

@media (min-width: 480px) {
    .auth-card {
        padding: 56px 40px;
        border-radius: 8px;
    }
}

.auth-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    color: #969698;
    cursor: pointer;
}

@media (min-width: 480px) {
    .auth-close {
        width: 24px;
        height: 24px;
        padding: 0;
        margin: 8px;
    }
}

.auth-close__icon {
    display: flex;
    width: 100%;
    height: 100%;
}

.auth-title {
    font-family: var(--second-font);
    font-weight: 600;
    font-size: 26px;
    line-height: 34px;
    margin: 0 0 12px;
}

@media (min-width: 480px) {
    .auth-title {
        font-size: 28px;
        line-height: 36px;
    }
}

.auth-subtitle {
    font-size: 16px;
    line-height: 24px;
    margin: 0 0 32px;
}

@media (min-width: 480px) {
    .auth-subtitle {
        font-size: 18px;
        line-height: 26px;
        margin-bottom: 40px;
    }
}

.base-input {
    display: flex;
    align-items: center;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
}

.base-input:focus-within {
    border-color: #2962f9;
}

.base-input input {
    border: 0;
    background: transparent;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 24px;
    font-family: inherit;
    flex-grow: 1;
    outline: 0;
    width: 100%;
}

.base-input input::placeholder {
    color: #777474;
}

.field-error {
    color: #fd4b4b;
    font-size: 12px;
    line-height: 18px;
    margin-top: 8px;
}

.btn {
    display: block;
    width: 100%;
    font-family: var(--main-font);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: 0;
    min-height: 48px;
    margin-top: 16px;
}

.btn-primary {
    background: #d4d7de;
    color: white;
    padding: 8px 32px;
}

.btn-primary:not(:disabled) {
    background: #2962f9;
}

.btn-primary:not(:disabled):hover {
    background: #264eb1;
}

.btn-primary:disabled {
    cursor: default;
}

.auth-mode-switch {
    line-height: 40px;
    font-size: 16px;
}

.auth-mode-link {
    color: #2962f9;
    font-weight: 600;
    text-decoration: none;
}

.auth-mode-link:hover {
    color: #264eb1;
    text-decoration: underline;
}

.auth-divider {
    color: #5c5c5c;
    position: relative;
    text-align: center;
    margin: 32px 0 24px;
    font-size: 14px;
    line-height: 20px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e7e7e7;
    z-index: -1;
}

@media (min-width: 480px) {
    .auth-divider {
        margin-top: 40px;
    }
}

.auth-divider__text {
    background: white;
    padding: 0 12px;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-social {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e7e7e7;
    border-radius: 2px;
    height: 48px;
    color: black;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    width: 100%;
    margin-top: 0;
    font-family: inherit;
}

@media (min-width: 480px) {
    .btn-social {
        height: 44px;
        min-height: 44px;
        justify-content: flex-start;
    }
}

.btn-social-logo-wrapper {
    width: 40px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1px;
    flex-shrink: 0;
}

@media (min-width: 480px) {
    .btn-social-logo-wrapper {
        margin-right: 8px;
    }
}

.btn-social-label {
    display: block;
}

.btn-yandex:hover {
    background: #ff0000;
    border-color: transparent;
    color: white;
}

.btn-yandex:hover img {
    filter: brightness(0) invert(1);
}

.btn-vkid:hover {
    background: #0077ff;
    border-color: transparent;
    color: white;
}

.btn-vkid:hover img {
    filter: brightness(0) invert(1);
}

.btn-google:hover {
    background: #4285f4;
    border-color: transparent;
    color: white;
}

.btn-google:hover .btn-social-logo-wrapper {
    background: white;
}

.auth-warning {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 16px 12px;
    gap: 12px;
    margin: 12px auto 24px;
    font-size: 16px;
    line-height: 24px;
    background: #fff3d4;
    border-radius: 2px;
}

.auth-warning__icon {
    color: #969698;
    flex-shrink: 0;
}

.auth-warning__content {
    color: #5c5c5c;
}

.auth-disclaimer {
    font-size: 16px;
    line-height: 24px;
    margin-top: 32px;
    font-weight: 400;
}

@media (min-width: 480px) {
    .auth-disclaimer {
        margin-top: 40px;
    }
}

.auth-disclaimer a {
    color: #2962f9;
    text-decoration: none;
}

.auth-disclaimer a:hover {
    text-decoration: underline;
}

.auth-code-subtitle {
    font-size: 16px;
    line-height: 24px;
    margin: 0 0 32px;
}

@media (min-width: 480px) {
    .auth-code-subtitle {
        margin-bottom: 40px;
    }
}

.auth-highlight {
    color: #2962f9;
}

.otp-digits {
    display: flex;
    gap: 8px;
}

.otp-digit {
    flex: 1;
    min-width: 0;
    height: 52px;
    border: 1.5px solid #e7e7e7;
    border-radius: 2px;
    font-family: var(--second-font);
    font-size: 24px;
    line-height: 32px;
    font-weight: bold;
    text-align: center;
    color: var(--text);
    outline: none;
    padding: 0;
}

.otp-digit:focus {
    border-color: #2962f9;
    border-width: 2px;
}

.otp-resend-link {
    display: block;
    text-align: center;
    margin: auto;
    line-height: 40px;
    font-weight: 600;
    color: #2962f9;
    text-decoration: none;
}

.otp-resend-link.disabled,
.otp-resend-link:disabled {
    color: #d4d7de;
    pointer-events: none;
}

.otp-resend-link--success {
    color: #65b846;
}

#no-attempts-block {
    font-size: 16px;
    line-height: 24px;
    margin-top: 32px;
}

#no-attempts-block a {
    color: #2962f9;
}

a:visited {
    color: #7142d6;
}
