/* KAEROS: страницы входа и регистрации. Работает поверх style.css (токены .kaeros). */

.auth {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}
.auth::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 50% auto 0;
    height: 620px;
    pointer-events: none;
    background:
            radial-gradient(60% 60% at 50% 0%, rgb(250 201 71 / 0.22), rgb(250 201 71 / 0.07) 48%, transparent 78%),
            radial-gradient(80% 60% at 50% 0%, rgb(120 150 230 / 0.06), transparent 70%);
}

/* Левая колонка: форма */
.auth__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 28px 56px 32px;
}
.auth__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
}
.auth__logo {
    display: inline-flex;
}
.auth__logo img {
    width: 156px;
}
.auth__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    transition: color var(--dur) var(--ease);
}
.auth__back:hover {
    color: var(--ink);
}
.auth__body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}
.auth__foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s-2) var(--s-5);
    font-size: var(--t-label);
    color: var(--muted);
}
.auth__foot nav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--s-4);
}
.auth__foot a:hover {
    color: var(--accent);
}

/* Форма */
.auth-form {
    width: 100%;
    max-width: 420px;
    display: grid;
    gap: 20px;
}
.auth-form__head {
    display: grid;
    gap: 10px;
    margin-bottom: 4px;
}
.auth-form h1 {
    font-size: clamp(30px, 1.2vw + 22px, 40px);
    line-height: 1.08;
    letter-spacing: -0.035em;
}
.auth-form__sub {
    color: var(--muted);
    font-size: 15px;
}
.auth-form__sub a,
.auth-link {
    color: var(--accent);
    font-weight: 500;
}
.auth-form__sub a:hover,
.auth-link:hover {
    color: var(--accent-soft);
}
.auth-form .btn {
    width: 100%;
    height: 48px;
}
.auth-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
    min-width: 0;
}
.field > label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}
.field__hint {
    font-size: 12.5px;
    color: rgb(169 178 198 / 0.8);
}
.input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: rgb(255 255 255 / 0.04);
    color: var(--ink);
    font: 400 15px/1.2 var(--font);
    transition:
            border-color var(--dur) var(--ease),
            background-color var(--dur) var(--ease),
            box-shadow var(--dur) var(--ease);
}
.input::placeholder {
    color: rgb(242 239 230 / 0.32);
}
.input:hover {
    border-color: rgb(242 239 230 / 0.3);
}
.input:focus {
    outline: none;
    border-color: rgb(250 201 71 / 0.65);
    background: rgb(255 255 255 / 0.06);
    box-shadow: 0 0 0 3px rgb(250 201 71 / 0.14);
}
.input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
}
.input--upper {
    text-transform: uppercase;
}
.input--upper::placeholder {
    text-transform: none;
}
.input:-webkit-autofill {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 100px #16264f inset;
    caret-color: var(--ink);
}
select.input {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a9b2c6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}
select.input option {
    background: var(--card);
    color: var(--ink);
}

.password {
    position: relative;
}
.password .input {
    padding-right: 48px;
}
.password__toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.password__toggle:hover {
    color: var(--ink);
}
.password__toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.password__toggle .i-hide,
.password.is-shown .i-show {
    display: none;
}
.password.is-shown .i-hide {
    display: block;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}
.check input {
    appearance: none;
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    border-radius: 5px;
    border: 1px solid var(--line-strong);
    background: rgb(255 255 255 / 0.04);
    cursor: pointer;
    transition:
            background-color var(--dur) var(--ease),
            border-color var(--dur) var(--ease);
}
.check input:checked {
    border-color: var(--accent);
    background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='%23070e20' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}
.check a {
    color: var(--accent);
}
.check a:hover {
    color: var(--accent-soft);
}

.captcha {
    min-height: 65px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--muted);
}
.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.tg-login {
    display: flex;
    justify-content: center;
    min-height: 40px;
}

/* Сообщения */
.alert {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 12px 40px 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
}
.alert--error {
    background: rgb(226 102 122 / 0.1);
    box-shadow: inset 0 0 0 1px rgb(226 102 122 / 0.4);
    color: #ffb3bf;
}
.alert--ok {
    background: rgb(79 209 154 / 0.1);
    box-shadow: inset 0 0 0 1px rgb(79 209 154 / 0.35);
    color: #8be3bd;
}
.alert b {
    font-weight: 600;
}
.alert ul {
    display: grid;
    gap: 2px;
}
.alert__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.alert__close:hover {
    opacity: 1;
}

/* Правая колонка: о сервисе */
.auth__side {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    border-left: 1px solid var(--line);
    background:
            radial-gradient(70% 50% at 50% 0%, rgb(250 201 71 / 0.12), transparent 70%),
            radial-gradient(80% 70% at 100% 100%, rgb(70 110 200 / 0.18), transparent 70%),
            linear-gradient(180deg, #102044, #0b1634);
}
.auth__side-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    display: grid;
    gap: 28px;
}
.auth__side .pill {
    justify-self: start;
}
.auth__side h2 {
    font-size: clamp(28px, 1.3vw + 18px, 40px);
    line-height: 1.1;
}
.auth__side .t-lead {
    color: var(--muted);
    font-size: 17px;
}
.auth__side .facts li {
    font-size: 15px;
}
.auth__side .facts img {
    width: 20px;
    height: auto;
}
.auth__card {
    display: grid;
    gap: 14px;
    padding: 22px 24px;
}
.auth__card-title {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.auth-steps {
    display: grid;
    gap: 12px;
    counter-reset: step;
}
.auth-steps li {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    font-size: 15px;
}
.auth-steps li::before {
    counter-increment: step;
    content: counter(step);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--card);
    box-shadow: inset 0 0 0 1px rgb(250 201 71 / 0.5);
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
}
.auth-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.auth-stats p {
    display: grid;
    gap: 2px;
    font-size: 13px;
    color: var(--muted);
}
.auth-stats b {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.auth__support {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
    font-size: 15px;
    font-weight: 500;
}
.auth__support img {
    width: 22px;
    height: 22px;
}
.auth__support:hover {
    color: var(--accent);
}
.auth__wordmark {
    position: absolute;
    left: 56px;
    right: 56px;
    bottom: -2.2vw;
    opacity: 0.05;
    pointer-events: none;
}
.auth__wordmark img {
    width: 100%;
}

/* Адаптив */
@media (max-width: 1199px) {
    .auth__main {
        padding-inline: 40px;
    }
    .auth__side {
        padding: 48px 40px;
    }
}
@media (max-width: 959px) {
    .auth {
        grid-template-columns: minmax(0, 1fr);
    }
    .auth::before {
        inset: 0 0 auto 0;
    }
    .auth__main {
        min-height: 100vh;
        min-height: 100dvh;
    }
    .auth__side {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 56px 40px 64px;
    }
    .auth__wordmark {
        display: none;
    }
}
@media (max-width: 639px) {
    .auth__main {
        padding: 18px 20px 24px;
    }
    .auth__logo img {
        width: 132px;
    }
    .auth__body {
        align-items: flex-start;
        padding: 36px 0;
    }
    .auth-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .auth__side {
        padding: 48px 20px 56px;
    }
    .auth-stats b {
        font-size: 19px;
    }
}
