.auth-page .site-header__inner {
    height: 56px;
}

.auth-page .logo__img {
    height: 28px;
}

.auth-page .site-header__inner {
    justify-content: space-between;
}

.auth-header-lang {
    display: none;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 80px;
    height: calc(100vh - 57px);
    height: calc(100dvh - 57px);
    min-height: 580px;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* ---------- Poster ---------- */

.auth-poster {
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 24px;
    background-color: #0E3A4A;
    background-position: center;
    background-size: cover;
}

.auth-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(3, 18, 28, 0.78) 0%, rgba(3, 18, 28, 0.25) 32%, transparent 55%);
    pointer-events: none;
}

.auth-poster__caption {
    position: relative;
    z-index: 1;
    max-width: 400px;
    padding: 28px;
    color: #fff;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
}

/* ---------- Panel ---------- */

.auth-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 8px;
}

.auth-panel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary) !important;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-back:hover {
    color: var(--primary-hover) !important;
}

.auth-back svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Form ---------- */

.auth-form {
    width: 100%;
    max-width: 400px;
    margin: auto 0;
    padding: 24px 0;
}

.auth-form__title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.auth-form__subtitle {
    margin-top: 10px;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}

.field + .field {
    margin-top: 16px;
}

.field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.field__control {
    position: relative;
}

.field__input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field__input::placeholder {
    color: #94A3B8;
}

.field__input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(58, 111, 248, 0.12);
}

.field__input--with-action {
    padding-right: 96px;
}

.field__input--invalid,
.field__input--invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.field__input--shake {
    animation: field-shake 0.4s ease;
}

@keyframes field-shake {
    20%, 60% {
        transform: translateX(-6px);
    }
    40%, 80% {
        transform: translateX(6px);
    }
}

.field__action {
    position: absolute;
    top: 50%;
    right: 14px;
    padding: 4px 2px;
    border: none;
    background: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transform: translateY(-50%);
}

.field__action:hover {
    color: var(--primary-hover);
}

.auth-form__error {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #FEF2F2;
    color: #B91C1C;
    font-size: 14px;
}

.auth-form__submit {
    width: 100%;
    height: 48px;
    margin-top: 20px;
}

.auth-form__help {
    margin-top: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .auth {
        gap: 48px;
    }
}

@media (max-width: 860px) {
    .auth-page .site-header__inner {
        height: 52px;
    }

    .auth-page .logo__img {
        height: 24px;
    }

    .auth-header-lang {
        display: block;
    }

    .auth-panel .lang-switcher {
        display: none;
    }

    .auth {
        display: flex;
        flex-direction: column;
        gap: 16px;
        height: auto;
        min-height: 0;
        padding-top: 16px;
    }

    .auth-panel {
        display: contents;
    }

    .auth-panel__top {
        order: 1;
    }

    .auth-poster {
        order: 2;
        min-height: 150px;
        border-radius: 20px;
    }

    .auth-poster__caption {
        padding: 20px 16px;
        font-size: 14px;
    }

    .auth-form {
        order: 3;
        max-width: none;
        margin: 0;
        padding: 4px 0 24px;
    }

    .auth-form__title {
        font-size: 32px;
    }

    .auth-form__subtitle {
        margin-bottom: 24px;
    }

    .field__input {
        font-size: 16px;
    }

    .auth-form__submit {
        height: 52px;
    }
}
