:root {
    --auth-accent: #b43084;
    --auth-accent-hover: #9d2873;
    --auth-text: #1d1d1f;
    --auth-muted: #6e6e73;
    --auth-border: #dedee3;
    --auth-soft: #f5f5f7;
    --auth-surface: #ffffff;
}

body.auth-modal-open {
    overflow: hidden !important;
}

#overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    background: rgba(20, 20, 22, .46) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.auth-panel {
    position: fixed !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: 50% !important;
    z-index: 10001 !important;
    display: block !important;
    width: min(calc(100vw - 32px), 420px) !important;
    max-width: 420px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 32px) !important;
    padding: 24px !important;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, .08) !important;
    border-radius: 18px !important;
    background: var(--auth-surface) !important;
    box-shadow: 0 18px 54px rgba(0, 0, 0, .18) !important;
    color: var(--auth-text);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 8px)) scale(.99) !important;
    transform-origin: center;
    transition: opacity .18s ease, transform .2s ease, visibility .18s ease;
    overscroll-behavior: contain;
}

.auth-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1) !important;
}

.auth-panel:focus {
    outline: none;
}

.auth-panel .close-btn {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    display: inline-flex !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #77787d !important;
    font-size: 24px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.auth-panel .close-btn:hover,
.auth-panel .close-btn:focus-visible {
    background: var(--auth-soft) !important;
    color: var(--auth-text) !important;
    outline: none;
}

.auth-kicker,
.auth-subtitle {
    display: none !important;
}

.auth-title {
    margin: 0 40px 20px 0 !important;
    color: var(--auth-text) !important;
    font-family: 'Onest', sans-serif;
    font-size: 0 !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: -.02em;
}

.auth-title::before {
    content: 'Вход';
    font-size: 24px;
}

.auth-view {
    animation: auth-view-in .2s ease both;
}

.auth-social-methods,
.auth-methods.auth-provider-methods {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.auth-method {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 54px;
    padding: 10px 12px;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: var(--auth-surface);
    color: var(--auth-text);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}

.auth-method:hover,
.auth-method:focus-visible {
    color: inherit;
    outline: none;
}

.auth-method:focus-visible,
.auth-phone-submit:focus-visible,
.auth-inline-back:focus-visible,
.auth-back-btn:focus-visible {
    outline: 2px solid rgba(180, 48, 132, .32);
    outline-offset: 2px;
}

.auth-method:disabled,
.auth-method[aria-disabled='true'] {
    cursor: default;
    opacity: .62;
}

.auth-method.loading {
    pointer-events: none;
    cursor: wait;
}

.auth-method__content {
    min-width: 0;
    flex: 1 1 auto;
}

.auth-method__title,
.auth-method__description {
    display: block;
}

.auth-method__title {
    font-size: 15px;
    font-weight: 650;
    line-height: 1.2;
}

.auth-method__description {
    margin-top: 3px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.35;
}

.auth-method__arrow {
    display: none !important;
}

.auth-method--vk,
.auth-method--max {
    min-height: 64px;
    border-color: transparent;
    color: #fff;
}

.auth-method--vk .auth-method__description,
.auth-method--max .auth-method__description {
    color: rgba(255, 255, 255, .78);
}

.auth-method--vk {
    background: #0077ff;
}

.auth-method--vk:hover,
.auth-method--vk:focus-visible {
    border-color: transparent;
    background: #006fe8;
    color: #fff;
}

.auth-method--max {
    background: #6552e8;
}

.auth-method--max:hover,
.auth-method--max:focus-visible {
    border-color: transparent;
    background: #5946d8;
    color: #fff;
}

.auth-method--vk::after {
    display: none !important;
    content: none !important;
}

.auth-method__vk-mark,
.auth-method__max-mark,
.auth-provider-choice__mark {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: -.02em;
}

.auth-method__vk-mark,
.auth-method__max-mark {
    background: rgba(255, 255, 255, .17);
}

.auth-method__max-mark {
    font-size: 9px;
}

.auth-method--vk.loading .auth-method__vk-mark,
.auth-method--max.loading .auth-method__max-mark {
    font-size: 0;
}

.auth-method--vk.loading .auth-method__vk-mark::after,
.auth-method--max.loading .auth-method__max-mark::after {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    content: '';
    animation: auth-method-spin .7s linear infinite;
}

.auth-separator {
    display: flex;
    margin: 18px 0 10px;
    align-items: center;
    gap: 10px;
    color: #96979c;
    font-size: 12px;
    line-height: 1.2;
}

.auth-separator::before,
.auth-separator::after {
    height: 1px;
    flex: 1 1 auto;
    background: #ececef;
    content: '';
}

.auth-methods.auth-provider-methods {
    margin: 0;
}

.auth-provider-choice {
    min-height: 64px;
    padding: 10px 12px;
    background: #fff;
}

.auth-provider-choice:hover,
.auth-provider-choice:focus-visible {
    border-color: #bfc1c7;
    background: #fafafa;
}

.auth-provider-choice .auth-method__description {
    font-size: 0;
}

.auth-method--telegram .auth-method__description::before,
.auth-method--call .auth-method__description::before {
    font-size: 14px;
    line-height: 1.35;
}

.auth-method--telegram .auth-method__description::before {
    content: 'Пришлём 4-значный код';
}

.auth-method--call .auth-method__description::before {
    content: '4 последние цифры входящего номера';
}

.auth-provider-choice__mark--telegram {
    background: #229ed9;
}

.auth-provider-choice__mark--call {
    background: #85b52a;
    font-size: 15px;
}

.auth-phone-flow {
    display: none;
}

.auth-step1.phone-provider-active .auth-social-methods,
.auth-step1.phone-provider-active .auth-separator,
.auth-step1.phone-provider-active .auth-provider-methods {
    display: none;
}

.auth-step1.phone-provider-active .auth-phone-flow {
    display: block;
    animation: auth-view-in .2s ease both;
}

.auth-inline-back,
.auth-back-btn {
    display: inline-flex;
    padding: 0;
    align-items: center;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s ease;
}

.auth-inline-back:hover,
.auth-back-btn:hover {
    color: var(--auth-text);
}

.auth-phone-heading {
    display: block;
    margin: 18px 0 16px;
}

.auth-phone-heading__mark {
    display: none;
}

.auth-phone-heading__content,
.auth-phone-heading__title,
.auth-phone-heading__description {
    display: block;
}

.auth-phone-heading__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.auth-phone-heading__description {
    margin-top: 4px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.45;
}

.auth-field-label {
    display: block;
    margin-bottom: 7px;
    color: #4f5055;
    font-size: 13px;
    font-weight: 650;
}

.auth-phone-input,
.modern-input-container {
    position: relative;
}

.auth-panel #phone,
.auth-panel #authcode {
    display: block !important;
    width: 100% !important;
    height: 50px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    border: 1px solid #cfd0d5 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--auth-text) !important;
    font: inherit !important;
    font-size: 17px !important;
    font-weight: 550 !important;
    line-height: 50px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .15s ease;
}

.auth-panel #phone::placeholder,
.auth-panel #authcode::placeholder {
    color: #a4a5aa;
    opacity: 1;
}

.auth-panel #phone:focus,
.auth-panel #authcode:focus {
    border-color: var(--auth-accent) !important;
    box-shadow: 0 0 0 3px rgba(180, 48, 132, .1) !important;
}

.auth-panel #authcode {
    height: 58px !important;
    padding: 0 18px !important;
    font-size: 27px !important;
    letter-spacing: .32em;
    text-align: center;
}

.auth-phone-submit,
.auth-step2 .checkcode {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    margin-top: 10px;
    padding: 11px 16px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--auth-accent);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    box-shadow: none;
    transition: background .15s ease, opacity .15s ease;
}

.auth-phone-submit:hover,
.auth-step2 .checkcode:hover {
    background: var(--auth-accent-hover);
}

.auth-phone-submit.loading,
.auth-phone-submit:disabled,
.auth-step2 .checkcode.loading,
.auth-step2 .checkcode:disabled {
    opacity: .62;
    cursor: wait;
}

.auth-phone-submit.loading::after,
.auth-step2 .checkcode.loading::after {
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    content: '';
    animation: auth-method-spin .7s linear infinite;
}

.auth-phone-note {
    margin-top: 10px;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.auth-docs {
    margin: 18px auto 0 !important;
    max-width: 350px;
    color: var(--auth-muted) !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    text-align: center !important;
}

.auth-step2 {
    display: none;
}

.auth-step2.is-active {
    animation: auth-view-in .2s ease both;
}

.auth-step2 .auth-info {
    margin: 18px 0 14px;
    color: var(--auth-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
}

#auth-call-example {
    display: none;
    margin-top: 6px;
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 400;
}

#auth-call-example .last4 {
    color: var(--auth-accent);
    font-weight: 700;
}

#resendCode {
    color: var(--auth-accent);
    font-weight: 650;
    text-decoration: none;
}

#resendCode:hover {
    color: var(--auth-accent-hover);
}

#resendTimer {
    color: var(--auth-muted) !important;
}

.auth-result:empty {
    display: none;
}

/* Notifications must stay above the modal overlay and must not be blurred. */
.notifications-container,
body.auth-modal-open .notifications-container {
    position: fixed !important;
    z-index: 12000 !important;
    -webkit-filter: none !important;
    filter: none !important;
}

.notifications-container > * {
    -webkit-filter: none !important;
    filter: none !important;
}

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

@keyframes auth-view-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 440px) {
    .auth-panel {
        width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - 20px) !important;
        padding: 20px !important;
        border-radius: 16px !important;
    }

    .auth-panel .close-btn {
        top: 12px !important;
        right: 12px !important;
    }

    .auth-title {
        margin-bottom: 18px !important;
    }

    .auth-title::before {
        font-size: 22px;
    }

    .auth-method {
        min-height: 50px;
        padding: 9px 10px;
    }

    .auth-method__title {
        font-size: 15px;
    }

    .auth-method__description {
        font-size: 13px;
    }

    .auth-method--telegram .auth-method__description::before,
    .auth-method--call .auth-method__description::before {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #overlay,
    .auth-panel,
    .auth-method,
    .auth-phone-submit,
    .auth-inline-back,
    .auth-back-btn {
        transition-duration: .01ms !important;
    }

    .auth-view,
    .auth-step1.phone-provider-active .auth-phone-flow,
    .auth-step2.is-active {
        animation: none !important;
    }
}
