/* Модалка выбора банка СБП (дизайн MARKETING-67).
   Всё заскоплено под #sbp_banks_modal / #sbp_banks_modal_overlay, чтобы не задеть
   страницу выбора банка (sbp_bank_selection.tpl) с похожими классами. */

#sbp_banks_modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 26, 46, .55);
    z-index: 1000;
    animation: bmFade .25s ease;
}

/* Обёртка-центрирование (показывается через display:flex из sbp.js) */
#sbp_banks_modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
}

#sbp_banks_modal .sbp-modal-box {
    width: 472px;
    max-width: 100%;
    height: 80vh;
    max-height: 92vh;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 32px 80px -12px rgba(16, 24, 52, .45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    animation: bmPop .32s cubic-bezier(.16, 1, .3, 1);
}

#sbp_banks_modal .m-head {
    padding: 18px 24px 12px;
    position: relative;
    flex-shrink: 0;
}

#sbp_banks_modal .close_choose_bank_button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #f1f3f8;
    color: #5b6478;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    box-shadow: none;
    padding: 0;
}

#sbp_banks_modal .close_choose_bank_button:hover {
    background: #e5e8f0;
}

#sbp_banks_modal .m-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #eaf3fe;
    color: #1476E6;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}

#sbp_banks_modal .m-badge span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1476E6;
    animation: bmPulse 1.4s ease-in-out infinite;
}

#sbp_banks_modal .m-title {
    font-size: 21px;
    font-weight: 800;
    color: #141a2e;
    letter-spacing: -.4px;
    line-height: 1.25;
}

#sbp_banks_modal .m-desc {
    font-size: 13.5px;
    color: #6b7488;
    margin-top: 6px;
    line-height: 1.4;
}

#sbp_banks_modal .m-search {
    position: relative;
    margin-top: 14px;
}

#sbp_banks_modal .m-search svg.ic {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

#sbp_banks_modal .m-search input {
    width: 100%;
    height: 46px;
    border: 1.5px solid #e4e8f0;
    border-radius: 14px;
    background: #f7f8fb;
    padding: 0 44px;
    font-family: inherit;
    font-size: 15px;
    color: #141a2e;
    outline: none;
    transition: border-color .15s, background .15s;
}

#sbp_banks_modal .m-search input::placeholder {
    color: #9aa3b7;
    opacity: 1;
    font-weight: normal;
}

#sbp_banks_modal .m-search input:focus {
    border-color: #1476E6;
    background: #fff;
}

#sbp_banks_modal .m-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #f1f3f8;
    color: #6b7488;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    box-shadow: none;
    padding: 0;
}

#sbp_banks_modal .m-clear:hover {
    background: #e5e8f0;
}

#sbp_banks_modal .m-clear.show {
    display: flex;
}

#sbp_banks_modal .m-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 10px 8px;
    min-height: 120px;
    scrollbar-width: thin;
    scrollbar-color: #d5dae6 transparent;
}

#sbp_banks_modal .m-list::-webkit-scrollbar {
    width: 8px;
}

#sbp_banks_modal .m-list::-webkit-scrollbar-thumb {
    background: #d5dae6;
    border-radius: 8px;
}

#sbp_banks_modal .logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 13px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    box-shadow: 0 1px 4px rgba(16, 24, 52, .1);
}

#sbp_banks_modal img.logo {
    background: #fff;
    object-fit: contain;
}

#sbp_banks_modal .m-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: background .13s;
    font-family: inherit;
    text-align: left;
}

#sbp_banks_modal .m-row:hover {
    background: #f4f6fb;
    border-radius: 8px;
}

#sbp_banks_modal .m-row.sel {
    background: #eaf3fe;
    border-radius: 8px;
}

#sbp_banks_modal .m-row .name {
    flex: 1;
    font-size: 15.5px;
    font-weight: 600;
    color: #141a2e;
}

#sbp_banks_modal .m-row .chev {
    margin-right: 6px;
}

#sbp_banks_modal .m-row .check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1476E6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sbp_banks_modal .m-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9aa3b7;
    font-size: 15px;
    overflow-wrap: anywhere;
}

#sbp_banks_modal .m-foot {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    border-top: 1px solid #eef1f6;
    background: #fff;
}

#sbp_banks_modal .m-cta {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 14px;
    background: #e9edf4;
    color: #a7afc0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: not-allowed;
    box-shadow: none;
    transition: background .15s, transform .1s;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 6px;
    row-gap: 0;
    line-height: 1.2;
    padding: 8px 16px;
}

#sbp_banks_modal .m-cta .cta-sub,
#sbp_banks_modal .m-cta .cta-name {
    font-size: 15px;
    font-weight: 700;
}

#sbp_banks_modal .m-cta.on {
    background: #1476E6;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px -6px rgba(20, 118, 230, .5);
}

#sbp_banks_modal .m-cta.on:active {
    transform: scale(.99);
}

#sbp_banks_modal .m-secure {
    margin-top: 10px;
    padding: 0 6px;
    font-size: 12px;
    color: #9aa3b7;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

#sbp_banks_modal .m-secure svg {
    margin-top: 2px;
    flex-shrink: 0;
}

#sbp_banks_modal .m-secure span {
    flex: 1;
    text-align: left;
}

@keyframes bmPulse {
    0% { transform: scale(.7); box-shadow: 0 0 0 0 rgba(20, 118, 230, .55); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(20, 118, 230, 0); }
    100% { transform: scale(.7); box-shadow: 0 0 0 0 rgba(20, 118, 230, 0); }
}

@keyframes bmPop {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes bmFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 540px) {
    #sbp_banks_modal {
        align-items: flex-end;
        padding: 0 24px 64px;
    }

    #sbp_banks_modal .sbp-modal-box {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 24px;
    }

    #sbp_banks_modal .m-head {
        padding: 20px 18px 12px;
    }
}
