/**
 * Modal riêng cho popup "Đăng ký" (thay Popup Maker) — viec/2026-10-02-
 * tach-popup-dang-ky-khoi-plugin. Namespace CSS: mọi class bắt đầu bằng
 * "rm-" (register-modal), KHÔNG dùng bất kỳ class nào trong nhóm
 * pum- hoặc popmake- để tránh Popup Maker's global CSS can thiệp.
 * (Lưu ý: KHÔNG viết chuỗi "star-slash" (ký tự đóng comment CSS) bên
 * trong nội dung comment, dù chỉ là text mô tả class — trình duyệt đóng
 * comment ngay tại đó và bỏ qua toàn bộ phần còn lại của file tới ký tự
 * đóng comment hợp lệ tiếp theo, kể cả rule .rm-overlay bên dưới — đây
 * chính là nguyên nhân gốc khiến display:none không áp dụng dù có mặt
 * trong file nguồn.)
 *
 * UX giữ theo khảo sát popup 1589 cũ (animation fade 350ms, responsive
 * max-width 640px) + 2 cải tiến do Chủ tịch quyết (ESC, click-outside —
 * xử lý ở register-modal.js, phần CSS này chỉ cần hỗ trợ trạng thái
 * mở/đóng bằng class).
 */

/* Mặc định ẨN modal trong luồng trang (display:none) — thiếu rule này sẽ
 * khiến div modal (#rm-register-modal, in qua wp_footer sau <footer>)
 * hiển thị display:block ngay trong luồng DOM, chiếm ~530-630px chiều cao
 * và tạo vùng xám trống ngay dưới footer trên mọi trang. Việc:
 * 2026-10-06-fix-vung-trong-footer-va-link-404. */
.rm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2147483000; /* cao hơn mọi phần tử khác trên site, kể cả
                             header sticky (z-index 30) và Popup Maker
                             (1999999999) — xem khảo sát mục 2 */
    opacity: 0;
    transition: opacity 350ms ease;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.rm-overlay.rm-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.rm-overlay.rm-visible {
    opacity: 1;
}

.rm-container {
    position: relative;
    background-color: #fff;
    width: 100%;
    max-width: 640px;
    margin-top: 100px; /* giữ tương đương location "center top" +
                           position_top 100 của popup cũ */
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.25);
    padding: 30px 25px;
    box-sizing: border-box;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 350ms ease, opacity 350ms ease;
}

.rm-overlay.rm-visible .rm-container {
    transform: translateY(0);
    opacity: 1;
}

.rm-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    font-size: 22px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #777;
    z-index: 1;
}

.rm-close:hover,
.rm-close:focus {
    color: #111;
}

.rm-body {
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

/* Scroll-lock áp trên html/body khi 1 modal rm-* đang mở */
html.rm-scroll-lock,
body.rm-scroll-lock {
    overflow: hidden !important;
    height: 100%;
}

@media screen and (max-width: 640px) {
    .rm-overlay {
        padding: 10px;
    }
    .rm-container {
        margin-top: 40px;
        padding: 25px 18px;
    }
}
