/* css_new/modal2.css — modal เข้าสู่ระบบ / สมัครสมาชิก ดีไซน์ใหม่ (markup อยู่ใน _template/__html2.php) */

.modal-backdrop.show {
    background: #081E46;
    opacity: .62;
}

.m2-modal .modal-dialog {
    max-width: 420px;
}

.m2-card {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: #FFFFFF;
    box-shadow: 0 30px 60px rgba(0, 20, 60, .45);
    color: #0B2A5B;
    line-height: 1.5;
}

/* ---------- head ---------- */
.m2-head {
    position: relative;
    padding: 22px 24px 46px;
    text-align: center;
    color: #FFFFFF;
    background:
        radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(160deg, #3D9BFF 0%, #1668DC 55%, #0A56C8 100%);
}

.m2-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 26px;
    background: #FFFFFF;
    border-radius: 24px 24px 0 0;
}

.m2-grab {
    display: none;
    width: 44px;
    height: 5px;
    margin: -10px auto 10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .6);
}

.m2-logo {
    display: block;
    height: 58px;
    margin: 0 auto 6px;
    filter: drop-shadow(0 4px 8px rgba(0, 30, 90, .35));
}

.m2-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    color: #FFFFFF;
}

.m2-sub {
    margin: 2px 0 0;
    font-size: 13px;
    opacity: .9;
}

.m2-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .2);
    color: #FFFFFF;
    font-size: 16px;
    cursor: pointer;
    transition: background .15s ease;
}

.m2-close:hover {
    background: rgba(255, 255, 255, .35);
}

/* ---------- body ---------- */
.m2-body {
    position: relative;
    padding: 4px 26px 24px;
}

.m2-steps {
    display: flex;
    gap: 10px;
    margin: 0 0 18px;
}

.m2-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #F2F6FB;
    color: #8A9AB0;
    font-size: 12.5px;
    font-weight: 600;
}

.m2-step b {
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #DCE6F2;
    color: #FFFFFF;
    font-size: 12px;
}

.m2-step.on {
    background: #E8F2FF;
    color: #1668DC;
}

.m2-step.on b {
    background: #1668DC;
}

.m2-step.done {
    background: #E7F8EF;
    color: #067647;
}

.m2-step.done b {
    background: #12B76A;
}

/* ---------- fields ---------- */
.m2-field {
    margin-bottom: 14px;
}

.m2-box {
    position: relative;
    display: flex;
    align-items: center;
    height: 52px;
    border-radius: 14px;
    border: 1.5px solid #DCE8F5;
    background: #F4F8FD;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.m2-box:focus-within {
    border-color: #1668DC;
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(22, 104, 220, .12);
}

.m2-box.is-ok {
    border-color: #12B76A;
    background: #FFFFFF;
}

.m2-box.is-bad {
    border-color: #F04438;
    background: #FFF8F7;
}

.m2-box.is-bad .m2-lead {
    color: #F04438;
}

.m2-lead {
    flex: none;
    width: 48px;
    text-align: center;
    color: #1668DC;
    font-size: 17px;
}

.m2-box input,
.m2-box select {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 14px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 15px;
    color: #0B2A5B;
    -webkit-appearance: none;
    appearance: none;
}

.m2-box input::placeholder {
    color: #93A3B8;
}

.m2-box select {
    cursor: pointer;
}

.m2-trail {
    flex: none;
    width: 44px;
    text-align: center;
    color: #8A9AB0;
    font-size: 16px;
    pointer-events: none;
}

.m2-eye {
    cursor: pointer;
    pointer-events: auto;
}

.m2-eye:hover {
    color: #1668DC;
}

.m2-check {
    color: #12B76A;
}

.m2-hint,
.m2-err {
    margin: 6px 4px 0;
    font-size: 12.5px;
    line-height: 1.45;
}

.m2-hint {
    color: #6C7A8E;
}

.m2-err {
    color: #D92D20;
    font-weight: 600;
}

.m2-err i {
    margin-right: 4px;
}

.m2-label {
    margin: 0 0 10px 2px;
    font-size: 14px;
    font-weight: 700;
}

/* ---------- banks ---------- */
.m2-banks {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.m2-bank {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #1668DC;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}

.m2-bank:hover {
    transform: translateY(-2px);
}

.m2-bank img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.m2-bank.is-sel {
    box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 6px #1668DC;
}

.m2-bank.is-sel::after {
    content: "\f00c";
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    background: #1668DC;
    color: #FFFFFF;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 9px;
}

.m2-bank.is-dim {
    opacity: .38;
}

/* ---------- buttons / links ---------- */
.m2-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 4px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.m2-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.m2-btn-blue {
    color: #FFFFFF;
    background: linear-gradient(180deg, #3D9BFF 0%, #1668DC 55%, #0A56C8 100%);
    box-shadow: 0 8px 18px rgba(10, 86, 200, .32);
}

.m2-btn-gold {
    color: #14213D;
    background: linear-gradient(180deg, #FFE066 0%, #FFC72C 55%, #F5A700 100%);
    box-shadow: 0 8px 18px rgba(245, 167, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.m2-btn.is-off,
.m2-btn:disabled {
    color: #FFFFFF;
    background: #BFD3EA;
    box-shadow: none;
    transform: none;
    filter: none;
    cursor: not-allowed;
}

.m2-alt {
    margin: 16px 0 0;
    text-align: center;
    font-size: 14px;
    color: #6C7A8E;
}

.m2-alt a {
    color: #1668DC;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.m2-alt a:hover {
    text-decoration: underline;
}

/* ---------- alert / status ---------- */
.m2-alert {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px 36px 10px 12px;
    border-radius: 12px;
    border: 1px solid #FECDCA;
    background: #FEF3F2;
    color: #B42318;
    font-size: 13px;
}

.m2-alert > i {
    margin-top: 3px;
}

.m2-alert-x {
    position: absolute;
    top: 8px;
    right: 10px;
    color: #B42318;
}

.m2-status {
    margin: 14px 0 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #067647;
}

/* ---------- มือถือ: แผ่นเลื่อนขึ้นจากด้านล่าง ---------- */
@media screen and (max-width: 575px) {
    .m2-modal .modal-dialog,
    .m2-modal .modal-dialog-centered {
        max-width: none;
        min-height: 100%;
        margin: 0;
        align-items: flex-end;
    }

    .m2-modal.fade .modal-dialog {
        transform: translateY(100%);
        transition: transform .3s ease-out;
    }

    .m2-modal.show .modal-dialog {
        transform: none;
    }

    .m2-card {
        max-height: 92vh;
        overflow-y: auto;
        border-radius: 26px 26px 0 0;
    }

    .m2-grab {
        display: block;
    }

    .m2-body {
        padding: 4px 20px 22px;
    }

    .m2-banks {
        gap: 8px;
    }
}
