/* ============================================================
   UDM web membership card — themed, personalized, flips to show
   both sides. Shared by the Upgrade page and Check-Membership.
   Theme colours come in via CSS vars (--c1..--c3, --txt, --acc).
   ============================================================ */
.mcard-flip { width:100%; perspective:1600px; cursor:pointer; }
/* Height comes from a padding ratio (resolves from the container width, so it never
   collapses the way aspect-ratio can when both faces are absolutely positioned). The
   ratio is loosened on phones (below) so the card is a touch taller and its bottom row
   is never clipped on narrow widths. */
.mcard-flip__inner { position:relative; width:100%; height:0; padding-bottom:63.05%; transform-style:preserve-3d; transition:transform .85s cubic-bezier(.2,.7,.2,1); }
.mcard-flip:hover .mcard-flip__inner, .mcard-flip.is-flipped .mcard-flip__inner { transform:rotateY(180deg); }
.mcard-face { position:absolute; inset:0; border-radius:16px; overflow:hidden; backface-visibility:hidden; -webkit-backface-visibility:hidden; box-shadow:0 16px 38px rgba(16,18,24,.26); }
.mcard-face--back { transform:rotateY(180deg); }

.mcard { position:relative; width:100%; height:100%; border-radius:16px; overflow:hidden; color:var(--txt,#fff);
         background:linear-gradient(135deg,var(--c1,#e00616) 0%,var(--c2,#b00512) 45%,var(--c3,#7d0410) 100%);
         padding:16px 18px; display:flex; flex-direction:column; }
.mcard__sheen { position:absolute; inset:0; background:linear-gradient(115deg,rgba(255,255,255,.16),rgba(255,255,255,0) 42%); pointer-events:none; z-index:0; }
.mcard__wm { position:absolute; right:-14%; bottom:-20%; width:62%; height:88%; background-repeat:no-repeat; background-position:center; background-size:contain; opacity:.08; pointer-events:none; z-index:0; filter:grayscale(1) brightness(2.2); }
.mcard__top { display:flex; align-items:center; gap:10px; position:relative; z-index:1; }
.mcard__logo { width:34px; height:34px; object-fit:contain; background:rgba(255,255,255,.14); border-radius:8px; padding:3px; }
.mcard__org { flex:1; line-height:1.15; min-width:0; }
.mcard__orgname { font-size:.6rem; font-weight:800; letter-spacing:.4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mcard__orgtag { font-size:.52rem; opacity:.82; letter-spacing:.4px; }
.mcard__tier { font-size:.58rem; font-weight:800; letter-spacing:1px; text-transform:uppercase; padding:4px 9px; border-radius:999px; color:var(--acc); background:rgba(0,0,0,.2); border:1px solid var(--acc); white-space:nowrap; }
.mcard__chip { width:36px; height:27px; border-radius:6px; margin:12px 0 8px; background:linear-gradient(135deg,#f7e08a,#caa23a); box-shadow:inset 0 0 0 1px rgba(0,0,0,.15); position:relative; z-index:1; }
.mcard__body { display:flex; gap:12px; align-items:flex-end; margin-top:auto; position:relative; z-index:1; }
.mcard__main { flex:1; min-width:0; }
.mcard__lbl { font-size:.5rem; text-transform:uppercase; letter-spacing:1px; opacity:.78; }
.mcard__name { font-size:1rem; font-weight:800; margin:2px 0 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mcard__meta { display:grid; grid-template-columns:1fr 1fr; gap:5px 10px; }
.mcard__meta .k { font-size:.48rem; text-transform:uppercase; letter-spacing:.4px; opacity:.72; display:block; }
.mcard__meta .v { font-size:.64rem; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }
.mcard__photo { width:56px; height:56px; border-radius:8px; overflow:hidden; background:rgba(255,255,255,.16); display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.mcard__photo img { width:100%; height:100%; object-fit:cover; }
.mcard__ini { font-weight:800; font-size:1.05rem; color:var(--txt); }
.mcard__flip-hint { position:absolute; bottom:10px; right:12px; z-index:1; opacity:.55; font-size:.8rem; }

/* Card back */
.mcard--back { justify-content:flex-start; }
.mcard-back__stripe { height:30px; margin:4px -18px 14px; background:rgba(0,0,0,.38); position:relative; z-index:1; }
.mcard-back__grid { display:flex; gap:13px; align-items:center; position:relative; z-index:1; }
.mcard-back__qr { width:76px; height:76px; background:#fff; border-radius:8px; padding:5px; flex:0 0 auto; }
.mcard-back__qr img { width:100%; height:100%; display:block; }
.mcard-back__txt .t { font-size:.72rem; font-weight:800; }
.mcard-back__txt .p { font-size:.56rem; opacity:.86; line-height:1.4; margin-top:3px; }
.mcard-back__txt .sig { opacity:.72; }
.mcard-back__foot { margin-top:auto; font-size:.5rem; opacity:.72; letter-spacing:.3px; position:relative; z-index:1; }

/* ===== Membership result layout (Check-Membership page + modal) ===== */
.cm-status { display:flex; align-items:center; justify-content:center; gap:4px; font-weight:700; font-size:.92rem; border-radius:10px; padding:11px 14px; margin:2px 0 20px; }
.cm-status--ok { background:#e7f6ec; color:#1f7a3d; border:1px solid #bfe6cc; }
.cm-status--pend { background:#fff7e6; color:#8a6d00; border:1px solid #ffe0a3; }
.cm-status--susp { background:#fdeaec; color:#b02a37; border:1px solid #f5c2c7; }

.cm-result { display:grid; grid-template-columns:340px minmax(0,1fr); gap:30px; align-items:start; }
.cm-flip-hint { text-align:center; font-size:.72rem; color:#9a9090; margin:10px 0 0; }

.cm-fields .reg-section-title { margin-bottom:4px !important; }
.cm-fields > div { margin-bottom:6px; }
.cm-fields .form-label { margin-bottom:0 !important; font-size:.6rem !important; text-transform:uppercase; letter-spacing:.4px; color:#9a9090 !important; }
.cm-fields .form-control { border:none !important; background:transparent !important; box-shadow:none !important; padding:0 !important; height:auto !important; min-height:0 !important; font-weight:600; color:#1e1414; font-size:.92rem; }

.cm-actions { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-top:22px; border-top:1px solid #eee; padding-top:18px; }
.cm-actions__group { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.cm-btn { display:inline-flex; align-items:center; justify-content:center; gap:7px; height:40px; padding:0 18px; border-radius:999px; font-weight:600; font-size:.86rem; text-decoration:none; border:1px solid transparent; cursor:pointer; white-space:nowrap; transition:filter .15s ease; }
.cm-btn i { font-size:1rem; }
.cm-btn:hover { filter:brightness(.96); }
.cm-btn--ghost { background:#fff; color:#555 !important; border-color:#ddd; }
.cm-btn--outline { background:#fff; color:#b8860b !important; border-color:#b8860b; }
.cm-btn--gold { background:#ffcd00; color:#212529 !important; }
.cm-btn--red { background:#D3000F; color:#fff !important; }
.cm-btn--dark { background:#212529; color:#ffcd00 !important; }

@media (max-width:860px) {
    .cm-result { grid-template-columns:1fr; gap:20px; }
    .cm-result__card { width:100%; max-width:340px; margin:0 auto; }
    /* make sure the card itself fills that column and keeps its ratio */
    .cm-result__card .mcard-flip { width:100%; }
}

/* Phones: stack the footer actions into a single full-width column so the buttons
   line up neatly instead of scattering with space-between + wrap. */
@media (max-width:600px) {
    .cm-actions { flex-direction:column; align-items:stretch; gap:8px; }
    .cm-actions__group { flex-direction:column; align-items:stretch; width:100%; gap:8px; }
    .cm-btn { width:100%; }

    /* The card content is a fixed height, but the card width shrinks on phones — give the
       card more height here so the bottom row (County / Member since) always fits, even on
       narrow (~320px) phones. */
    .mcard-flip__inner { padding-bottom:76%; }
}
