/* Hạng thành viên — dùng chung cho thẻ hạng ở /profile và trang chính sách /hang-thanh-vien. */

/* ===== Thẻ hạng hiện tại (partials/membershipCard.ejs) ===== */
.mb-tier-card {
    background: #fff;
    border: 1px solid #ffe6e0;
    border-radius: 24px;
    box-shadow: 0 8px 24px -10px rgba(250, 208, 196, 0.6);
    padding: 22px 24px;
}

.mb-tier-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.mb-tier-badge {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    padding: 7px 18px;
    border-radius: 999px;
}

.mb-tier-off {
    font-weight: 800;
    font-size: 0.9rem;
    color: #d67d63;
}

.mb-tier-tagline {
    margin: 12px 0 0;
    color: #8a7772;
    font-size: 0.88rem;
}

.mb-tier-total {
    margin-top: 14px;
    font-size: 0.92rem;
    color: #5c4b47;
}

.mb-tier-total strong { color: #d67d63; font-weight: 800; }

.mb-tier-bar {
    margin-top: 10px;
    height: 10px;
    border-radius: 999px;
    background: #fff5f2;
    overflow: hidden;
}

.mb-tier-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

.mb-tier-next {
    margin: 10px 0 0;
    font-size: 0.88rem;
    color: #5c4b47;
    line-height: 1.5;
}

.mb-tier-next strong { color: #d67d63; }

.mb-tier-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #d67d63;
    text-decoration: none;
}

.mb-tier-link:hover { text-decoration: underline; }

/* ===== Trang chính sách ===== */
.mb-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.mb-hero {
    text-align: center;
    background: linear-gradient(135deg, #ffd6e6 0%, #fad0c4 55%, #ffe9b3 100%);
    border-radius: 28px;
    padding: 34px 24px;
    box-shadow: 0 10px 30px rgba(250, 208, 196, 0.3);
}

.mb-hero h1 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: #5c4b47;
    margin: 0;
    line-height: 1.3;
}

.mb-hero p {
    margin: 10px auto 0;
    max-width: 520px;
    color: #6b5651;
    font-size: 0.94rem;
    line-height: 1.6;
}

.mb-section {
    background: #fff;
    border: 1px solid #ffe6e0;
    border-radius: 24px;
    box-shadow: 0 8px 24px -10px rgba(250, 208, 196, 0.6);
    padding: 22px 24px;
}

.mb-section h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #d67d63;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #ffe6e0;
}

/* Bảng hạng */
.mb-ladder {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mb-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid #ffe6e0;
    background: #fffcfb;
}

.mb-row.is-current {
    border: 2px solid #fbc1b0;
    background: #fff5f2;
    box-shadow: 0 6px 18px -8px rgba(250, 208, 196, 0.8);
}

.mb-row-badge {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.92rem;
    padding: 8px 16px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mb-row-info { flex: 1; min-width: 0; }

.mb-row-need {
    font-size: 0.88rem;
    font-weight: 700;
    color: #5c4b47;
}

.mb-row-tagline {
    font-size: 0.8rem;
    color: #8a7772;
    margin-top: 2px;
}

.mb-row-off {
    font-family: 'Nunito', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #d67d63;
    white-space: nowrap;
    flex-shrink: 0;
}

.mb-row-off small {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    color: #8a7772;
}

.mb-you {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 999px;
    background: #ffd6e6;
    color: #b34a6b;
    vertical-align: middle;
}

/* Quy tắc */
.mb-rules {
    margin: 0;
    padding-left: 20px;
    color: #5c4b47;
    font-size: 0.9rem;
    line-height: 1.75;
}

.mb-rules strong { color: #d67d63; }

/* Ví dụ tính giá */
.mb-example {
    background: #fff5f2;
    border: 1px dashed #ffe6e0;
    border-radius: 18px;
    padding: 16px 18px;
    margin-top: 14px;
    font-size: 0.88rem;
    color: #5c4b47;
    line-height: 1.9;
}

.mb-example b { color: #d67d63; }

.mb-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fad0c4 0%, #fbc1b0 100%);
    color: #5c4b47;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 12px 26px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(250, 208, 196, 0.5);
    transition: transform 0.25s, box-shadow 0.25s;
}

.mb-cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 22px rgba(250, 208, 196, 0.7);
    text-decoration: none;
}

@media (max-width: 1000px) {
    .mb-page { padding: 10px; }
    .mb-hero h1 { font-size: 1.4rem; }

    .mb-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .mb-row-info { flex-basis: 100%; order: 3; }
}

/* ===== Viền avatar theo hạng (ảnh nhẫn Gemini gen — /images/membership/frame-<key>.png) ===== */

/* Bọc quanh <img> avatar bất kỳ cỡ nào: khung = 150% avatar, tâm trùng tâm avatar. */
.mb-ava-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mb-ava-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    max-width: none;
    pointer-events: none;
}

/* Huy hiệu Premium cạnh tên */
.mb-premium-ic {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    vertical-align: -4px;
    box-shadow: 0 2px 6px rgba(224, 182, 79, 0.45);
}

/* Preview khung trong bảng hạng /hang-thanh-vien: ô cố định, khung nằm gọn không tràn hàng */
.mb-row-ava {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mb-row-ava .ava {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffe6e0;
    background: #fff;
}

.mb-row-ava .frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
