.block__auth-modal {
    position: fixed;
    inset: 0;
    z-index: var(--auth-modal-z-index, 100);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 24px;
    background: rgba(0, 0, 0, var(--auth-modal-overlay-opacity, .52));
}

.block__auth-modal[hidden] {
    display: none;
}

.b_auth-modal--dialog {
    position: relative;
    box-sizing: border-box;
    width: min(100%, var(--auth-modal-max-width, 560px));
    margin: auto;
    padding: 46px 50px 54px;
    border-radius: 16px;
    background: #fff;
    color: #171717;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}

.b_auth-modal--close {
    position: absolute;
    top: 14px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #171717;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.b_auth-modal--close:focus-visible,
.b_auth-modal--password-toggle:focus-visible,
.b_auth-modal--link:focus-visible,
.b_auth-modal--submit:focus-visible {
    outline: 2px solid #8a1f1f;
    outline-offset: 3px;
}

.b_auth-modal--brand {
    display: flex;
    justify-content: center;
    width: min(210px, 62%);
    margin: 0 auto 36px;
}

.b_auth-modal--logo {
    display: block;
    width: 100%;
    max-height: 64px;
    object-fit: contain;
}

.b_auth-modal--title {
    margin: 0 0 34px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 400;
    line-height: 1.15;
    text-align: center;
}

.b_auth-modal--form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.b_auth-modal--field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.b_auth-modal--control {
    position: relative;
}

.b_auth-modal--input {
    box-sizing: border-box;
    width: 100%;
    min-height: 66px;
    padding: 18px 17px 12px;
    border: 1px solid #aaa;
    border-radius: 2px;
    background: #fff;
    color: #171717;
    font: inherit;
    font-size: 17px;
}

.b_auth-modal--label {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    max-width: calc(100% - 24px);
    padding: 0 5px;
    transform: translateY(-50%);
    background: transparent;
    color: #626875;
    font-size: 17px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: text;
    transition:
        top .18s ease,
        transform .18s ease,
        padding .18s ease,
        background-color .18s ease,
        color .18s ease,
        font-size .18s ease;
}

.b_auth-modal--required {
    color: inherit;
}

.b_auth-modal--input:focus + .b_auth-modal--label,
.b_auth-modal--input:not(:placeholder-shown) + .b_auth-modal--label,
.b_auth-modal--input:-webkit-autofill + .b_auth-modal--label {
    top: 0;
    padding: 0 7px;
    transform: translateY(-50%);
    background: #fff;
    color: #171717;
    font-size: 15px;
}

.b_auth-modal--input:focus {
    border-color: #171717;
    outline: 1px solid #171717;
}

.b_auth-modal--field.__error .b_auth-modal--input {
    border-color: #a21d24;
}

.b_auth-modal--control.__password .b_auth-modal--input {
    padding-right: 56px;
}

.b_auth-modal--password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #555;
    cursor: pointer;
}

.b_auth-modal--error,
.b_auth-modal--notice {
    color: #a21d24;
    font-size: 13px;
    line-height: 1.35;
}

.b_auth-modal--notice.__success {
    color: #27633a;
}

.b_auth-modal--error:empty {
    display: none;
}

.b_auth-modal--link {
    align-self: flex-start;
    color: #171717;
    font-size: 15px;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.block__page .b_auth-modal--link {
    text-decoration: underline;
}

.b_auth-modal--submit {
    min-height: 62px;
    margin-top: 10px;
    padding: 14px 24px;
    border: 1px solid #171717;
    border-radius: 999px;
    background: #171717;
    color: #fff;
    font-size: 17px;
    text-transform: uppercase;
    cursor: pointer;
}

.b_auth-modal--submit:hover {
    background: #8a1f1f;
    border-color: #8a1f1f;
}

.b_auth-modal--submit:disabled {
    cursor: wait;
    opacity: .7;
}

.b_auth-modal--link.__register {
    margin-top: 8px;
}

body.__auth-modal-locked {
    overflow: hidden;
}

@media (max-width: 600px) {
    .block__auth-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .b_auth-modal--dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        padding: 40px 24px 36px;
        border-radius: 14px;
    }

    .b_auth-modal--brand {
        width: min(180px, 58%);
        margin-bottom: 28px;
    }

    .b_auth-modal--title {
        margin-bottom: 26px;
        font-size: 30px;
    }

    .b_auth-modal--input {
        min-height: 60px;
    }
}
