/* Membership card + foil seal — shared by sign-up and the account page. Builds on styles.css. */

.mono { font-family: var(--mono, "JetBrains Mono", ui-monospace, monospace); letter-spacing: 0.02em; }
.avatar {
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff; font-weight: 800;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 45%),
    linear-gradient(140deg, #38bdf8, #6366f1 60%, #0b1f4b);
}
/* ---------- Membership card ---------- */
.card-wrap { max-width: 620px; margin: 0 auto; }
.mcard-tilt { perspective: 1200px; }
/* the card shrinks with whatever holds it (onboarding, account column, staff detail panel) */
.mcard-tilt { container-type: inline-size; }

.mcard {
  --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%;
  position: relative;
  aspect-ratio: 1.586;               /* credit-card proportions */
  border-radius: 26px;
  padding: 26px 30px 24px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(56, 132, 255, 0.55), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(56, 189, 248, 0.45), transparent 60%),
    radial-gradient(60% 60% at 80% 10%, rgba(139, 92, 246, 0.35), transparent 70%),
    linear-gradient(135deg, #0b1f4b, #16348a 55%, #0d2563);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 30px 60px -18px rgba(11, 31, 75, 0.55),
    0 12px 24px -12px rgba(11, 31, 75, 0.4);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .4s ease;
}
.mcard.tilting { transition: transform .08s linear; }
.mcard.issuing { animation: issue .8s cubic-bezier(.2, .8, .2, 1) backwards; }
@keyframes issue {
  from { opacity: 0; transform: translateY(36px) rotateX(24deg) scale(.95); }
  to   { opacity: 1; transform: rotateX(var(--rx)) rotateY(var(--ry)); }
}

/* fine engraved lines + a big faint logo, like premium card stock */
.mc-lines {
  position: absolute; inset: 0; z-index: -1;
  background:
    repeating-radial-gradient(circle at 110% 120%, transparent 0 11px, rgba(255, 255, 255, 0.06) 11px 12px),
    repeating-linear-gradient(115deg, transparent 0 6px, rgba(255, 255, 255, 0.025) 6px 7px);
  -webkit-mask-image: linear-gradient(200deg, #000 20%, transparent 85%);
          mask-image: linear-gradient(200deg, #000 20%, transparent 85%);
}
.mc-watermark {
  position: absolute; z-index: -1;
  right: -60px; top: -40px;
  width: 340px;
  filter: brightness(0) invert(1);
  opacity: .06;
}
/* light catch that follows the tilt, plus a sweep after the seal lands */
.mc-glare {
  position: absolute; inset: 0; z-index: 4;
  pointer-events: none;
  background: radial-gradient(60% 50% at var(--gx) var(--gy), rgba(255, 255, 255, 0.16), transparent 70%);
}
.mcard::after {
  content: "";
  position: absolute; inset: 0; z-index: 5;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
.mcard.sheen::after { animation: sheen 1.2s ease .1s; }
@keyframes sheen { to { transform: translateX(120%); } }

.mc-head { display: flex; align-items: center; justify-content: space-between; }
.mc-brand { display: flex; align-items: center; gap: 10px; }
.mc-brand img { width: 30px; filter: brightness(0) invert(1); }
.mc-brand span { font-size: 15px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.mc-tier {
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

.mc-who { display: flex; align-items: center; gap: 16px; align-self: center; }
.mc-photo {
  width: 78px; height: 78px; flex: none;
  padding: 3px; border-radius: 22px;
  background: linear-gradient(140deg, #e0f2fe, #a5b4fc 45%, #fbcfe8 75%, #fde68a);
  box-shadow: 0 10px 22px rgba(3, 10, 40, 0.4);
}
.mc-photo .avatar { width: 100%; height: 100%; border-radius: 19px; font-size: 34px; }
img.avatar { object-fit: cover; }
.mc-name { display: grid; line-height: 1.15; }
.mc-name strong { font-size: 30px; letter-spacing: -.02em; }
.mc-name span { font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, 0.7); }

.mc-label, .mc-meta dt {
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.mc-id { display: grid; gap: 2px; margin-bottom: 14px; }
/* embossed numbers, like a real card */
.mc-num {
  font-size: 25px; font-weight: 700; letter-spacing: .14em;
  color: #eef4ff;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35), 0 -1px 0 rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.mc-meta { display: flex; gap: 26px; padding-right: 150px; }
.mc-meta dt { white-space: nowrap; }
.mc-meta dd { font-size: 14px; font-weight: 700; margin-top: 2px; white-space: nowrap; }
.mc-meta dd.mono { font-size: 13px; }

/* The foil seal */
.stamp {
  position: absolute;
  z-index: 3;
  right: 22px;
  bottom: 16px;
  width: 140px;
  height: 140px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(3, 10, 40, 0.45));
}
.stamp svg { width: 100%; height: 100%; overflow: visible; }
.stamp.down { animation: stamp .62s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes stamp {
  0%   { opacity: 0; transform: translate(30px, -70px) scale(2.4) rotate(-30deg); filter: blur(4px); }
  55%  { opacity: 1; transform: translate(0, 0) scale(.92) rotate(-10deg); filter: blur(0) drop-shadow(0 4px 10px rgba(3, 10, 40, 0.45)); }
  72%  { transform: scale(1.05) rotate(-9deg); }
  100% { opacity: 1; transform: scale(1) rotate(-9deg); filter: drop-shadow(0 4px 10px rgba(3, 10, 40, 0.45)); }
}

/* light ring that pushes out on impact */
.ink-puff {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 16px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid rgba(186, 230, 253, .6);
  opacity: 0;
  pointer-events: none;
}
.ink-puff.go { animation: puff .6s ease-out .34s; }
@keyframes puff {
  from { opacity: 1; transform: scale(.9); }
  to   { opacity: 0; transform: scale(1.7); }
}

/* the card takes the hit */
.mcard.thud { animation: thud .32s ease .32s; }
@keyframes thud {
  0%, 100% { transform: none; }
  30% { transform: translateY(3px) scale(.992); }
  60% { transform: translateY(-1px); }
}

/* ---------- Plan colours: blue = Basic (above), black = Pro, gold = Enterprise ---------- */
.mcard.tier-pro {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, 0.14), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(148, 163, 184, 0.2), transparent 60%),
    radial-gradient(60% 60% at 80% 10%, rgba(203, 213, 225, 0.1), transparent 70%),
    linear-gradient(135deg, #0b0b0e, #1d1f25 55%, #08080a);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 30px 60px -18px rgba(0, 0, 0, 0.6),
    0 12px 24px -12px rgba(0, 0, 0, 0.45);
}
.mcard.tier-pro .mc-photo { background: linear-gradient(140deg, #f8fafc, #94a3b8 45%, #e2e8f0 75%, #64748b); }
.mcard.tier-pro .mc-num { color: #f1f5f9; }
/* silver seal */
.mcard.tier-pro .stamp stop:nth-child(odd) { stop-color: #f8fafc; }
.mcard.tier-pro .stamp stop:nth-child(even) { stop-color: #94a3b8; }

.mcard.tier-enterprise {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 240, 190, 0.55), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(255, 214, 102, 0.35), transparent 60%),
    radial-gradient(60% 60% at 80% 10%, rgba(255, 250, 225, 0.25), transparent 70%),
    linear-gradient(135deg, #5c3f0a, #a87a17 45%, #d6a83a 62%, #7d5810);
  border-color: rgba(255, 236, 170, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 210, 0.45),
    0 30px 60px -18px rgba(92, 63, 10, 0.55),
    0 12px 24px -12px rgba(92, 63, 10, 0.4);
  text-shadow: 0 1px 2px rgba(60, 38, 4, 0.35);
}
.mcard.tier-enterprise .mc-label, .mcard.tier-enterprise .mc-meta dt { color: rgba(255, 250, 235, 0.72); }
.mcard.tier-enterprise .mc-name span { color: rgba(255, 250, 235, 0.82); }
.mcard.tier-enterprise .mc-tier { background: rgba(255, 245, 210, 0.18); border-color: rgba(255, 245, 210, 0.4); }
.mcard.tier-enterprise .mc-photo { background: linear-gradient(140deg, #fff7d6, #f5c542 40%, #fff1b8 70%, #b8860b); }
.mcard.tier-enterprise .mc-num { color: #fffaf0; }
/* gold seal */
.mcard.tier-enterprise .stamp stop:nth-child(odd) { stop-color: #fff3c4; }
.mcard.tier-enterprise .stamp stop:nth-child(even) { stop-color: #e2b13c; }

.card-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.card-actions + .alt { margin-top: 14px; }

/* already sealed (account page): no animation, just sits there */
.stamp.placed { opacity: 1; transform: rotate(-9deg); }

@container (max-width: 560px) {
  .mcard { aspect-ratio: auto; padding: 22px 20px 20px; gap: 18px; border-radius: 22px; }
  .mc-brand { gap: 8px; }
  .mc-brand img { width: 24px; }
  .mc-brand span { font-size: 11.5px; letter-spacing: .12em; white-space: nowrap; }
  .mc-tier { font-size: 9.5px; padding: 5px 8px; letter-spacing: .1em; white-space: nowrap; }
  .mc-name strong { font-size: 24px; }
  .mc-num { font-size: 19px; }
  .mc-id { margin-bottom: 0; }
  .mc-meta { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 12px 22px; padding-right: 0; }
  .mc-meta div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .stamp, .ink-puff { width: 84px; height: 84px; right: 14px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .mcard.issuing, .mcard.thud, .ink-puff.go, .mcard.sheen::after { animation: none; }
  .stamp.down { animation: none; opacity: 1; transform: rotate(-9deg); }
}
