:root {
    --auth-error: #E02929;
    --auth-violet: #6E0CFF;
    --auth-violet-light: #9C5AFF;
    --auth-bg-grey: #F9F9F9;
    --auth-border-grey: #E5E5E5;
    --auth-white: #FFFFFF;
    --auth-text-grey: #797979;
    --auth-text-light-grey: #BEBEBE;
    --auth-text: #171717;
    --auth-blue: #0057FF;
    --auth-success: #10C44C;
}

#modals, #modals *, .auth-block, .auth-block * { box-sizing: border-box; }
#modals { font-family: Onest, "GT Eesti Pro Display", Arial, sans-serif; }
#modals .modal_ { display: none; position: fixed; inset: 0; z-index: 999999; align-items: center; justify-content: center; }
#modals .modal_.open { display: flex; }
#modals .modal-bg { position: absolute; inset: 0; background: rgba(0,26,52,.20); }
#modals .modal-container { position: relative; z-index: 1; background: var(--auth-white); border-radius: 16px; width: 95%; max-width: 460px; padding: 40px; overflow: hidden; }
#modals .modal-head { position: absolute; top: 16px; left: 16px; right: 16px; height: 24px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
#modals .modal-close, #modals .modal-login__btn-back { width: 24px; height: 24px; max-width: 24px; max-height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; cursor: pointer; transition: opacity .3s; pointer-events: auto; }
#modals .modal-close { margin-left: auto; }
#modals .modal-login__btn-back { margin-right: auto; }
#modals .modal-close:hover, #modals .modal-login__btn-back:hover { opacity: .7; }
#modals .modal-close svg, #modals .modal-login__btn-back svg { width: 24px; height: 24px; display: block; }
#modals .modal-body { display: flex; flex-direction: column; }
#modals .modal-login { font-family: Onest, "GT Eesti Pro Display", Arial, sans-serif; }
#modals .modal-login__icon { align-self: center; display: inline-flex; align-items: center; justify-content: center; width: 100px; height: 100px; margin-block-end: 20px; }
#modals .modal-login__icon svg { width: 100%; height: 100%; }
#modals .modal-login__title { color: var(--auth-text); font-size: 24px; line-height: 32px; font-weight: 700; text-align: center; margin: 0 0 16px; text-transform: none; }
#modals .modal-login__text { color: var(--auth-text); font-size: 16px; line-height: 24px; font-weight: 400; margin: 0 0 20px; text-transform: none; }
#modals .modal-login__text span { font-weight: 500; word-break: break-word; }
#modals .modal-login__note { color: var(--auth-text-light-grey); font-size: 14px; line-height: 20px; font-weight: 400; margin: 0; }
#modals .modal-login__note a { color: var(--auth-blue); text-decoration: none; }
#modals .form { display: flex; flex-direction: column; margin: 0; }
#modals .input { display: flex; position: relative; background: var(--auth-white); border: 2px solid var(--auth-border-grey); border-radius: 8px; transition: border-color .2s, background-color .2s; width: 100%; }
#modals .input:not(:last-child), #modals .modal-login__input:has(+ .modal-login__input) { margin-bottom: 12px; }
#modals .input__field { width: 100%; min-height: 52px; padding: 12px 16px; border: 0; border-radius: 8px; background: transparent; color: var(--auth-text); font-family: inherit; font-size: 16px; line-height: 24px; font-weight: 400; outline: none !important; box-shadow: none !important; text-transform: none; }
#modals .input__field::placeholder { color: var(--auth-text-light-grey); opacity: 1; }
#modals .input.with-icon .input__field { padding-right: 40px; }
#modals .input.with-icon .input__icon { display: inline-flex; }
#modals .input__icon { display: none; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; cursor: pointer; align-items: center; justify-content: center; }
#modals .input__icon svg { position: absolute; width: 16px; height: 16px; }
#modals .input__icon svg:last-child { display: none; }
#modals .input__icon.active svg:first-child { display: none; }
#modals .input__icon.active svg:last-child { display: block; }
#modals .input.with-error { background: rgba(224, 41, 41, .08); border-color: var(--auth-error); }
#modals .input__message { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; color: var(--auth-error); font-size: 14px; line-height: 20px; font-weight: 400; }
#modals .input.with-message { margin-bottom: 28px; }
#modals .input.with-message .input__message { display: block; }
#modals .form__message { display: none; color: var(--auth-error); font-size: 14px; line-height: 20px; font-weight: 400; margin: 8px 0 0; }
#modals .form.with-message .form__message, #modals .form.with-error .form__message { display: block; }
#modals .form.with-error .form__message { color: var(--auth-error); }
#modals .modal-login__btn { position: relative; display: inline-flex; width: 100%; justify-content: center; align-items: center; gap: 8px; margin: 16px 0 12px; padding: 12px 28px; min-height: 48px; border: 0; border-radius: 8px; background: var(--auth-violet); color: var(--auth-white); font-family: inherit; font-size: 16px; line-height: 24px; font-weight: 500; text-decoration: none; text-align: center; text-transform: none; transition: background .3s, color .3s; cursor: pointer; }
#modals .modal-login__btn:hover { background: var(--auth-violet-light); color: var(--auth-white); }
#modals .modal-login__btn:disabled, #modals .modal-login__btn.disabled { background: #EFEFEF; color: var(--auth-text-grey); cursor: default; pointer-events: none; }
#modals .modal-login__btn-clear { display: inline-flex; justify-content: center; align-items: center; border: 0; background: none; color: var(--auth-violet); font-family: inherit; font-size: 16px; line-height: 24px; font-weight: 400; padding: 0; margin: 0 auto; text-transform: none; cursor: pointer; transition: color .3s, opacity .3s; }
#modals .modal-login__btn-clear:hover { color: var(--auth-violet-light); }
#modals .modal-login__btn-clear.disabled { color: var(--auth-text-light-grey); pointer-events: none; }
#modals .modal-login__btn-clear.hide { display: none; }
#modals .modal-login__btn-middle { margin-block: 8px; width: max-content; }
#modals .modal-login__btn-bottom { align-self: center; margin-block-start: 20px; }
#modals .js-m-timer__timer { display: none; align-items: center; justify-content: center; color: var(--auth-text-light-grey); font-size: 16px; line-height: 24px; text-align: center; }
#modals #modal-pass-link--success .js-m-timer__timer { color: var(--auth-text-light-grey); }
#modals .modal-login--code-enter .modal-login__input { margin: 0; width: 100%; }
#modals .modal-login--code-enter .modal-login__input .input-auth-code { font-weight: 400; }
#modals .modal-login--code-enter .modal-login__btn-bottom { margin-block-start: 20px; }
#modals .modal-login--code-enter .modal-login__btn-clear { margin: 0; }
#modals .form__rules { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 12px; background: var(--auth-bg-grey); border-radius: 12px; list-style: none; }
#modals .form__rules li { display: flex; align-items: center; gap: 8px; color: var(--auth-text); font-size: 14px; line-height: 20px; list-style: none; }
#modals .form__rules li .icon { display: inline-flex; width: 16px; height: 16px; background-position: center; background-repeat: no-repeat; background-size: 16px; }
#modals .form__rules li.invalid .icon { background-image: url('../dist/images/icons/cross.svg'); }
#modals .form__rules li.valid .icon { background-image: url('../dist/images/icons/tick.svg'); }
#modals .loader-wrap { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; pointer-events: none; }
#modals .loader { width: 20px; height: 20px; animation: auth-rotate 1s linear infinite; }
#modals .spin { border: 3px solid var(--auth-white); border-top-color: transparent; width: 100%; height: 100%; border-radius: 50%; }
#modals .loader-resend { display: none; width: 16px; height: 16px; border: 2px solid var(--auth-violet); border-top-color: transparent; border-radius: 50%; animation: auth-rotate 1s linear infinite; }
#modals .loader-resend.active { display: inline-block; }
@keyframes auth-rotate { to { transform: rotate(360deg); } }

.auth-block { font-family: Onest, "GT Eesti Pro Display", Arial, sans-serif; display: flex; justify-content: space-between; align-items: center; background: var(--auth-bg-grey); border-radius: 24px; padding: 48px 120px; }
.auth-block__content { display: flex; flex-direction: column; max-width: 400px; }
.auth-block__content-title { color: var(--auth-text); font-size: 32px; line-height: 40px; font-weight: 700; margin: 0; text-transform: none; }
.auth-block__content-text { margin-block-start: 16px; color: var(--auth-text); font-size: 18px; line-height: 24px; font-weight: 400; }
.auth-block__content-button { width: 100%; max-width: 238px; margin-block-start: 20px; margin-block-end: 12px; padding: 12px 28px; border: 0; border-radius: 8px; background: var(--auth-violet); color: var(--auth-white); font-size: 16px; line-height: 24px; font-weight: 500; text-transform: none; transition: background .3s; cursor: pointer; }
.auth-block__content-button:hover { background: var(--auth-violet-light); }
.auth-block__img { width: 263px; height: 472px; display: inline-flex; }
.auth-block__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media(max-width: 475px) {
    #modals .modal_ { align-items: stretch; }
    #modals .modal-container { width: 100%; max-width: 100%; min-height: 100dvh; border-radius: 0; padding: 56px 16px; }
    #modals .modal-head { top: 16px; left: 16px; right: 16px; }
    #modals .modal-login__title { font-size: 20px; line-height: 28px; font-weight: 500; }
    #modals .input__message, #modals .form__message { text-align: left; }
    .auth-block { flex-direction: column; gap: 40px; padding: 20px; }
    .auth-block__content-title { font-size: 28px; line-height: 36px; }
}

/* v1.9.16 — checkout uses the existing auth flow as an inline page gate. */
body.wd-auth-checkout-gate .wd-checkout-auth-page {
    display: flex;
    width: 100%;
    min-height: 640px;
    justify-content: center;
    align-items: flex-start;
    padding: 112px 16px 160px;
}

.wd-checkout-auth-gate {
    width: 100%;
    max-width: 346px;
}

.wd-checkout-auth-gate__fallback {
    margin: 0;
    color: var(--auth-text, #171717);
    font-family: Onest, "GT Eesti Pro Display", Arial, sans-serif;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
}

#modals.auth-checkout-inline {
    width: 100%;
}

#modals.auth-checkout-inline .modal_ {
    display: none !important;
    position: static;
    inset: auto;
    width: 100%;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    user-select: auto;
    transition: none;
}

#modals.auth-checkout-inline .modal_.open {
    display: flex !important;
}

#modals.auth-checkout-inline .modal-bg,
#modals.auth-checkout-inline .js-m-modal__close {
    display: none !important;
}

#modals.auth-checkout-inline .modal-container {
    width: 100%;
    max-width: none;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: visible;
    border-radius: 0;
    background: transparent;
}

#modals.auth-checkout-inline .modal-head {
    top: -32px;
    left: 0;
    right: 0;
}

@media(max-width: 475px) {
    body.wd-auth-checkout-gate .wd-checkout-auth-page {
        min-height: 560px;
        padding: 72px 16px 112px;
    }

    #modals.auth-checkout-inline .modal_ {
        align-items: flex-start;
    }
}

/* v1.6 — Figma pixel-polish overrides. Logic stays from v1.5/source auth. */
#modals {
    --auth-violet: #6E0CFF;
    --auth-violet-light: #9C5AFF;
    --auth-error: #E02929;
    --auth-error-bg: rgba(224, 41, 41, 0.08);
    --auth-bg-grey: #F9F9F9;
    --auth-border-grey: #E5E5E5;
    --auth-disabled-bg: #EFEFEF;
    --auth-disabled-text: #797979;
    --auth-text: #171717;
    --auth-text-light-grey: #BEBEBE;
    --auth-blue: #0057FF;
    --auth-success: #10C44C;
}

#modals .modal_ {
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

#modals .modal-bg {
    background: rgba(0, 26, 52, 0.20);
}

#modals .modal-container {
    width: 95%;
    max-width: 460px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: none;
}

#modals .modal-head {
    top: 16px;
    left: 16px;
    right: 16px;
    height: 24px;
}

#modals .modal-close,
#modals .modal-login__btn-back {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 0;
}

#modals .modal-close svg,
#modals .modal-login__btn-back svg {
    width: 24px;
    height: 24px;
}

#modals .modal-close svg path,
#modals .modal-login__btn-back svg path {
    fill: var(--auth-text-light-grey);
}

#modals .modal-body {
    display: flex;
    flex-direction: column;
}

#modals .modal-login__title {
    margin: 0 0 16px;
    color: var(--auth-text);
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
    text-align: center;
    text-transform: none;
}

#modals .modal-login__text {
    margin: 0 0 20px;
    color: var(--auth-text);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    text-transform: none;
}

#modals .modal-login__text span,
#modals .modal-login__text strong {
    font-weight: 500;
    white-space: normal;
    overflow-wrap: anywhere;
}

#modals .modal-login--code-enter .js-modal-auth-agreement__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#modals .modal-login__note {
    color: var(--auth-text-light-grey);
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    margin: 0;
}

#modals .modal-login__note a {
    color: var(--auth-blue);
    text-decoration: none;
}

#modals .form {
    display: flex;
    flex-direction: column;
    margin: 0;
}

#modals .input {
    min-height: 48px;
    border: 0;
    outline: 2px solid var(--auth-border-grey);
    outline-offset: -2px;
    border-radius: 8px;
    background: var(--auth-white);
    align-items: center;
    overflow: visible;
    transition: outline-color .2s, background-color .2s;
}

#modals .input:not(.with-error):hover {
    outline-color: var(--auth-violet-light);
}

#modals .input:not(.with-error):focus-within {
    outline-color: var(--auth-violet);
}

#modals .input:has(.input__field:not(:placeholder-shown)) {
    background: var(--auth-bg-grey);
}

#modals .input.with-error {
    border: 0;
    outline-color: var(--auth-error);
    background: var(--auth-error-bg);
}

#modals .input:not(:last-child),
#modals .modal-login__input:has(+ .modal-login__input) {
    margin-bottom: 12px;
}

#modals .input__field {
    height: 48px;
    min-height: 48px;
    padding: 12px 16px;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--auth-text);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
}

#modals .input.with-icon .input__field {
    padding-right: 40px;
}

#modals .input__field::placeholder {
    color: var(--auth-text-light-grey);
    opacity: 1;
}

#modals .input__icon {
    right: 16px;
    top: 24px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
}

#modals .input__message {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    color: var(--auth-error);
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
}

#modals .input.with-message {
    margin-bottom: 28px;
}

#modals .input.with-message .input__message {
    display: block;
}

#modals .form__message {
    display: none;
    color: var(--auth-error);
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    margin: 8px 0 0;
}

#modals .form.with-message .form__message,
#modals .form.with-error .form__message {
    display: block;
}

#modals #modal-login--code-auth .form__message,
#modals #modal-login--code-enter .form__message,
#modals #modal-login--password-recover .form__message {
    font-size: 16px;
    line-height: 24px;
}

#modals #modal-login--code-enter .form__message {
    margin-top: 8px;
}

#modals .modal-login__btn {
    width: 100%;
    min-height: 48px;
    margin: 16px 0 12px;
    padding: 12px 28px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-violet);
    color: var(--auth-white);
    font-size: 16px;
    line-height: 24px;
    font-weight: 500;
    text-transform: none;
}

#modals .modal-login__btn:hover {
    background: var(--auth-violet-light);
    color: var(--auth-white);
}

#modals .modal-login__btn:disabled,
#modals .modal-login__btn.disabled {
    background: var(--auth-disabled-bg);
    color: var(--auth-disabled-text);
}

#modals .modal-login__btn-clear {
    color: var(--auth-violet);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    margin: 0 auto;
    padding: 0;
    text-transform: none;
}

#modals .modal-login__btn-clear:hover {
    color: var(--auth-violet-light);
}

#modals .modal-login__btn-clear.disabled {
    color: var(--auth-text-light-grey);
}

#modals .modal-login__btn-middle {
    margin: 8px 0;
    width: max-content;
}

#modals .modal-login__btn-bottom {
    align-self: center;
    margin-top: 20px;
}

#modals .js-m-timer_v2 {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modals .js-m-timer_v2.is-timer-active .js-m-timer__btn,
#modals .js-m-timer_v2.is-timer-active .loader-resend {
    display: none !important;
}

#modals .js-m-timer_v2:not(.is-timer-active) .js-m-timer__timer {
    display: none !important;
}

#modals .js-m-timer__timer {
    width: 100%;
    align-items: center;
    justify-content: center;
    color: var(--auth-text-light-grey);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    text-align: center;
}

#modals .modal-login__icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

#modals .modal-login__icon svg {
    width: 100px;
    height: 100px;
}

#modals .modal-login--success .modal-login__text,
#modals .modal-pass-link--success .modal-login__text {
    text-align: center;
}

#modals .modal-pass-link--success .modal-login__btn {
    margin-top: 0;
}

#modals .form__rules {
    gap: 4px;
    margin: 0;
    padding: 12px;
    background: var(--auth-bg-grey);
    border-radius: 12px;
}

#modals .form__rules li {
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
    color: var(--auth-text);
}

#modals .form__rules li .icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

#modals #modal-login--code-auth .modal-container { min-height: 426px; }
#modals #modal-login--password-auth .modal-container { min-height: 448px; }
#modals #modal-login--password-recover .modal-container { min-height: 366px; }
#modals #modal-login--password-new .modal-container { min-height: 504px; }
#modals #modal-login--code-enter .modal-container { min-height: 322px; }
#modals #modal-login--success .modal-container { min-height: 428px; }
#modals #modal-pass-link--success .modal-container { min-height: 464px; }

.auth-block__content-button {
    min-height: 48px;
    padding: 12px 28px;
    border-radius: 8px;
}

@media(max-width: 475px) {
    #modals .modal_ {
        align-items: stretch;
        justify-content: flex-start;
    }

    #modals .modal-container {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh !important;
        border-radius: 0;
        padding: 56px 16px;
    }

    #modals .modal-login__title {
        font-size: 20px;
        line-height: 28px;
        font-weight: 500;
    }

    #modals .modal-login__text {
        font-size: 16px;
        line-height: 24px;
    }

    #modals .input__message,
    #modals .form__message {
        text-align: left;
    }
}

/* v1.7 — account page polish, original-like modal animation/blur, and hover fixes. */
#modals .modal_ {
    display: flex !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    user-select: none;
    transition: opacity .3s linear, visibility 0s linear .3s;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#modals .modal_.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    user-select: auto;
    transition-delay: 0s;
}

#modals .modal-bg {
    opacity: 1;
    transition: opacity .3s linear;
}

#modals .modal-container {
    opacity: 1;
    transform: translateY(0);
    transition: transform .3s linear, opacity .3s linear;
}

#modals .modal_:not(.open) .modal-container {
    opacity: 0;
    transform: translateY(8px);
}

#modals .modal-login__btn {
    font-weight: 600;
}

#modals .modal-login__btn:hover,
#modals .modal-login__btn:focus,
#modals .modal-login__btn:active,
#modals .modal-login__btn:visited {
    color: var(--auth-white) !important;
}

.auth-block .auth-block__content-title,
.auth-block__content-title {
    margin: 0 0 16px !important;
}

.auth-block .auth-block__content-text,
.auth-block__content-text {
    margin: 0 0 20px !important;
    color: var(--auth-text) !important;
    font-size: 16px !important;
    line-height: 24px !important;
    font-weight: 500 !important;
}

.auth-block .auth-block__content-button,
.auth-block__content-button {
    color: var(--auth-white) !important;
    background: var(--auth-violet) !important;
    font-size: 16px !important;
    line-height: 24px !important;
    font-weight: 600 !important;
    text-transform: none !important;
}

.auth-block .auth-block__content-button:hover,
.auth-block .auth-block__content-button:focus,
.auth-block .auth-block__content-button:active,
.auth-block__content-button:hover,
.auth-block__content-button:focus,
.auth-block__content-button:active {
    color: var(--auth-white) !important;
    background: var(--auth-violet-light) !important;
}

@media(max-width: 475px) {
    #modals .modal_ {
        align-items: stretch;
        justify-content: flex-start;
    }
}

/* v1.8 — stable timer/action slot and original-size resend loader. */
#modals .js-m-timer_v2 {
    width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    line-height: 24px;
}

#modals .modal-login__btn-bottom.js-m-timer_v2 {
    margin-top: 20px;
}

#modals .js-m-timer_v2 .js-m-timer__btn,
#modals .js-m-timer_v2 .js-m-timer__timer,
#modals .js-m-timer_v2 .loader-resend {
    min-height: 24px;
    align-items: center;
    justify-content: center;
    margin: 0;
}

#modals .js-m-timer_v2.is-timer-active .js-m-timer__btn,
#modals .js-m-timer_v2.is-timer-active .loader-resend,
#modals .js-m-timer_v2 .js-m-timer__btn.hide {
    display: none !important;
}

#modals .js-m-timer_v2.is-timer-active .js-m-timer__timer {
    display: flex !important;
}

#modals .js-m-timer_v2:not(.is-timer-active) .js-m-timer__timer {
    display: none !important;
}

#modals .js-m-timer__timer {
    width: 100%;
    min-height: 24px;
    color: var(--auth-text-light-grey);
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    text-align: center;
}

#modals .loader-resend {
    width: 24px;
    height: 24px;
    border: 3px solid transparent;
    border-top-color: var(--auth-violet);
    border-radius: 50%;
    animation: auth-rotate 1s linear infinite;
}

#modals .loader-resend.active {
    display: flex;
    flex: 0 0 24px;
}

#modals .auth-timer-line {
    min-height: 24px;
    align-items: center;
    line-height: 24px;
}

#modals .form__message.auth-timer-line {
    margin-top: 8px;
    font-size: 16px;
    line-height: 24px;
}

/* v1.9 — align auth screens to the Figma source tokens and modal geometry. */
#modals,
#modals .modal-login,
.auth-block {
    font-family: Onest, "GT Eesti Pro Display", Arial, sans-serif;
}

#modals .modal-container {
    width: 460px;
    max-width: calc(100vw - 32px);
    padding: 40px;
    border-radius: 16px;
}

#modals .modal-login__title {
    margin: 0 0 16px;
    font-weight: 700;
    letter-spacing: 0;
}

#modals .modal-login__text {
    margin: 0 0 20px;
    letter-spacing: 0;
}

#modals .input {
    height: 48px;
    min-height: 48px;
    border: 2px solid var(--auth-border-grey);
    outline: 0;
    outline-offset: 0;
}

#modals .input:not(.with-error):hover {
    border-color: var(--auth-violet-light);
    outline-color: transparent;
}

#modals .input:not(.with-error):focus-within {
    border-color: var(--auth-violet);
    outline-color: transparent;
}

#modals .input.with-error {
    border: 2px solid var(--auth-error);
    outline: 0;
}

#modals .input__message {
    top: calc(100% + 8px);
    font-size: 16px;
    line-height: 24px;
}

#modals .input.with-message {
    margin-bottom: 48px;
}

#modals .modal-login__btn {
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 12px 28px;
    font-weight: 500;
    letter-spacing: 0;
}

#modals .modal-login__btn-clear {
    font-weight: 400;
    letter-spacing: 0;
}

#modals .modal-login__note {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0;
}

#modals #modal-login--code-auth .modal-container {
    min-height: 416px;
}

#modals #modal-login--code-auth #send-code-form .input {
    margin-bottom: 16px;
}

#modals #modal-login--code-auth #send-code-form .input.with-message {
    margin-bottom: 48px;
}

#modals #modal-login--code-auth .modal-login__note {
    margin-top: 12px;
}

#modals #modal-login--code-auth .modal-login__btn-bottom {
    margin-top: 20px;
}

#modals #modal-login--password-auth .modal-container {
    min-height: 440px;
}

#modals #modal-login--password-form .input[data-type="email"] {
    margin-bottom: 12px;
}

#modals #modal-login--password-form .input[data-type="password"] {
    margin-bottom: 8px;
}

#modals #modal-login--password-form .input.with-message {
    margin-bottom: 48px;
}

#modals #modal-login--password-form .modal-login__btn-middle {
    margin: 0;
}

#modals #modal-login--password-form .form__message {
    margin: 8px 0 0;
}

#modals #modal-login--password-form .modal-login__btn {
    margin-top: 20px;
}

#modals #modal-login--password-auth .modal-login__btn-bottom {
    margin-top: 12px;
}

#modals #modal-login--code-enter .modal-container {
    min-height: 288px;
}

#modals #modal-login--code-enter .modal-login__inputs-row {
    width: 100%;
}

#modals #modal-login--code-enter .js-m-timer_v2 {
    min-height: 24px;
    margin-top: 20px;
}

#modals #modal-login--code-enter .form__message {
    margin-top: 8px;
    font-size: 16px;
    line-height: 24px;
}

#modals .js-m-timer_v2 {
    min-height: 24px;
}

.auth-block .auth-block__content-title,
.auth-block__content-title {
    font-size: 32px !important;
    line-height: 40px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

.auth-block .auth-block__content-text,
.auth-block__content-text {
    font-size: 18px !important;
    line-height: 24px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
}

.auth-block .auth-block__content-button,
.auth-block__content-button {
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

@media(max-width: 475px) {
    #modals .modal-container {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh !important;
        padding: 56px 16px;
        border-radius: 0;
    }

    #modals .modal-login__title {
        font-size: 20px;
        line-height: 28px;
        font-weight: 500;
    }

    #modals #modal-login--password-form .input[data-type="password"] {
        margin-bottom: 12px;
    }

    #modals #modal-login--password-form .modal-login__btn-middle {
        font-size: 14px;
        line-height: 16px;
    }

    #modals #modal-login--password-form .modal-login__btn {
        margin-top: 16px;
    }

    #modals #modal-login--password-auth .modal-login__btn-bottom {
        margin-top: 20px;
    }

    .auth-block .auth-block__content-title,
    .auth-block__content-title {
        font-size: 28px !important;
        line-height: 36px !important;
    }

    .auth-block .auth-block__content-text,
    .auth-block__content-text {
        font-size: 16px !important;
        line-height: 24px !important;
    }
}

/* v1.9.2 — Chrome autofill: keep browser fill, draw auth border above it. */
#modals .input {
    position: relative;
    border: 0 !important;
    outline: 0 !important;
    overflow: visible;
    isolation: isolate;
}

#modals .input::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border: 2px solid var(--auth-border-grey);
    border-radius: 8px;
    pointer-events: none;
    transition: border-color .2s;
}

#modals .input:not(.with-error):hover::after {
    border-color: var(--auth-violet-light);
}

#modals .input:not(.with-error):focus-within::after {
    border-color: var(--auth-violet);
}

#modals .input.with-error::after {
    border-color: var(--auth-error);
}

#modals .input__field {
    position: relative;
    z-index: 1;
    border-radius: 6px;
}

#modals .input__field:-webkit-autofill,
#modals .input__field:-webkit-autofill:hover,
#modals .input__field:-webkit-autofill:focus,
#modals .input__field:-webkit-autofill:active {
    -webkit-text-fill-color: var(--auth-text);
    caret-color: var(--auth-text);
    /* Do not override autofill background: browser fill should remain visible. */
}

#modals .input__icon,
#modals .loader-wrap {
    z-index: 4;
}

/* v1.9.3 — unified auth error spacing. Visual-only: keeps timer/link/loader slots from v1.8. */
#modals {
    --auth-error-gap: 8px;
    --auth-error-line-height: 24px;
    --auth-error-to-control-gap: 16px;
    --auth-error-to-action-gap: 20px;
}

/* All inline and form-level auth errors use one typography and one input→error gap. */
#modals .input__message,
#modals .form__message {
    color: var(--auth-error);
    font-size: 16px;
    line-height: var(--auth-error-line-height);
    font-weight: 400;
}

#modals .input__message {
    top: calc(100% + var(--auth-error-gap));
}

/* Input error displayed inside .input: input → error = 8px, error → next control = 16px. */
#modals .input.with-message {
    margin-bottom: calc(var(--auth-error-gap) + var(--auth-error-line-height) + var(--auth-error-to-control-gap));
}

/* Form-level errors/timers shown after an input keep the same input→error gap. */
#modals .form__message {
    margin: var(--auth-error-gap) 0 0;
}

/* Forms where form-level error is followed directly by a primary button. */
#modals #send-code-form.with-message .form__message,
#modals #send-code-form.with-error .form__message,
#modals #modal-login--password-recover form.with-message .form__message,
#modals #modal-login--password-recover form.with-error .form__message,
#modals #modal-login--password-new form.with-message .form__message,
#modals #modal-login--password-new form.with-error .form__message {
    margin-bottom: var(--auth-error-to-control-gap);
}

/* Code-entry error is followed by the stable timer/link/loader slot: keep that slot's 20px spacing. */
#modals #modal-login--code-enter .form__message {
    margin: var(--auth-error-gap) 0 0;
}

#modals #modal-login--code-enter .js-m-timer_v2 {
    margin-top: var(--auth-error-to-action-gap);
}

/* Password form server error is followed by the submit button via the existing button margin. */
#modals #modal-login--password-form .form__message {
    margin: var(--auth-error-gap) 0 0;
}

#modals #modal-login--password-form .modal-login__btn {
    margin-top: var(--auth-error-to-action-gap);
}

/* v1.9.4 — keep input→form-level timer/error spacing stable.
   If JS leaves .with-message on the input for a form-level hold/timer message,
   do not reserve the full inline input-error space. Real field validation errors
   keep .with-error and remain unchanged. */
#modals #modal-login--code-auth #send-code-form.with-message .input.with-message:not(.with-error),
#modals #modal-login--code-auth #send-code-form.with-error .input.with-message:not(.with-error),
#modals #modal-login--password-recover form.with-message .input.with-message:not(.with-error),
#modals #modal-login--password-recover form.with-error .input.with-message:not(.with-error) {
    margin-bottom: 16px;
}

#modals #modal-login--code-auth #send-code-form .form__message.auth-timer-line,
#modals #modal-login--password-recover form .form__message.auth-timer-line {
    margin-top: 8px;
    margin-bottom: 16px;
}

/* v1.9.5 — red error/counter normalization.
   Treat every red message under an input as the same visual component:
   same typography and same input → message gap. Keeps resend/timer/link slots unchanged. */
#modals {
    --auth-error-gap: 8px;
    --auth-error-line-height: 24px;
    --auth-error-to-control-gap: 16px;
    --auth-error-to-action-gap: 20px;
}

#modals .input__message,
#modals .form__message {
    color: var(--auth-error) !important;
    font-size: 16px !important;
    line-height: var(--auth-error-line-height) !important;
    font-weight: 400 !important;
}

#modals .input__message {
    top: calc(100% + var(--auth-error-gap)) !important;
}

#modals .input.with-message {
    margin-bottom: calc(var(--auth-error-gap) + var(--auth-error-line-height) + var(--auth-error-to-control-gap)) !important;
}

#modals .form__message {
    margin-top: var(--auth-error-gap) !important;
}

/* Red hold/abuse counters are form-level messages. They must start at the same
   visual distance from the input as normal validation errors, so we remove the
   input's own bottom gap while the counter is active. */
#modals #send-code-form:has(> .form__message.auth-timer-line) > .input,
#modals #modal-login--password-recover form:has(> .form__message.auth-timer-line) > .input {
    margin-bottom: 0 !important;
}

#modals #send-code-form > .form__message.auth-timer-line,
#modals #modal-login--password-recover form > .form__message.auth-timer-line {
    margin: var(--auth-error-gap) 0 var(--auth-error-to-control-gap) !important;
    min-height: var(--auth-error-line-height) !important;
    align-items: center;
}

/* Do not let the generic input.with-message reservation affect non-error timer
   states; real inline validation keeps .with-error and the rule above. */
#modals #send-code-form:has(> .form__message.auth-timer-line) > .input.with-message:not(.with-error),
#modals #modal-login--password-recover form:has(> .form__message.auth-timer-line) > .input.with-message:not(.with-error) {
    margin-bottom: 0 !important;
}


/* v1.9.6 — single red-message rhythm and one active password-login error.
   Any red text shown under a field is visually the same component:
   input -> red message = 8px, red message -> next action/control = 16px,
   except password-login where the next action is the inline "Забыли пароль?" link
   and must keep the same 8px rhythm as the normal input -> link state. */
#modals {
    --auth-error-gap: 8px;
    --auth-error-line-height: 24px;
    --auth-error-to-control-gap: 16px;
    --auth-error-to-inline-link-gap: 8px;
}

#modals .input__message,
#modals .form__message {
    color: var(--auth-error) !important;
    font-size: 16px !important;
    line-height: var(--auth-error-line-height) !important;
    font-weight: 400 !important;
}

#modals .input__message {
    top: calc(100% + var(--auth-error-gap)) !important;
}

/* Inline field validation: field -> error = 8px; error -> next control = 16px. */
#modals .input.with-message {
    margin-bottom: calc(var(--auth-error-gap) + var(--auth-error-line-height) + var(--auth-error-to-control-gap)) !important;
}

/* Form-level red messages located immediately after an input must not inherit
   the input's generic bottom margin; otherwise the red counter/error drifts down. */
#modals form.with-error > .input:has(+ .form__message),
#modals form.with-message > .input:has(+ .form__message) {
    margin-bottom: 0 !important;
}

#modals form.with-error > .input + .form__message,
#modals form.with-message > .input + .form__message {
    margin: var(--auth-error-gap) 0 var(--auth-error-to-control-gap) !important;
    min-height: var(--auth-error-line-height) !important;
}

/* Explicit coverage for the two form-level email flows: code auth and password recovery. */
#modals #send-code-form.with-error > .input,
#modals #send-code-form.with-message > .input,
#modals #modal-login--password-recover form.with-error > .input,
#modals #modal-login--password-recover form.with-message > .input {
    margin-bottom: 0 !important;
}

#modals #send-code-form.with-error > .form__message,
#modals #send-code-form.with-message > .form__message,
#modals #modal-login--password-recover form.with-error > .form__message,
#modals #modal-login--password-recover form.with-message > .form__message {
    margin: var(--auth-error-gap) 0 var(--auth-error-to-control-gap) !important;
    min-height: var(--auth-error-line-height) !important;
}

/* Password login has a permanent "Забыли пароль?" link right after the password field.
   With an error: password field -> error = 8px and error -> link = 8px,
   matching the normal password field -> link spacing. */
#modals #modal-login--password-form .input[data-type="password"].with-message {
    margin-bottom: calc(var(--auth-error-gap) + var(--auth-error-line-height) + var(--auth-error-to-inline-link-gap)) !important;
}

#modals #modal-login--password-form .modal-login__btn-middle {
    margin-top: 0 !important;
}

/* Server login/password error is now rendered in the password field slot; keep the
   old form-level block completely out of layout if a stale class/text appears. */
#modals #modal-login--password-form .form__message:empty,
#modals #modal-login--password-form:not(.with-error):not(.with-message) .form__message {
    display: none !important;
    margin: 0 !important;
    min-height: 0 !important;
}

#modals #modal-login--password-form .modal-login__btn {
    margin-top: 20px !important;
}

/* v1.9.7 — mobile/desktop auth popup parity.
   From this point, modal internals use the same typography and spacing on desktop and mobile.
   The only mobile-specific difference left is the shell geometry: full-screen container width/padding/radius. */
#modals {
    --auth-title-font-size: 24px;
    --auth-title-line-height: 32px;
    --auth-title-font-weight: 700;
    --auth-title-margin-bottom: 16px;
    --auth-text-font-size: 16px;
    --auth-text-line-height: 24px;
    --auth-text-font-weight: 400;
    --auth-text-margin-bottom: 20px;
    --auth-input-height: 48px;
    --auth-input-padding-y: 12px;
    --auth-input-padding-x: 16px;
    --auth-button-height: 48px;
    --auth-button-font-size: 16px;
    --auth-button-line-height: 24px;
    --auth-button-font-weight: 500;
    --auth-link-font-size: 16px;
    --auth-link-line-height: 24px;
    --auth-link-font-weight: 400;
    --auth-note-font-size: 14px;
    --auth-note-line-height: 20px;
    --auth-password-field-to-link-gap: 8px;
    --auth-password-link-to-submit-gap: 20px;
    --auth-bottom-link-gap: 12px;
}

#modals .modal-login__title {
    margin: 0 0 var(--auth-title-margin-bottom) !important;
    font-size: var(--auth-title-font-size) !important;
    line-height: var(--auth-title-line-height) !important;
    font-weight: var(--auth-title-font-weight) !important;
}

#modals .modal-login__text {
    margin: 0 0 var(--auth-text-margin-bottom) !important;
    font-size: var(--auth-text-font-size) !important;
    line-height: var(--auth-text-line-height) !important;
    font-weight: var(--auth-text-font-weight) !important;
}

#modals .input {
    height: var(--auth-input-height) !important;
    min-height: var(--auth-input-height) !important;
}

#modals .input__field {
    min-height: var(--auth-input-height) !important;
    padding: var(--auth-input-padding-y) var(--auth-input-padding-x) !important;
    font-size: 16px !important;
    line-height: 24px !important;
    font-weight: 400 !important;
}

#modals .input.with-icon .input__field {
    padding-right: 40px !important;
}

#modals .modal-login__btn {
    height: var(--auth-button-height) !important;
    min-height: var(--auth-button-height) !important;
    font-size: var(--auth-button-font-size) !important;
    line-height: var(--auth-button-line-height) !important;
    font-weight: var(--auth-button-font-weight) !important;
}

#modals .modal-login__btn-clear,
#modals .js-m-timer__btn,
#modals .js-m-timer__timer {
    font-size: var(--auth-link-font-size) !important;
    line-height: var(--auth-link-line-height) !important;
    font-weight: var(--auth-link-font-weight) !important;
}

#modals .modal-login__note {
    font-size: var(--auth-note-font-size) !important;
    line-height: var(--auth-note-line-height) !important;
}

#modals #modal-login--password-form .input[data-type="password"] {
    margin-bottom: var(--auth-password-field-to-link-gap) !important;
}

#modals #modal-login--password-form .modal-login__btn-middle {
    margin: 0 !important;
    font-size: var(--auth-link-font-size) !important;
    line-height: var(--auth-link-line-height) !important;
    font-weight: var(--auth-link-font-weight) !important;
}

#modals #modal-login--password-form .modal-login__btn {
    margin-top: var(--auth-password-link-to-submit-gap) !important;
}

#modals #modal-login--password-auth .modal-login__btn-bottom {
    margin-top: var(--auth-bottom-link-gap) !important;
}

#modals .input__message,
#modals .form__message {
    font-size: 16px !important;
    line-height: 24px !important;
    font-weight: 400 !important;
}

#modals .form__rules li {
    font-size: 14px !important;
    line-height: 20px !important;
}

@media(max-width: 475px) {
    #modals .modal_ {
        align-items: stretch;
        justify-content: flex-start;
    }

    #modals .modal-container {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100dvh !important;
        padding: 56px 16px !important;
        border-radius: 0 !important;
    }

    #modals .modal-login__title {
        margin: 0 0 var(--auth-title-margin-bottom) !important;
        font-size: 20px !important;
        line-height: 28px !important;
        font-weight: 500 !important;
    }

    #modals .modal-login__text {
        margin: 0 0 var(--auth-text-margin-bottom) !important;
        font-size: var(--auth-text-font-size) !important;
        line-height: var(--auth-text-line-height) !important;
        font-weight: var(--auth-text-font-weight) !important;
    }

    #modals .input,
    #modals .input__field,
    #modals .modal-login__btn {
        height: var(--auth-input-height) !important;
        min-height: var(--auth-input-height) !important;
    }

    #modals .input__field {
        padding: var(--auth-input-padding-y) var(--auth-input-padding-x) !important;
        font-size: 16px !important;
        line-height: 24px !important;
        font-weight: 400 !important;
    }

    #modals .input.with-icon .input__field {
        padding-right: 40px !important;
    }

    #modals .modal-login__btn {
        font-size: var(--auth-button-font-size) !important;
        line-height: var(--auth-button-line-height) !important;
        font-weight: var(--auth-button-font-weight) !important;
    }

    #modals .modal-login__btn-clear,
    #modals .js-m-timer__btn,
    #modals .js-m-timer__timer {
        font-size: var(--auth-link-font-size) !important;
        line-height: var(--auth-link-line-height) !important;
        font-weight: var(--auth-link-font-weight) !important;
    }

    #modals .input__message,
    #modals .form__message {
        font-size: 16px !important;
        line-height: 24px !important;
        font-weight: 400 !important;
        text-align: left;
    }

    #modals #modal-login--password-form .input[data-type="password"] {
        margin-bottom: var(--auth-password-field-to-link-gap) !important;
    }

    #modals #modal-login--password-form .modal-login__btn-middle {
        margin: 0 !important;
        font-size: var(--auth-link-font-size) !important;
        line-height: var(--auth-link-line-height) !important;
        font-weight: var(--auth-link-font-weight) !important;
    }

    #modals #modal-login--password-form .modal-login__btn {
        margin-top: var(--auth-password-link-to-submit-gap) !important;
    }

    #modals #modal-login--password-auth .modal-login__btn-bottom {
        margin-top: var(--auth-bottom-link-gap) !important;
    }

    .auth-block .auth-block__content-title,
    .auth-block__content-title {
        font-size: 32px !important;
        line-height: 40px !important;
        font-weight: 500 !important;
    }

    .auth-block .auth-block__content-text,
    .auth-block__content-text {
        font-size: 16px !important;
        line-height: 24px !important;
        font-weight: 500 !important;
    }
}

/* v1.9.8 — success timer/link slot + password requirements layout/icon fix.
   Visual-only. Keeps existing auth logic, timers and JS state classes intact. */
#modals #modal-pass-link--success .modal-login__btn-bottom.js-m-timer_v2 {
    margin-top: 20px !important;
    margin-bottom: 28px !important;
    min-height: 24px !important;
}

#modals #modal-pass-link--success .modal-login__btn-bottom.js-m-timer_v2 .js-m-timer__timer,
#modals #modal-pass-link--success .modal-login__btn-bottom.js-m-timer_v2 .js-m-timer__btn,
#modals #modal-pass-link--success .modal-login__btn-bottom.js-m-timer_v2 .loader-resend {
    min-height: 24px !important;
    align-items: center !important;
    justify-content: center !important;
}

#modals #modal-pass-link--success .modal-login__btn.js-m-modal__close {
    margin-top: 0 !important;
}

/* The password requirements card in Figma is visually attached to the first
   password input. Do not let the generic input margin push it down. */
#modals #modal-login--password-new-form > .input:has(input[name="password"]) {
    margin-bottom: 0 !important;
}

#modals #modal-login--password-new-form > .form__rules {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding: 12px !important;
    gap: 4px !important;
    background: var(--auth-bg-grey) !important;
    border-radius: 12px !important;
}

#modals #modal-login--password-new-form > .form__rules li {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 20px !important;
}

#modals #modal-login--password-new-form > .form__rules li .icon {
    display: inline-flex !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 16px 16px !important;
}

/* Correct path from /assets/auth/css/auth.css to /assets/dist/images/icons/*.svg */
#modals #modal-login--password-new-form > .form__rules li.invalid .icon {
    background-image: url('../../dist/images/icons/cross.svg') !important;
}

#modals #modal-login--password-new-form > .form__rules li.valid .icon {
    background-image: url('../../dist/images/icons/tick.svg') !important;
}

@media(max-width: 475px) {
    #modals #modal-pass-link--success .modal-login__btn-bottom.js-m-timer_v2 {
        margin-top: 20px !important;
        margin-bottom: 28px !important;
    }

    #modals #modal-login--password-new-form > .input:has(input[name="password"]) {
        margin-bottom: 0 !important;
    }

    #modals #modal-login--password-new-form > .form__rules {
        margin-top: 0 !important;
        margin-bottom: 20px !important;
    }
}

/* v1.9.9 — Figma-aligned password requirements card and password-link success spacing.
   Visual-only. Backend auth logic, timers and JS state classes stay intact. */

/* Password reset success: Figma layout uses 20px icon->text, 16px title->body,
   12px body->timer/link, 28px timer/link->button, 12px button->bottom link. */
#modals #modal-pass-link--success .modal-login__icon {
    margin-bottom: 20px !important;
}

#modals #modal-pass-link--success .modal-login__title {
    margin-bottom: 16px !important;
    font-weight: 700 !important;
}

#modals #modal-pass-link--success .modal-login__text {
    margin-bottom: 12px !important;
    text-align: center !important;
}

#modals #modal-pass-link--success .modal-login__btn-bottom.js-m-timer_v2 {
    margin-top: 0 !important;
    margin-bottom: 28px !important;
    min-height: 24px !important;
}

#modals #modal-pass-link--success .modal-login__btn.js-m-modal__close {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

#modals #modal-pass-link--success .modal-login__btn-clear.modal-login__btn-bottom.js-m-modal__open {
    margin-top: 12px !important;
}

/* New password: first input + requirements must behave as one attached grey card.
   The grey block starts underneath the input border, while text keeps the Figma 12px inset. */
#modals #modal-login--password-new-form > .input:first-of-type {
    position: relative !important;
    z-index: 2 !important;
    margin-bottom: 0 !important;
}

#modals #modal-login--password-new-form > .form__rules {
    margin-top: -2px !important;
    margin-bottom: 20px !important;
    padding: 14px 12px 12px !important;
    gap: 4px !important;
    background: var(--auth-bg-grey) !important;
    border-radius: 0 0 12px 12px !important;
}

#modals #modal-login--password-new-form > .form__rules li {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 20px !important;
    font-size: 14px !important;
    line-height: 20px !important;
}

/* Icons have a 16x16 safe zone. The glyph itself is smaller, exactly like Figma. */
#modals #modal-login--password-new-form > .form__rules li .icon {
    display: inline-flex !important;
    flex: 0 0 16px !important;
    width: 16px !important;
    height: 16px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

#modals #modal-login--password-new-form > .form__rules li.invalid .icon {
    background-image: url('../../dist/images/icons/cross.svg') !important;
    background-size: 12px 12px !important;
}

#modals #modal-login--password-new-form > .form__rules li.valid .icon {
    background-image: url('../../dist/images/icons/tick.svg') !important;
    background-size: 14px 10px !important;
}

#modals #modal-login--password-new-form > .form__rules + .input {
    margin-top: 0 !important;
}

@media(max-width: 475px) {
    #modals #modal-pass-link--success .modal-login__icon {
        margin-bottom: 20px !important;
    }

    #modals #modal-pass-link--success .modal-login__title {
        margin-bottom: 16px !important;
        font-size: 24px !important;
        line-height: 32px !important;
        font-weight: 500 !important;
    }

    #modals #modal-pass-link--success .modal-login__text {
        margin-bottom: 12px !important;
    }

    #modals #modal-pass-link--success .modal-login__btn-bottom.js-m-timer_v2 {
        margin-top: 0 !important;
        margin-bottom: 28px !important;
    }

    #modals #modal-pass-link--success .modal-login__btn-clear.modal-login__btn-bottom.js-m-modal__open {
        margin-top: 12px !important;
    }

    #modals #modal-login--password-new-form > .input:first-of-type {
        margin-bottom: 0 !important;
    }

    #modals #modal-login--password-new-form > .form__rules {
        margin-top: -2px !important;
        margin-bottom: 20px !important;
        padding: 14px 12px 12px !important;
        border-radius: 0 0 12px 12px !important;
    }
}

/* v1.9.10 — unified bottom auth-by-code link spacing.
   Visual-only: every bottom link that opens the code authorization modal
   uses the same gap from the previous action across all popups. */
#modals .modal-login__btn-clear.modal-login__btn-bottom.js-m-modal__open[data-target="modal-login--code-auth"] {
    margin-top: 12px !important;
    margin-bottom: 0 !important;
}

@media(max-width: 475px) {
    #modals .modal-login__btn-clear.modal-login__btn-bottom.js-m-modal__open[data-target="modal-login--code-auth"] {
        margin-top: 12px !important;
        margin-bottom: 0 !important;
    }
}

/* v1.9.11 — new-password requirements grey block seam.
   Match the original attached input+rules card: the grey requirements area sits
   under the first password input without leaking around the input rounded corners.
   Visual-only. */
#modals #modal-login--password-new-form > .input:first-of-type,
#modals #modal-login--password-new-form > .input:has(input[name="password"]) {
    position: relative !important;
    z-index: 2 !important;
    margin-bottom: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#modals #modal-login--password-new-form > .input:first-of-type .input__field,
#modals #modal-login--password-new-form > .input:has(input[name="password"]) .input__field {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#modals #modal-login--password-new-form > .form__rules {
    margin-top: -2px !important;
    margin-bottom: 20px !important;
    padding: 14px 12px 12px !important;
    background: var(--auth-bg-grey) !important;
    border-radius: 0 0 12px 12px !important;
}

@media(max-width: 475px) {
    #modals #modal-login--password-new-form > .input:first-of-type,
    #modals #modal-login--password-new-form > .input:has(input[name="password"]) {
        margin-bottom: 0 !important;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    #modals #modal-login--password-new-form > .input:first-of-type .input__field,
    #modals #modal-login--password-new-form > .input:has(input[name="password"]) .input__field {
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    #modals #modal-login--password-new-form > .form__rules {
        margin-top: -2px !important;
        margin-bottom: 20px !important;
        padding: 14px 12px 12px !important;
        border-radius: 0 0 12px 12px !important;
    }
}

/* v1.9.12 — precise new-password grey rules seam.
   The requirements block still tucks under the first input, but its own top
   corners are rounded and the input keeps its original rounded bottom corners.
   This prevents the grey background from sticking out around the input radius.
   Visual-only. */
#modals #modal-login--password-new-form > .input:first-of-type,
#modals #modal-login--password-new-form > .input:has(input[name="password"]) {
    position: relative !important;
    z-index: 2 !important;
    margin-bottom: 0 !important;
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
    background: var(--auth-white) !important;
    overflow: visible !important;
}

#modals #modal-login--password-new-form > .input:first-of-type .input__field,
#modals #modal-login--password-new-form > .input:has(input[name="password"]) .input__field {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

#modals #modal-login--password-new-form > .form__rules {
    position: relative !important;
    z-index: 1 !important;
    margin-top: -2px !important;
    margin-bottom: 20px !important;
    padding: 14px 12px 12px !important;
    background: var(--auth-bg-grey) !important;
    border-radius: 8px 8px 12px 12px !important;
    overflow: hidden !important;
}

@media(max-width: 475px) {
    #modals #modal-login--password-new-form > .input:first-of-type,
    #modals #modal-login--password-new-form > .input:has(input[name="password"]) {
        border-bottom-left-radius: 8px !important;
        border-bottom-right-radius: 8px !important;
        background: var(--auth-white) !important;
    }

    #modals #modal-login--password-new-form > .input:first-of-type .input__field,
    #modals #modal-login--password-new-form > .input:has(input[name="password"]) .input__field {
        border-bottom-left-radius: 8px !important;
        border-bottom-right-radius: 8px !important;
    }

    #modals #modal-login--password-new-form > .form__rules {
        margin-top: -2px !important;
        margin-bottom: 20px !important;
        padding: 14px 12px 12px !important;
        border-radius: 8px 8px 12px 12px !important;
    }
}

/* v1.9.13 — requested 4px gap between new-password input and grey requirements block.
   Visual-only: affects only the first password field + requirements area seam. */
#modals #modal-login--password-new-form > .input:first-of-type,
#modals #modal-login--password-new-form > .input:has(input[name="password"]) {
    margin-bottom: 0 !important;
}

#modals #modal-login--password-new-form > .form__rules {
    margin-top: 4px !important;
    padding: 12px !important;
    border-radius: 8px !important;
}

@media(max-width: 475px) {
    #modals #modal-login--password-new-form > .form__rules {
        margin-top: 4px !important;
        padding: 12px !important;
        border-radius: 8px !important;
    }
}

/* v1.9.14 — new-password rules radius must match input radius.
   Keeps the v1.9.13 4px gap, only normalizes the grey requirements card radius. */
#modals #modal-login--password-new-form > .form__rules {
    border-radius: 8px !important;
}

@media(max-width: 475px) {
    #modals #modal-login--password-new-form > .form__rules {
        border-radius: 8px !important;
    }
}

/* v1.9.15 — Authorization (not Authorization 2.0) state and responsive parity. */
#modals #modal-login--password-recover .modal-container {
    min-height: 348px;
}

#modals #modal-login--password-recover-form > .input:not(.with-error):not(.with-message) {
    margin-bottom: 20px !important;
}

#modals #modal-login--password-recover-form > .input.with-message {
    margin-bottom: 48px !important;
}

#modals #modal-login--password-recover-form.with-error > .input,
#modals #modal-login--password-recover-form.with-message > .input {
    margin-bottom: 0 !important;
}

#modals #modal-login--password-recover .modal-container:has(form.with-error),
#modals #modal-login--password-recover .modal-container:has(form.with-message),
#modals #modal-login--password-recover .modal-container:has(.input.with-error),
#modals #modal-login--password-recover .modal-container:has(.input.with-message) {
    min-height: 376px;
}

#modals #modal-login--password-new .modal-container {
    min-height: 504px;
}

#modals #modal-login--password-new .modal-container:has(form.with-error),
#modals #modal-login--password-new .modal-container:has(form.with-message),
#modals #modal-login--password-new .modal-container:has(.input.with-error),
#modals #modal-login--password-new .modal-container:has(.input.with-message) {
    min-height: 532px;
}

#modals #modal-login--password-form .form__message {
    font-size: 14px !important;
    line-height: 20px !important;
}

#modals #modal-login--code-enter-form.auth-code-expired .form__message {
    font-size: 14px !important;
    line-height: 20px !important;
}

#modals #modal-login--success .modal-login__text {
    margin-bottom: 28px !important;
}

#modals #modal-login--password-new-form > .input:has(input[name="password"]) {
    margin-bottom: 0 !important;
}

#modals #modal-login--password-new-form > .form__rules {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding: 12px !important;
    border-radius: 12px !important;
}

#modals #modal-login--password-new-form > .input:has(input[name="confirm_password"]) {
    margin-bottom: 20px !important;
}

#modals #modal-login--password-new-form.password-error-primary > .form__rules {
    margin-bottom: 0 !important;
}

#modals #modal-login--password-new-form.password-error-primary > .form__message {
    margin: 8px 0 16px !important;
}

#modals #modal-login--password-new-form.password-error-confirm > .input:has(input[name="confirm_password"]) {
    margin-bottom: 0 !important;
}

@media(max-width: 475px) {
    #modals #modal-login--success .modal-login__title,
    #modals #modal-pass-link--success .modal-login__title {
        font-size: 24px !important;
        line-height: 32px !important;
        font-weight: 500 !important;
    }

    #modals #modal-login--password-form .form__message {
        font-size: 16px !important;
        line-height: 24px !important;
    }

    #modals #modal-login--code-enter-form.auth-code-expired .form__message {
        font-size: 16px !important;
        line-height: 24px !important;
    }

    #modals #modal-login--password-new-form > .input:has(input[name="password"]) {
        order: 1;
        margin-bottom: 12px !important;
    }

    #modals #modal-login--password-new-form > .input:has(input[name="confirm_password"]) {
        order: 2;
        margin-bottom: 20px !important;
    }

    #modals #modal-login--password-new-form > .form__rules {
        order: 3;
        gap: 8px !important;
        margin: 0 0 20px !important;
        padding: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    #modals #modal-login--password-new-form.has-password-value > .form__rules {
        order: 2;
        gap: 4px !important;
        margin: 0 0 20px !important;
        padding: 12px !important;
        background: var(--auth-bg-grey) !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    #modals #modal-login--password-new-form.has-password-value > .input:has(input[name="confirm_password"]) {
        order: 3;
    }

    #modals #modal-login--password-new-form.password-error-primary > .form__message {
        order: 3;
    }

    #modals #modal-login--password-new-form.password-error-primary > .input:has(input[name="confirm_password"]) {
        order: 4;
    }

    #modals #modal-login--password-new-form > .form__message {
        order: 4;
    }

    #modals #modal-login--password-new-form > .modal-login__btn {
        order: 5;
    }
}

/* v1.9.17 — tuck the password requirements panel under the input. */
#modals #modal-login--password-new-form > .input:has(input[name="password"]) {
    margin-bottom: 0 !important;
}

#modals #modal-login--password-new-form > .form__rules,
#modals #modal-login--password-new-form.has-password-value > .form__rules {
    margin-top: -8px !important;
    padding: 20px 12px 12px !important;
    background: var(--auth-bg-grey) !important;
    border-radius: 0 0 12px 12px !important;
    overflow: hidden !important;
}

@media(max-width: 475px) {
    #modals #modal-login--password-new-form > .form__rules,
    #modals #modal-login--password-new-form.has-password-value > .form__rules {
        order: 2;
        margin: -8px 0 20px !important;
    }

    #modals #modal-login--password-new-form > .input:has(input[name="confirm_password"]) {
        order: 3;
    }

    #modals #modal-login--password-new-form.password-error-primary > .form__rules {
        margin-bottom: 0 !important;
    }
}
