:root {
    --kn-navy: #05004f;
    --kn-navy-deep: #02002f;
    --kn-blue: #2500ff;
    --kn-blue-light: #5b45ff;

    --auth-text: #18182b;
    --auth-muted: #77798c;
    --auth-border: #dfe1eb;
    --auth-background: #f7f8fc;
    --auth-error: #d83a52;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.auth-page {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--auth-background);
    color: var(--auth-text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(480px, 1.08fr) minmax(500px, 0.92fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* Левая фирменная часть */

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    overflow: hidden;
    padding: 64px 72px 42px;
    background:
        radial-gradient(
            circle at 78% 22%,
            rgba(91, 69, 255, 0.75),
            transparent 34%
        ),
        linear-gradient(
            145deg,
            var(--kn-navy-deep) 0%,
            var(--kn-navy) 46%,
            #1900c8 100%
        );
    color: #ffffff;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.04),
            transparent 35%
        );
}

.auth-brand__content,
.auth-brand__footer {
    position: relative;
    z-index: 3;
}

.auth-brand__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 650px;
}

.auth-brand__logo {
    display: block;
    width: min(420px, 78%);
    max-height: 180px;
    object-fit: contain;
    object-position: left center;
}

.auth-brand__description {
    margin-top: clamp(80px, 14vh, 160px);
}

.auth-brand__title {
    max-width: 600px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(36px, 4vw, 62px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.auth-brand__text {
    max-width: 520px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 18px;
    line-height: 1.65;
}

.auth-brand__footer {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-brand__footer-divider {
    width: 28px;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
}

/* Декоративные элементы */

.auth-brand__decor {
    position: absolute;
    z-index: 1;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand__decor--one {
    right: -240px;
    bottom: -280px;
    width: 720px;
    height: 720px;
}

.auth-brand__decor--two {
    right: -105px;
    bottom: -145px;
    width: 440px;
    height: 440px;
    border-color: rgba(255, 255, 255, 0.1);
}

.auth-brand__glow {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(4px);
}

.auth-brand__glow--top {
    top: -180px;
    right: -140px;
    width: 520px;
    height: 520px;
    background: rgba(58, 22, 255, 0.28);
}

.auth-brand__glow--bottom {
    right: 80px;
    bottom: -210px;
    width: 500px;
    height: 500px;
    background: rgba(69, 29, 255, 0.22);
}

/* Правая часть */

.auth-form-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 52px 64px 38px;
    background:
        radial-gradient(
            circle at 95% 5%,
            rgba(37, 0, 255, 0.055),
            transparent 25%
        ),
        #ffffff;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-mobile-logo {
    display: none;
}

.auth-card__header {
    margin-bottom: 38px;
}

.auth-card__eyebrow {
    margin-bottom: 13px;
    color: var(--kn-blue);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-card__title {
    margin: 0;
    color: var(--auth-text);
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.auth-card__subtitle {
    margin: 13px 0 0;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.55;
}

/* Поля формы */

.auth-field {
    margin-bottom: 23px;
}

.auth-field__label {
    display: inline-block;
    margin-bottom: 9px;
    color: #363649;
    font-size: 14px;
    font-weight: 600;
}

.auth-field__control {
    position: relative;
}

.auth-field__input.form-control {
    width: 100%;
    height: 56px;
    padding: 0 17px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    background: #ffffff;
    color: var(--auth-text);
    font-size: 15px;
    box-shadow: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.auth-field__input.form-control::placeholder {
    color: #a4a5b3;
}

.auth-field__input.form-control:hover {
    border-color: #c5c7d4;
}

.auth-field__input.form-control:focus {
    border-color: var(--kn-blue);
    box-shadow: 0 0 0 4px rgba(37, 0, 255, 0.09);
}

.auth-field__control--password .auth-field__input {
    padding-right: 56px;
}

.auth-field.has-error .auth-field__input,
.auth-field__input.is-invalid {
    border-color: var(--auth-error);
}

.auth-field.has-error .auth-field__input:focus,
.auth-field__input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(216, 58, 82, 0.09);
}

.auth-field__error {
    display: block;
    min-height: 18px;
    margin-top: 7px;
    color: var(--auth-error);
    font-size: 13px;
    line-height: 1.4;
}

/* Показать пароль */

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8a8c9c;
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        color 0.18s ease,
        background 0.18s ease;
}

.auth-password-toggle:hover {
    background: #f1f2f7;
    color: var(--kn-blue);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--kn-blue);
    outline-offset: 2px;
}

.auth-password-toggle__hide {
    display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle__show {
    display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle__hide {
    display: block;
}

/* Запомнить меня */

.auth-form__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -2px;
    margin-bottom: 26px;
}

.auth-remember {
    margin: 0;
}

.auth-remember .form-check {
    display: flex;
    align-items: center;
    min-height: auto;
    margin: 0;
    padding: 0;
}

.auth-remember__input,
.auth-remember .form-check-input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    border: 1px solid #c9cad5;
    border-radius: 5px;
    background-color: #ffffff;
    cursor: pointer;
    box-shadow: none;
}

.auth-remember__input:checked,
.auth-remember .form-check-input:checked {
    border-color: var(--kn-blue);
    background-color: var(--kn-blue);
}

.auth-remember__input:focus,
.auth-remember .form-check-input:focus {
    border-color: var(--kn-blue);
    box-shadow: 0 0 0 4px rgba(37, 0, 255, 0.09);
}

.auth-remember__label,
.auth-remember .form-check-label {
    margin: 0;
    color: #606173;
    font-size: 14px;
    cursor: pointer;
}

/* Кнопка */

.auth-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 14px 22px;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background:
        linear-gradient(
            110deg,
            var(--kn-navy) 0%,
            var(--kn-blue) 100%
        );
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(31, 0, 215, 0.2);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        opacity 0.18s ease;
}

.auth-submit::before {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 80%;
    height: 100%;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.18),
            transparent
        );
    transform: skewX(-20deg);
    transition: left 0.45s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 17px 34px rgba(31, 0, 215, 0.27);
}

.auth-submit:hover::before {
    left: 150%;
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(37, 0, 255, 0.22);
    outline-offset: 3px;
}

.auth-submit:disabled,
.auth-submit.is-loading {
    cursor: wait;
    opacity: 0.8;
    transform: none;
}

.auth-submit__text,
.auth-submit__loader {
    position: relative;
    z-index: 1;
}

.auth-submit__loader {
    display: none;
    width: 19px;
    height: 19px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

.auth-submit.is-loading .auth-submit__loader {
    display: block;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Подсказка */

.auth-card__notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 27px;
    padding-top: 25px;
    border-top: 1px solid #ececf2;
    color: #898a99;
    font-size: 13px;
    line-height: 1.5;
}

.auth-card__notice-icon {
    display: inline-flex;
    flex: 0 0 auto;
    color: var(--kn-blue);
}

.auth-copyright {
    position: absolute;
    right: 32px;
    bottom: 24px;
    left: 32px;
    color: #a0a1ae;
    font-size: 12px;
    text-align: center;
}

/* Планшеты */

@media (max-width: 1100px) {
    .auth-shell {
        grid-template-columns: minmax(390px, 0.9fr) minmax(460px, 1.1fr);
    }

    .auth-brand {
        padding: 52px 44px 38px;
    }

    .auth-brand__logo {
        width: min(340px, 90%);
    }

    .auth-brand__description {
        margin-top: 100px;
    }

    .auth-brand__title {
        font-size: 42px;
    }

    .auth-form-section {
        padding-right: 44px;
        padding-left: 44px;
    }
}

/* Мобильная версия */

@media (max-width: 820px) {
    body.auth-page {
        background: #ffffff;
    }

    .auth-shell {
        display: block;
    }

    .auth-brand {
        display: none;
    }

    .auth-form-section {
        justify-content: flex-start;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 38px 22px 76px;
        background:
            radial-gradient(
                circle at 100% 0,
                rgba(37, 0, 255, 0.08),
                transparent 28%
            ),
            #ffffff;
    }

    .auth-mobile-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 44px;
    }

    .auth-mobile-logo__image {
        display: block;
        width: min(270px, 72vw);
        max-height: 105px;
        object-fit: contain;
    }

    .auth-card {
        max-width: 480px;
    }

    .auth-card__header {
        margin-bottom: 32px;
    }

    .auth-card__eyebrow {
        text-align: center;
    }

    .auth-card__title {
        font-size: 32px;
        text-align: center;
    }

    .auth-card__subtitle {
        text-align: center;
    }

    .auth-copyright {
        position: static;
        margin-top: 52px;
    }
}

@media (max-width: 420px) {
    .auth-form-section {
        padding-right: 17px;
        padding-left: 17px;
    }

    .auth-mobile-logo {
        margin-bottom: 36px;
    }

    .auth-card__title {
        font-size: 29px;
    }

    .auth-card__subtitle {
        font-size: 14px;
    }

    .auth-field__input.form-control {
        height: 54px;
    }

    .auth-submit {
        min-height: 54px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
