/* =============================================
   kad-ahli.css v1 — Kad Ahli MQI (digital)
   Salinan tepat docs/Kad_Ahli_MQI.dc.html (856 x 540, CR80 10px/mm).
   Pentas reka bentuk kekal 856x540; JS (kad-ahli.js) skala ikut lebar bekas.
   ============================================= */

.kad-ahli {
  --kad-s: .42;              /* skala awal (dikemas kini oleh ResizeObserver) */
  --kad-navy: #0a1a2e;
  --kad-hijau: #22a24f;
  --kad-hijau-muda: #4cc777;
  --kad-label: #9fb0c4;
  position: relative;
  display: block;
  width: 100%;
  max-width: 856px;
  aspect-ratio: 856 / 540;
  perspective: 1800px;
  font-family: 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  line-height: normal;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  color: #fff;
  user-select: none;
}
.kad-ahli *, .kad-ahli *::before, .kad-ahli *::after { box-sizing: border-box; margin: 0; padding: 0; }
.kad-ahli--flip { cursor: pointer; }
.kad-ahli--flip:focus { outline: none; }
.kad-ahli--flip:focus-visible { outline: 3px solid var(--kad-hijau); outline-offset: 4px; border-radius: calc(32px * var(--kad-s) + 4px); }

.kad-ahli__putar {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.3, .7, .2, 1);
}
.kad-ahli.is-belakang .kad-ahli__putar { transform: rotateY(180deg); }

.kad-ahli__muka {
  position: absolute; inset: 0;
  border-radius: calc(32px * var(--kad-s));
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--kad-navy);
  box-shadow: 0 calc(30px * var(--kad-s)) calc(60px * var(--kad-s)) calc(-20px * var(--kad-s)) rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.25);
}
.kad-ahli__muka--belakang { transform: rotateY(180deg); }

/* Pentas 856x540 diskala */
.kad-ahli__pentas {
  position: absolute; left: 0; top: 0;
  width: 856px; height: 540px;
  transform: scale(var(--kad-s));
  transform-origin: 0 0;
  overflow: hidden;
  background: var(--kad-navy);
}

/* Latar: gelang sepusat + cahaya biru */
.kad-ahli__gelang {
  position: absolute; right: -380px; top: -420px; width: 1000px; height: 1000px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 13px, rgba(34,162,79,.24) 13px 14px);
  -webkit-mask-image: radial-gradient(circle at 30% 70%, #000 0, transparent 60%);
  mask-image: radial-gradient(circle at 30% 70%, #000 0, transparent 60%);
}
.kad-ahli__cahaya {
  position: absolute; right: -120px; bottom: -200px; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(31,78,121,.6), transparent 65%);
}

/* ---------- DEPAN ---------- */
.kad-ahli__logo {
  position: absolute; left: 48px; top: 36px; width: 330px; height: 330px;
  object-fit: contain; border-radius: 50%; background: #fff; display: block;
}
.kad-ahli__jalur {
  position: absolute; left: 0; bottom: 44px; height: 96px; width: 470px;
  background: var(--kad-hijau);
  clip-path: polygon(0 0, 86% 0, 100% 100%, 0 100%);
  display: flex; flex-direction: column; justify-content: center;
  padding-left: 52px; gap: 2px;
  font-weight: 800; letter-spacing: .06em; line-height: 1.05;
}
.kad-ahli__jalur span:first-child { color: #fff; font-size: 22px; }
.kad-ahli__jalur span:last-child { color: var(--kad-navy); font-size: 27px; }

.kad-ahli__kolum { position: absolute; left: 432px; top: 62px; right: 48px; display: flex; flex-direction: column; }
.kad-ahli__tajuk { font-weight: 900; font-size: 54px; line-height: .92; letter-spacing: .01em; color: #fff; font-stretch: 96%; }
.kad-ahli__slogan { margin-top: 12px; font-size: 18px; font-weight: 500; color: var(--kad-hijau-muda); }
.kad-ahli__medan-set { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.kad-ahli__medan { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kad-ahli__label { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--kad-label); }
.kad-ahli__nama {
  font-size: 30px; font-weight: 600; color: #fff; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.kad-ahli__nama.is-dua-baris {
  white-space: normal; text-overflow: clip; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.kad-ahli__tarikh { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 22px; font-weight: 500; color: #fff; }
.kad-ahli__no {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 34px; font-weight: 700;
  color: var(--kad-hijau-muda); letter-spacing: .02em; white-space: nowrap; overflow: hidden; max-width: 100%;
}
.kad-ahli__nfc {
  position: absolute; right: 44px; bottom: 44px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff;
}
.kad-ahli__nfc svg { display: block; }
.kad-ahli__nfc div { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-align: center; line-height: 1.35; }

/* ---------- BELAKANG ---------- */
.kad-ahli__pentas--belakang { display: flex; flex-direction: column; }
.kad-ahli__isi {
  flex: 1; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 200px;
  gap: 48px; padding: 44px 52px 24px; align-items: center;
}
.kad-ahli__teks { display: flex; flex-direction: column; gap: 20px; max-width: 470px; }
.kad-ahli__blok { display: flex; flex-direction: column; gap: 6px; }
.kad-ahli__blok-h { font-weight: 800; font-size: 20px; letter-spacing: .08em; color: var(--kad-hijau-muda); }
.kad-ahli__blok-p { font-size: 17px; line-height: 1.45; color: #e6ecf2; text-wrap: pretty; }
.kad-ahli__qrset { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kad-ahli__qr {
  width: 180px; height: 180px; border-radius: 14px; background: #fff;
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.kad-ahli__qr-kod { width: 152px; height: 152px; display: flex; align-items: center; justify-content: center; }
.kad-ahli__qr-kod canvas, .kad-ahli__qr-kod img { width: 152px !important; height: 152px !important; image-rendering: pixelated; }
.kad-ahli__qr-kosong {
  width: 100%; height: 100%; border: 2px dashed #b5bcc4; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #66707a; text-align: center; letter-spacing: .06em; line-height: 1.3;
}
.kad-ahli__qr-cap { font-size: 12px; font-weight: 600; letter-spacing: .1em; color: #e6ecf2; text-align: center; line-height: 1.4; }
.kad-ahli__kaki {
  position: relative; background: var(--kad-hijau); height: 56px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 52px;
  font-size: 16px; font-weight: 600; color: var(--kad-navy);
}
.kad-ahli__kaki div { white-space: nowrap; }
.kad-ahli__notis {
  position: relative; background: #f1f3f5; height: 84px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 52px;
}
.kad-ahli__notis-p { font-size: 13.5px; line-height: 1.45; color: #26303a; max-width: 540px; }
.kad-ahli__tag { font-weight: 800; font-size: 16px; letter-spacing: .06em; color: var(--kad-navy); white-space: nowrap; }

/* Pembaca skrin sahaja */
.kad-ahli__vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Petunjuk "Tap card to flip" (pilihan, di luar kad) */
.kad-ahli-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--ink-2, #4c5a55); }

@media (prefers-reduced-motion: reduce) {
  .kad-ahli__putar { transition: none; }
}
