/*
 * Окно входа и регистрации (layouts/popup_auth.php, views/popup/auth/*).
 * Размеры по макету Figma «Авторизация/регистрация на сайте»: на ПК попап 600 px,
 * на телефоне и узком экране (≤ 768 px) — шторка снизу. Подключён к каждой странице
 * через AppAsset/AppMobileAsset.
 */

.b_auth {
    position: relative;
    width: 600px;
    max-width: calc(100vw - 32px);
    margin: 40px auto;
    padding: 64px 100px 56px;
    background: #fff;
    border-radius: 20px;
    color: #000;
    font-family: Arsenal2, Arsenal, sans-serif;
    font-size: 16px;
    line-height: 1.2;
    text-align: center;
}
.b_auth *,
.b_auth *::before,
.b_auth *::after {
    box-sizing: border-box;
}
.b_auth [hidden] {
    display: none !important;
}
.b_auth a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.b_auth a:hover {
    color: #000;
    opacity: .7;
}

.b_auth_grip {
    display: none;
}

.b_auth_screen {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* шапка: на ПК заголовок по центру, стрелка и крестик в углах окна */
.b_auth_head {
    display: flex;
    justify-content: center;
}
.b_auth_title {
    font-size: 48px;
    line-height: 1;
    font-weight: 400;
}
.b_auth_icon {
    position: absolute;
    top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    color: #000;
    cursor: pointer;
}
.b_auth a.b_auth_icon {
    text-decoration: none;
}
.b_auth_icon svg {
    width: 24px;
    height: 24px;
}
.b_auth_icon.m_close {
    right: 28px;
}
.b_auth_icon.m_back {
    left: 28px;
}

.b_auth_sub {
    margin-top: -20px;
    font-size: 15px;
    line-height: 22px;
    color: #6B6B6B;
}
.b_auth_sub.m_code {
    font-size: 16px;
    line-height: 24px;
}
.b_auth_sub.m_code a {
    color: #000;
}

/* вкладки «Войти с паролем / Войти по СМС» */
.b_auth_tabs {
    display: flex;
    padding: 4px;
    background: #EDEDED;
    border-radius: 24px;
}
.b_auth_tabs .el_tab {
    flex: 1 1 0;
    height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 20px;
    background: none;
    color: #6B6B6B;
    font: 700 15px/1 Arsenal2, Arsenal, sans-serif;
    cursor: pointer;
    transition: background-color .2s, color .2s, box-shadow .2s;
}
.b_auth_tabs .el_tab.st_active {
    background: #fff;
    color: #000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    cursor: default;
}

.b_auth_form {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: 0;
}
.b_auth_fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}
.b_auth_field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.b_auth_field.m_code {
    gap: 16px;
    text-align: center;
}

.b_auth .el_input {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #D5D5D5;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: 400 16px/1 Arsenal2, Arsenal, sans-serif;
    letter-spacing: .2px;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}
.b_auth .el_input::placeholder {
    color: #6B6B6B;
    opacity: 1;
}
.b_auth .el_input:focus {
    border-color: #000;
}
.b_auth .st_error .el_input,
.b_auth .st_error .el_cell {
    border-color: #F45B50;
}

.b_auth .el_password {
    position: relative;
}
.b_auth .el_password .el_input {
    padding-right: 52px;
}
.b_auth .el_eye {
    position: absolute;
    top: 50%;
    right: 14px;
    display: flex;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    padding: 2px;
    border: 0;
    background: none;
    color: #9A9A9A;
    cursor: pointer;
}
.b_auth .el_eye svg {
    width: 20px;
    height: 20px;
}
.b_auth .el_eye .el_eye_on,
.b_auth .el_eye.st_shown .el_eye_off {
    display: none;
}
.b_auth .el_eye.st_shown .el_eye_on {
    display: block;
}

.b_auth .el_hint {
    font-size: 13px;
    line-height: 1.2;
    color: #6B6B6B;
}
.b_auth .el_error {
    font-size: 13px;
    line-height: 1.3;
    color: #E0362C;
}
.b_auth .el_error:empty {
    display: none;
}

.b_auth_link {
    align-self: flex-start;
    font-size: 14px;
    line-height: 1.2;
    color: #000;
}
.b_auth_link.m_center {
    align-self: center;
}

/* регистрация: блоки окна плотнее (28 px), плашка «Что даёт личный кабинет», имя и фамилия в строку */
.b_auth_screen.m_signup {
    gap: 28px;
}
.b_auth_screen.m_signup > .b_auth_sub {
    margin-top: -16px;
}
.b_auth_perks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    background: #FFF0E5;
    font-size: 14px;
    line-height: 20px;
    text-align: left;
}
.b_auth_perks .el_title {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
}
.b_auth_perks .el_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
/* .b_auth впереди — перебить списки страниц аутлета и рефералки (.b_onlinecart_page li) */
.b_auth .b_auth_perks .el_list li {
    position: relative;
    margin: 0;
    padding-left: 16px;
    line-height: 20px;
}
.b_auth .b_auth_perks .el_list li::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 0;
    width: 6px;
    height: 6px;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: #F45B50;
    transform: none;
}
/* там же у пунктов нумерация счётчиком */
.b_auth .b_auth_perks .el_list li::after {
    content: none;
}
.b_auth_row {
    display: flex;
    gap: 12px;
}
.b_auth_row > .b_auth_field {
    flex: 1 1 0;
    min-width: 0;
}

/* «Войти по СМС с этим номером» и т. п. под ошибкой поля */
.b_auth .b_auth_offer {
    align-self: flex-start;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    color: #000;
}

/* «Проверьте почту» */
.b_auth .el_strong {
    color: #000;
}
.b_auth a.b_auth_btn,
.b_auth a.b_auth_btn:hover {
    color: #fff;
    text-decoration: none;
    opacity: 1;
}
.b_auth_again {
    font-size: 14px;
    line-height: 1.3;
    color: #6B6B6B;
}
.b_auth_again a {
    color: #000;
}
.b_auth_again .el_done {
    display: none;
    margin-top: 6px;
    color: #000;
}
.b_auth_again.st_sent .el_done {
    display: block;
}
.b_auth_again .el_error {
    margin-top: 6px;
}

/* ячейки кода из СМС */
.b_auth_cells {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.b_auth .el_cell {
    width: 64px;
    height: 64px;
    margin: 0;
    padding: 0;
    border: 1px solid #D5D5D5;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: 400 28px/1 Arsenal2, Arsenal, sans-serif;
    text-align: center;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.b_auth .el_cell:focus {
    border-color: #000;
}
.b_auth .el_timer {
    font-size: 14px;
    line-height: 1.2;
    color: #6B6B6B;
}
.b_auth .el_timer:empty {
    display: none;
}

.b_auth_cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
/* .b_auth впереди: сброс стилей на странице заказа ([type=submit] { background: transparent }) */
.b_auth .b_auth_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 240px;
    height: 52px;
    padding: 0 24px;
    border: 0;
    border-radius: 26px;
    background: #F45B50;
    color: #fff;
    font: 700 14px/1 Arsenal2, Arsenal, sans-serif;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .2s, opacity .2s;
}
.b_auth .b_auth_btn:hover {
    background: #E44A3F;
}
.b_auth .b_auth_btn:disabled {
    opacity: .6;
    cursor: default;
}
.b_auth_note {
    font-size: 12px;
    line-height: 17px;
    color: #6B6B6B;
}

/* подпись ссылки (title «Личный кабинет» в нижней панели) topbox выводит под окном — у входа она лишняя */
.topbox_overlay:has(.b_auth) .topbox_title_wrap {
    display: none;
}

/* шторка снизу: телефон и узкий экран; планшет шире 768 px видит попап, как ПК */
@media (max-width: 768px) {
    /* в мобильной вёрстке у topbox блочная обёртка и отступ 35 px у содержимого — сбрасываем */
    .topbox_overlay:has(.b_auth) .topbox_wrapper {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        overflow: hidden;
    }
    .topbox_content:has(> .b_auth) {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        align-items: flex-end;
        transform: none !important;
    }
    .b_auth {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        max-height: 92dvh;
        margin: 0;
        padding: 12px 24px calc(32px + env(safe-area-inset-bottom));
        border-radius: 24px 24px 0 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        text-align: left;
        transition: transform .25s ease;
    }
    .b_auth.st_dragging {
        transition: none;
    }
    .b_auth_grip {
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 20px;
        border-radius: 2px;
        background: #D9D9D9;
    }
    .b_auth_screen {
        gap: 20px;
    }
    .b_auth_head {
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
    }
    .b_auth_title {
        flex: 1 1 auto;
        font-size: 18px;
        font-weight: 700;
    }
    .b_auth_icon {
        position: static;
        flex: 0 0 auto;
    }
    .b_auth_sub {
        margin-top: -12px;
        font-size: 14px;
        line-height: 20px;
    }
    .b_auth_sub.m_code {
        font-size: 14px;
        line-height: 20px;
    }
    .b_auth_form {
        gap: 20px;
    }
    .b_auth_screen.m_signup {
        gap: 20px;
    }
    .b_auth_screen.m_signup > .b_auth_sub {
        margin-top: -12px;
    }
    .b_auth_row {
        flex-direction: column;
    }
    .b_auth .el_input {
        height: 50px;
        border-radius: 8px;
    }
    .b_auth .el_cell {
        border-radius: 8px;
    }
    .b_auth_cta {
        align-items: stretch;
        text-align: center;
    }
    .b_auth .b_auth_btn {
        width: 100%;
        height: 54px;
        border-radius: 30px;
    }
}

/* встроенный в страницу блок (AuthWidget): аутлет, рефералка, /signup, меню мобильной шапки —
   без фона окна, крестика и стрелки «назад» */
.b_auth.m_inline {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 0;
    background: none;
    border-radius: 0;
}
.b_auth.m_inline .b_auth_icon {
    display: none;
}
.b_auth.m_inline .b_auth_title {
    font-size: 36px;
}
@media (max-width: 768px) {
    .b_auth.m_inline {
        max-width: none;
        max-height: none;
        padding: 0;
        border-radius: 0;
        overflow: visible;
        transition: none;
    }
    .b_auth.m_inline .b_auth_title {
        font-size: 22px;
    }
}

/* страница /signup: регистрация и вход рядом */
.b_auth_page {
    padding-top: 48px;
    padding-bottom: 80px;
}
.b_auth_page .row {
    row-gap: 56px;
}

/* вкладка «Вход» в меню мобильной шапки */
.b_auth_panel {
    padding: 24px 16px 32px;
}
