/* ============================================================
   AIMS Community Portal — style.css  V12
   Changes vs V10/V11:
   ✅ Safari WhatsApp FAB fix (no ::before/::after on <a>)
   ✅ Digital Member Card styles
   ✅ QR Code modal styles
   ✅ Platinum tier emoji fix (unicode escapes in JS, not CSS)
   ✅ All previous fixes retained
   ============================================================ */

/* ── CSS VARIABLES ────────────────────────────────────────── */
:root {
  --navy: #002f5f;
  --navy-2: #004080;
  --gold: #c9a24d;
  --gold-2: #b08d40;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15, 23, 42, .10);
  --shadow: 0 12px 32px rgba(0, 47, 95, .12);
  --radius: 16px;
  --focus: 0 0 0 4px rgba(0, 47, 95, .18);
  --ok: #16a34a;
  --bad: #b91c1c;
  --wa: #25D366;
  --whatsapp: #25D366;
}

/* ── DARK MODE ────────────────────────────────────────────── */
html[data-theme="dark"] {
  --bg: #0b1220;
  --card: #0f1a2d;
  --text: #e2eaf6;
  --muted: #8fa8c2;
  --border: rgba(226, 234, 246, .10);
  --shadow: 0 14px 36px rgba(0, 0, 0, .40);
}

/* ── RESET ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  transition: background .25s, color .25s;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ── UTILITIES ────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── LAYOUT ───────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  /* Safari Fix */
  display: flex;
  flex-direction: column;
}

/* ── HEADER ───────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border-bottom: 4px solid var(--navy);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
  transition: background .25s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-tap-highlight-color: transparent;
}

.brand__logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: contain;
}

.brand__name {
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
}

.brand__tagline {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

html[data-theme="dark"] .brand__name {
  color: #c8dbf0;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── ICON BUTTON ──────────────────────────────────────────── */
.iconBtn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy);
  font-size: 15px;
  transition: background .18s, transform .12s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
}

.iconBtn:hover {
  background: rgba(0, 47, 95, .06);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.iconBtn:active {
  transform: scale(.96);
}

.iconBtn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.iconBtn--sm {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

html[data-theme="dark"] .iconBtn {
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .iconBtn:hover {
  background: rgba(255, 255, 255, .07);
}

/* ── TABS ─────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  transition: background .25s;
}

.tab {
  flex: 1;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: .2s;
  -webkit-tap-highlight-color: transparent;
}

.tab:hover {
  background: rgba(0, 47, 95, .06);
  color: var(--navy);
}

.tab.is-active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 47, 95, .22);
}

.tab:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

html[data-theme="dark"] .tab:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

html[data-theme="dark"] .tab.is-active {
  background: var(--navy);
  color: #fff;
}

/* ── MAIN ─────────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 22px 14px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── VIEW ─────────────────────────────────────────────────── */
.view {
  width: 100%;
  max-width: 460px;
  animation: fadeUp .22s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── CARD ─────────────────────────────────────────────────── */
.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: background .25s, box-shadow .25s;
}

.card:hover {
  box-shadow: 0 16px 44px rgba(0, 47, 95, .16);
}

.card__head {
  margin-bottom: 16px;
}

.card__title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  color: var(--navy);
}

.card__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

html[data-theme="dark"] .card {
  background: var(--card);
  border-color: var(--border);
}

html[data-theme="dark"] .card__title {
  color: #c8dbf0;
}

/* ── FIELDS ───────────────────────────────────────────────── */
.field {
  display: block;
  margin-top: 14px;
  text-align: left;
}

.field__label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.field__hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}

/* ── Inline field validation error ── */
.field__error {
  display: block;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  margin-top: 5px;
  padding-left: 2px;
  animation: fadeUp .18s ease;
}

.input[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

/* ── INPUT ────────────────────────────────────────────────── */
.input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px 13px 40px;
  font-size: 16px;
  /* 16px prevents iOS zoom */
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus {
  border-color: var(--navy);
  box-shadow: var(--focus);
}

.input--center {
  text-align: center;
  letter-spacing: 6px;
  font-size: 22px;
  padding-left: 14px;
}

html[data-theme="dark"] .input {
  background: rgba(255, 255, 255, .05);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .input:focus {
  border-color: rgba(200, 219, 240, .4);
}

html[data-theme="dark"] .input::placeholder {
  color: rgba(143, 168, 194, .5);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  width: 100%;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 800;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background .18s, transform .12s, box-shadow .18s, opacity .18s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
}

.btn:active {
  transform: translateY(1px) scale(.99);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
}

.btn--primary {
  background: var(--navy);
  color: #fff;
}

.btn--primary:hover {
  background: var(--navy-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 47, 95, .28);
}

.btn--gold {
  background: var(--gold);
  color: #fff;
}

.btn--gold:hover {
  background: var(--gold-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(201, 162, 77, .32);
}

.btn--whatsapp {
  background: var(--wa);
  color: #fff;
}

.btn--whatsapp:hover {
  filter: brightness(.94);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border-color: rgba(0, 47, 95, .4);
  color: var(--navy);
}

.btn--outline:hover {
  background: rgba(0, 47, 95, .05);
}

.btn--outline-gold {
  background: transparent;
  border-color: rgba(201, 162, 77, .55);
  color: var(--gold);
}

.btn--outline-gold:hover {
  background: rgba(201, 162, 77, .08);
}

.btn--ghost {
  background: transparent;
  border: 1.5px dashed rgba(0, 47, 95, .3);
  color: var(--muted);
}

.btn--ghost:hover {
  background: rgba(0, 47, 95, .04);
  color: var(--navy);
}

.btn--text {
  background: transparent;
  color: var(--muted);
  padding: 10px 0;
  border: none;
}

.btn--text:hover {
  color: var(--navy);
  text-decoration: underline;
}

html[data-theme="dark"] .btn--outline {
  border-color: rgba(255, 255, 255, .22);
  color: var(--text);
}

html[data-theme="dark"] .btn--outline-gold {
  border-color: rgba(201, 162, 77, .4);
  color: var(--gold);
}

html[data-theme="dark"] .btn--ghost {
  border-color: rgba(255, 255, 255, .20);
  color: var(--muted);
}

html[data-theme="dark"] .btn--text {
  color: var(--muted);
}

html[data-theme="dark"] .btn--text:hover {
  color: var(--text);
}

/* Ripple */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple .62s ease-out forwards;
  pointer-events: none;
  background: rgba(255, 255, 255, .45);
}

@keyframes ripple {
  to {
    transform: scale(4.5);
    opacity: 0;
  }
}

/* ── STACK ────────────────────────────────────────────────── */
.stack {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.row {
  display: flex;
  gap: 10px;
}

.row .btn {
  flex: 1;
}

/* ── PROFILE ──────────────────────────────────────────────── */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  text-align: center;
}

.profile__avatar {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(0, 47, 95, .07);
  display: grid;
  place-items: center;
  color: var(--navy);
  font-size: 24px;
}

.profile__name {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
}

html[data-theme="dark"] .profile__avatar {
  background: rgba(200, 219, 240, .10);
  color: #a8c8e8;
}

/* ── BADGE ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .4px;
  background: var(--navy);
  color: #fff;
  border: none;
}

/* ── CODE INLINE ──────────────────────────────────────────── */
.codeInline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 47, 95, .03);
  width: 100%;
  max-width: 340px;
}

.codeInline__value {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .6px;
  color: var(--navy);
}

.mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
}

html[data-theme="dark"] .codeInline {
  background: rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .codeInline__value {
  color: #90c8f0;
}

/* ── COURSES ──────────────────────────────────────────────── */
.courses {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--card), rgba(0, 47, 95, .02));
  text-align: left;
}

.courses__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.courses__title {
  font-weight: 800;
  font-size: 13px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
}

.courses__meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.courses__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.courseItem {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 47, 95, .03);
  border: 1px solid rgba(0, 47, 95, .07);
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}

.courseItem.muted {
  color: var(--muted);
  text-align: center;
  background: transparent;
  border-style: dashed;
}

html[data-theme="dark"] .courses {
  background: rgba(255, 255, 255, .03);
}

html[data-theme="dark"] .courses__title {
  color: #90c8f0;
}

html[data-theme="dark"] .courseItem {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .08);
}

/* ── GIFT BOX ─────────────────────────────────────────────── */
.gift {
  margin-top: 14px;
  border: 1.5px solid rgba(201, 162, 77, .45);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(201, 162, 77, .08), transparent 70%);
  padding: 16px;
}

.gift__title {
  font-weight: 800;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.gift__sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.coupon {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 2px dashed rgba(0, 0, 0, .18);
  background: rgba(255, 255, 255, .7);
  font-weight: 900;
  text-align: center;
  letter-spacing: 1.5px;
  font-size: 17px;
  color: var(--navy);
}

html[data-theme="dark"] .coupon {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .20);
  color: #90c8f0;
}

/* ── CALLOUT ──────────────────────────────────────────────── */
.callout {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(0, 47, 95, .03);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  font-size: 14px;
  line-height: 1.6;
}

.callout--ok {
  border-left-color: var(--ok);
}

.callout--bad {
  border-left-color: var(--bad);
}

.adminLink {
  display: inline-block;
  margin-top: 10px;
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

.adminLink:hover {
  text-decoration: underline;
}

html[data-theme="dark"] .callout {
  background: rgba(255, 255, 255, .04);
  border-color: var(--border);
}

/* ── TOAST ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  /* pushed up for FAB */
  transform: translateX(-50%);
  background: rgba(15, 23, 42, .92);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .20);
  z-index: 100;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  text-overflow: ellipsis;
  overflow: hidden;
}

.toast--success {
  background: rgba(22, 163, 74, .90);
}

.toast--error {
  background: rgba(185, 28, 28, .90);
}

.toast--info {
  background: rgba(15, 23, 42, .90);
}

/* ── OVERLAY & SPINNER ────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .25);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 50;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(0, 47, 95, .20);
  border-top-color: var(--navy);
  animation: spin .85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

html[data-theme="dark"] .overlay {
  background: rgba(0, 0, 0, .45);
}

html[data-theme="dark"] .spinner {
  border-color: rgba(200, 219, 240, .15);
  border-top-color: #90c8f0;
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, .80);
  font-size: 12px;
  flex-shrink: 0;
  padding: 0;
}

.footer-top {
  display: flex;
  justify-content: center;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}

.dot {
  opacity: .5;
}

/* ── AMBIENT GRADIENT ─────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(800px 500px at 10% 8%, rgba(201, 162, 77, .08), transparent 55%),
    radial-gradient(900px 600px at 90% 15%, rgba(0, 47, 95, .09), transparent 55%);
  pointer-events: none;
  z-index: -1;
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(700px 400px at 10% 8%, rgba(201, 162, 77, .05), transparent 55%),
    radial-gradient(800px 500px at 90% 15%, rgba(0, 64, 128, .12), transparent 55%);
}

/* ── ADMIN TAB HIDDEN ─────────────────────────────────────── */
.tab.is-hidden {
  display: none !important;
}

/* ── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }

  .btn .ripple {
    display: none;
  }
}

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 420px) {
  .header {
    padding: 12px 14px;
  }

  .brand__logo {
    width: 48px;
    height: 48px;
  }

  .card {
    padding: 18px;
  }

  .btn {
    font-size: 14px;
  }

  .row {
    flex-direction: column;
  }

  .tab span {
    font-size: 12px;
  }
}

/* ── SAFARI SPECIFIC ──────────────────────────────────────── */
@supports (-webkit-touch-callout: none) {
  .app {
    min-height: -webkit-fill-available;
  }
}

/* ═══════════════════════════════════════════════════════════
   V12 ADDITIONS
   ═══════════════════════════════════════════════════════════ */

/* ── WHATSAPP FAB ─────────────────────────────────────────── */
/* ✅ Safari Fix: NO ::before/::after on <a> — use child spans instead */
#waSupport {
  position: fixed;
  bottom: 22px;
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 6px 22px rgba(37, 211, 102, .45);
  z-index: 200;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
  /* Needed so child pulse ring stays inside stacking context */
  isolation: isolate;
}

#waSupport:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, .55);
}

#waSupport:active {
  transform: scale(.96);
}

/* Pulse ring — separate <span class="wa-pulse"> in HTML, not ::after */
.wa-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #25D366;
  pointer-events: none;
  animation: waPulse 2.2s ease-out infinite;
}

@keyframes waPulse {
  0% {
    transform: scale(1);
    opacity: .7;
  }

  70% {
    transform: scale(1.5);
    opacity: 0;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Tooltip — separate <span class="wa-tip"> in HTML, not ::before */
.wa-tip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, .88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  font-family: Inter, sans-serif;
  /* Hidden on touch devices */
}

#waSupport:hover .wa-tip {
  opacity: 1;
}

/* Safari: hide tooltip on touch (it persists after tap) */
@media (hover: none) {
  .wa-tip {
    display: none;
  }
}

/* ── PENDING FOLDER NOTICE ────────────────────────────────── */
.callout--pending {
  border-left-color: var(--gold);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout--pending i {
  color: var(--gold);
  flex-shrink: 0;
}

/* ── ADMIN RESULT TABLE ────────────────────────────────────── */
#adminResult table td:first-child {
  min-width: 88px;
}

/* ── DIGITAL CARD MODAL ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Safari: no inset shorthand */
  background: rgba(10, 20, 40, .70);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 20px;
  /* Safari Fix: opacity transition instead of animation on display toggle */
  opacity: 0;
  -webkit-transition: opacity .22s ease;
  transition: opacity .22s ease;
  pointer-events: none;
}

/* Shown state — triggered by JS adding .modal-visible */
.modal-overlay.modal-visible {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  /* Safari Fix: translateY transition instead of animation */
  -webkit-transform: translateY(24px);
  transform: translateY(24px);
  -webkit-transition: -webkit-transform .25s ease, opacity .25s ease;
  transition: transform .25s ease, opacity .25s ease;
  opacity: 0;
  will-change: transform, opacity;
}

.modal-overlay.modal-visible .modal-box {
  -webkit-transform: translateY(0);
  transform: translateY(0);
  opacity: 1;
}

.modal-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 47, 95, .07);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: background .15s;
}

.modal-close:hover {
  background: rgba(0, 47, 95, .12);
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Canvas preview wrapper */
#cardPreviewWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .04);
}

#cardPreviewWrap canvas {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

#cardCanvas {
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .20);
}

/* QR Modal inner */
.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.qr-member-info {
  text-align: center;
  margin-bottom: 4px;
}

.qr-member-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}

.qr-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-bg, rgba(0, 47, 95, 0.08));
  color: var(--accent-color, #002f5f);
  border: 1.5px solid var(--accent-color, #002f5f);
}

.qr-container {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 3px solid var(--accent-color, #002f5f);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .08), inset 0 0 0 1px rgba(255, 255, 255, .5);
}

#qrCanvas {
  border-radius: 10px;
  background: #fff;
  display: block;
}

.qr-code-text {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  font-family: ui-monospace, 'SF Mono', monospace;
  letter-spacing: 1px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   SOCIAL MEDIA ICONS
   ═══════════════════════════════════════════════════════════ */
.social-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, filter .18s;
  -webkit-tap-highlight-color: transparent;
}

.social-link:hover {
  transform: translateY(-3px) scale(1.1);
  filter: brightness(1.15);
}

.social-link:active {
  transform: scale(.95);
}

.social-link--instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
  box-shadow: 0 4px 14px rgba(214, 36, 159, .4);
}

.social-link--linkedin {
  background: #0a66c2;
  box-shadow: 0 4px 14px rgba(10, 102, 194, .4);
}

.social-link--facebook {
  background: #1877f2;
  box-shadow: 0 4px 14px rgba(24, 119, 242, .4);
}

.social-link--whatsapp {
  background: #25d366;
  box-shadow: 0 4px 14px rgba(37, 211, 102, .4);
}

/* ═══════════════════════════════════════════════════════════
   TIERS SHOWCASE
   ═══════════════════════════════════════════════════════════ */
.tiers-showcase {
  width: 100%;
  max-width: 460px;
  margin: 18px auto 24px;
  padding: 0;
  animation: fadeUp .3s ease;
}

.tiers-header {
  text-align: center;
  margin-bottom: 18px;
}

.tiers-heading {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

html[data-theme="dark"] .tiers-heading {
  color: #c8dbf0;
}

.tiers-sub {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.tiers-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-bottom: 4px;
}

@media (max-width: 700px) {
  .tiers-track {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 380px) {
  .tiers-track {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

/* Individual tier card */
.tier-card {
  position: relative;
  border-radius: 16px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  border: 1.5px solid transparent;
  transition: transform .22s, box-shadow .22s;
  cursor: default;
  animation: tierAppear .4s ease both;
}

.tier-card:nth-child(1) {
  animation-delay: .05s;
}

.tier-card:nth-child(2) {
  animation-delay: .12s;
}

.tier-card:nth-child(3) {
  animation-delay: .19s;
}

.tier-card:nth-child(4) {
  animation-delay: .26s;
}

@keyframes tierAppear {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tier-card:hover {
  transform: translateY(-4px);
}

/* Glowing blob behind each card */
.tier-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  pointer-events: none;
  opacity: .18;
  filter: blur(22px);
}

/* Platinum */
.tier-card--platinum {
  background: linear-gradient(145deg, #1a0040, #2d0860);
  border-color: rgba(168, 85, 247, .45);
  box-shadow: 0 8px 28px rgba(124, 58, 237, .22);
}

.tier-card--platinum .tier-glow {
  background: #a855f7;
}

.tier-card--platinum:hover {
  box-shadow: 0 16px 40px rgba(124, 58, 237, .38);
  border-color: rgba(168, 85, 247, .7);
}

.tier-card--platinum .tier-icon {
  font-size: 28px;
}

.tier-card--platinum .tier-name {
  color: #c084fc;
}

.tier-card--platinum .tier-req {
  color: rgba(192, 132, 252, .7);
}

.tier-card--platinum .tier-perks li {
  color: rgba(255, 255, 255, .85);
}

.tier-card--platinum .tier-perks li i {
  color: #a855f7;
}

/* Gold */
.tier-card--gold {
  background: linear-gradient(145deg, #1a0f00, #3d2800);
  border-color: rgba(201, 162, 77, .45);
  box-shadow: 0 8px 28px rgba(201, 162, 77, .18);
}

.tier-card--gold .tier-glow {
  background: var(--gold);
}

.tier-card--gold:hover {
  box-shadow: 0 16px 40px rgba(201, 162, 77, .35);
  border-color: rgba(201, 162, 77, .7);
}

.tier-card--gold .tier-icon {
  font-size: 28px;
}

.tier-card--gold .tier-name {
  color: #e8c97a;
}

.tier-card--gold .tier-req {
  color: rgba(232, 201, 122, .7);
}

.tier-card--gold .tier-perks li {
  color: rgba(255, 255, 255, .85);
}

.tier-card--gold .tier-perks li i {
  color: var(--gold);
}

/* Silver */
.tier-card--silver {
  background: linear-gradient(145deg, #111820, #1e2a38);
  border-color: rgba(160, 176, 188, .35);
  box-shadow: 0 8px 24px rgba(160, 176, 188, .12);
}

.tier-card--silver .tier-glow {
  background: #a0b0bc;
}

.tier-card--silver:hover {
  box-shadow: 0 14px 36px rgba(160, 176, 188, .25);
  border-color: rgba(160, 176, 188, .6);
}

.tier-card--silver .tier-icon {
  font-size: 28px;
}

.tier-card--silver .tier-name {
  color: #c8d8e4;
}

.tier-card--silver .tier-req {
  color: rgba(200, 216, 228, .65);
}

.tier-card--silver .tier-perks li {
  color: rgba(255, 255, 255, .8);
}

.tier-card--silver .tier-perks li i {
  color: #a0b0bc;
}

/* Standard */
.tier-card--standard {
  background: linear-gradient(145deg, #001530, #003060);
  border-color: rgba(0, 100, 180, .4);
  box-shadow: 0 8px 24px rgba(0, 47, 95, .18);
}

.tier-card--standard .tier-glow {
  background: #0064b4;
}

.tier-card--standard:hover {
  box-shadow: 0 14px 36px rgba(0, 47, 95, .28);
  border-color: rgba(0, 130, 220, .5);
}

.tier-card--standard .tier-icon {
  font-size: 28px;
}

.tier-card--standard .tier-name {
  color: #90c8f0;
}

.tier-card--standard .tier-req {
  color: rgba(144, 200, 240, .7);
}

.tier-card--standard .tier-perks li {
  color: rgba(255, 255, 255, .8);
}

.tier-card--standard .tier-perks li i {
  color: #60a8e0;
}

/* Card shared text styles */
.tier-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .2px;
}

.tier-req {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tier-perks {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.tier-perks li {
  font-size: 11px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.tier-perks li i {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 10px;
}

.tier-exclusive {
  margin-top: 8px;
  background: rgba(168, 85, 247, .18);
  border: 1px solid rgba(168, 85, 247, .4);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #c084fc;
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  animation: exclusivePulse 2.8s ease-in-out infinite;
}

@keyframes exclusivePulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }

  50% {
    box-shadow: 0 0 12px 2px rgba(168, 85, 247, .3);
  }
}

.tiers-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ═══════════════════════════════════════════════════════════
   MEMBER BENEFITS BOX (shown after login)
   ═══════════════════════════════════════════════════════════ */
.member-benefits {
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid;
  animation: fadeUp .25s ease;
}

/* tier color variants — applied via JS class */
.member-benefits.benefits--platinum {
  border-color: rgba(168, 85, 247, .5);
  background: linear-gradient(135deg, rgba(124, 58, 237, .12), rgba(168, 85, 247, .05));
}

.member-benefits.benefits--gold {
  border-color: rgba(201, 162, 77, .5);
  background: linear-gradient(135deg, rgba(201, 162, 77, .12), rgba(201, 162, 77, .04));
}

.member-benefits.benefits--silver {
  border-color: rgba(160, 176, 188, .45);
  background: linear-gradient(135deg, rgba(127, 140, 154, .1), rgba(160, 176, 188, .04));
}

.member-benefits.benefits--standard {
  border-color: rgba(0, 100, 180, .35);
  background: linear-gradient(135deg, rgba(0, 47, 95, .09), rgba(0, 47, 95, .03));
}

.benefits-header {
  padding: 10px 14px 8px;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.benefits--platinum .benefits-header {
  color: #a855f7;
}

.benefits--gold .benefits-header {
  color: var(--gold);
}

.benefits--silver .benefits-header {
  color: #a0b0bc;
}

.benefits--standard .benefits-header {
  color: var(--navy);
}

html[data-theme="dark"] .benefits--standard .benefits-header {
  color: #90c8f0;
}

.benefits-list {
  margin: 0;
  padding: 0 14px 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.benefits-list li {
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
}

.benefits-list li i {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 12px;
}

.benefits--platinum .benefits-list li i {
  color: #a855f7;
}

.benefits--gold .benefits-list li i {
  color: var(--gold);
}

.benefits--silver .benefits-list li i {
  color: #a0b0bc;
}

.benefits--standard .benefits-list li i {
  color: var(--navy);
}

html[data-theme="dark"] .benefits--standard .benefits-list li i {
  color: #60a8e0;
}

/* ═══════════════════════════════════════════════════════════
   3D FLIP CARD TIERS
   ═══════════════════════════════════════════════════════════ */

/* Override grid for 3-column flip layout */
.tiers-showcase .flip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 4px;
}

@media (max-width: 700px) {
  .tiers-showcase .flip-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 360px) {
  .tiers-showcase .flip-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Flip card container */
.flip-card {
  perspective: 1000px;
  height: 210px;
  cursor: pointer;
}

@media (max-width: 700px) {
  .flip-card {
    height: 190px;
  }
}

@media (max-width: 360px) {
  .flip-card {
    height: 180px;
  }
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(.4, 0, .2, 1);
}

/* Hover to flip — desktop */
.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner {
  transform: rotateY(180deg);
}

/* Touch tap to flip — JS adds .is-flipped */
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 12px;
  border: 1.5px solid transparent;
  text-align: center;
}

.flip-card-back {
  transform: rotateY(180deg);
  align-items: flex-start;
  text-align: left;
  justify-content: flex-start;
  gap: 0;
  padding: 10px 10px;
  overflow: hidden;
}

/* ── FRONT faces ── */
.flip-card-front .flip-emoji {
  font-size: 40px;
  line-height: 1;
}

.flip-card-front .flip-tier-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .2px;
}

.flip-card-front .flip-tier-req {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: .75;
}

.flip-card-front .flip-hint {
  font-size: 11px;
  font-weight: 600;
  opacity: .45;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* ── BACK faces ── */
.flip-back-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.2;
  white-space: nowrap;
}

.flip-perks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  overflow: hidden;
}

.flip-perks li {
  font-size: 11px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 5px;
}

.flip-perks li i {
  flex-shrink: 0;
  font-size: 10px;
}

.flip-perks li strong {
  white-space: nowrap;
}

/* ── Gold ── */
.flip-front--gold {
  background: linear-gradient(145deg, #1a0f00, #3d2800);
  border-color: rgba(201, 162, 77, .5);
  color: #e8c97a;
  box-shadow: 0 8px 28px rgba(201, 162, 77, .18);
}

.flip-back--gold {
  background: linear-gradient(145deg, #2a1e06, #4a3210);
  border-color: rgba(201, 162, 77, .55);
  color: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 28px rgba(201, 162, 77, .22);
}

.flip-back--gold .flip-back-title {
  color: #e8c97a;
}

.flip-back--gold .flip-perks li i {
  color: var(--gold);
}

/* ── Silver ── */
.flip-front--silver {
  background: linear-gradient(145deg, #111820, #1e2a38);
  border-color: rgba(160, 176, 188, .4);
  color: #c8d8e4;
  box-shadow: 0 8px 24px rgba(160, 176, 188, .12);
}

.flip-back--silver {
  background: linear-gradient(145deg, #1a2430, #263444);
  border-color: rgba(160, 176, 188, .45);
  color: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 24px rgba(160, 176, 188, .16);
}

.flip-back--silver .flip-back-title {
  color: #c8d8e4;
}

.flip-back--silver .flip-perks li i {
  color: #a0b0bc;
}

/* ── Standard ── */
.flip-front--standard {
  background: linear-gradient(145deg, #001530, #003060);
  border-color: rgba(0, 100, 180, .45);
  color: #90c8f0;
  box-shadow: 0 8px 24px rgba(0, 47, 95, .18);
}

.flip-back--standard {
  background: linear-gradient(145deg, #001f45, #003878);
  border-color: rgba(0, 130, 220, .45);
  color: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 24px rgba(0, 47, 95, .22);
}

.flip-back--standard .flip-back-title {
  color: #90c8f0;
}

.flip-back--standard .flip-perks li i {
  color: #60a8e0;
}

/* ── FOOTER AUTHOR LINK ── */
.footer-author {
  color: rgba(255, 255, 255, .9);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .18s;
}

.footer-author:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-author i {
  font-size: 14px;
  color: #0a66c2;
  transition: transform .18s;
}

.footer-author:hover i {
  transform: scale(1.15);
}

/* ── SOCIAL ICONS — smaller to fit 7 icons in one row ── */
.social-link {
  width: 36px !important;
  height: 36px !important;
  font-size: 15px !important;
}

.social-links {
  gap: 7px !important;
  flex-wrap: wrap;
  justify-content: center;
}

/* X / Twitter */
.social-link--x {
  background: #2d2d2d;
  box-shadow: 0 4px 14px rgba(100, 100, 100, .4);
  border: 2px solid rgba(255, 255, 255, .4);
}

/* TikTok */
.social-link--tiktok {
  background: linear-gradient(135deg, #010101 0%, #69C9D0 50%, #EE1D52 100%);
  box-shadow: 0 4px 14px rgba(238, 29, 82, .3);
}

/* Linktree */
.social-link--linktree {
  background: #43e660;
  color: #000 !important;
  box-shadow: 0 4px 14px rgba(67, 230, 96, .35);
}

/* ═══════════════════════════════════════════════════════════
   🚀 LAUNCH-DAY ENHANCEMENTS — Animations & UX Polish
   ═══════════════════════════════════════════════════════════ */

/* ── ANIMATED GRADIENT HEADER BORDER ─────────────────────── */
.header {
  border-bottom: 4px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 4px;
  background: linear-gradient(90deg,
    var(--navy), #0077cc, var(--gold), #e8c97a, var(--navy));
  background-size: 300% 100%;
  animation: headerShimmer 4s ease-in-out infinite;
}

@keyframes headerShimmer {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ── FLOATING AMBIENT PARTICLES ──────────────────────────── */
.main { position: relative; overflow: hidden; }

.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0%   { transform: translateY(0) translateX(0) scale(0); opacity: 0; }
  10%  { opacity: .45; transform: scale(1); }
  90%  { opacity: .25; }
  100% { transform: translateY(-110vh) translateX(40px) scale(.3); opacity: 0; }
}

/* ── BUTTON HOVER GLOW ───────────────────────────────────── */
.btn--primary:hover {
  box-shadow: 0 8px 25px rgba(0, 47, 95, .35), 0 0 20px rgba(0, 100, 200, .15);
}

.btn--gold:hover {
  box-shadow: 0 8px 25px rgba(201, 162, 77, .40), 0 0 20px rgba(201, 162, 77, .18);
}

.btn--whatsapp:hover {
  box-shadow: 0 8px 20px rgba(37, 211, 102, .35), 0 0 15px rgba(37, 211, 102, .12);
}

.btn--outline:hover {
  box-shadow: 0 4px 15px rgba(0, 47, 95, .12);
  transform: translateY(-1px);
}

/* ── INPUT FOCUS SHINE ───────────────────────────────────── */
.input {
  position: relative;
  background-image: linear-gradient(120deg, transparent 0%, transparent 40%, rgba(0, 100, 200, .06) 50%, transparent 60%, transparent 100%);
  background-size: 250% 100%;
  background-position: 100% 0;
}

.input:focus {
  background-position: 0 0;
  transition: border-color .18s, box-shadow .18s, background-position .6s ease;
}

/* ── STAGGERED ENTRANCE ANIMATIONS ───────────────────────── */
.stagger-in { animation: staggerFadeIn .4s ease both; }
.stagger-in:nth-child(1) { animation-delay: .05s; }
.stagger-in:nth-child(2) { animation-delay: .10s; }
.stagger-in:nth-child(3) { animation-delay: .18s; }
.stagger-in:nth-child(4) { animation-delay: .25s; }
.stagger-in:nth-child(5) { animation-delay: .32s; }
.stagger-in:nth-child(6) { animation-delay: .39s; }
.stagger-in:nth-child(7) { animation-delay: .45s; }
.stagger-in:nth-child(8) { animation-delay: .50s; }

@keyframes staggerFadeIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── PROFILE AVATAR BREATHING ────────────────────────────── */
.profile__avatar {
  animation: avatarBreathe 3s ease-in-out infinite;
  transition: box-shadow .3s, transform .3s;
}

.profile__avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(0, 47, 95, .15);
}

@keyframes avatarBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 47, 95, .08); }
  50%      { box-shadow: 0 0 0 8px rgba(0, 47, 95, .04); }
}

html[data-theme="dark"] .profile__avatar {
  animation-name: avatarBreatheDark;
}

@keyframes avatarBreatheDark {
  0%, 100% { box-shadow: 0 0 0 0 rgba(144, 200, 240, .10); }
  50%      { box-shadow: 0 0 0 8px rgba(144, 200, 240, .05); }
}

/* ── BADGE TIER SHINE ────────────────────────────────────── */
.badge {
  position: relative;
  overflow: hidden;
}

.badge::after {
  content: "";
  position: absolute;
  top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  animation: badgeShine 3.5s ease-in-out infinite;
}

@keyframes badgeShine {
  0%, 75%  { left: -100%; }
  100%     { left: 200%; }
}

/* ── TOAST SLIDE ANIMATION ───────────────────────────────── */
.toast {
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s ease;
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
}

.toast.toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── TIER PROGRESS BAR ───────────────────────────────────── */
.tier-progress {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--card);
  animation: staggerFadeIn .5s ease both;
  animation-delay: .15s;
}

.tier-progress__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.tier-progress__label span:last-child {
  font-size: 11px;
  opacity: .8;
}

.tier-progress__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 47, 95, .08);
  overflow: hidden;
  position: relative;
}

html[data-theme="dark"] .tier-progress__bar {
  background: rgba(255, 255, 255, .08);
}

.tier-progress__fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 1.2s cubic-bezier(.25, .8, .25, 1);
  position: relative;
  overflow: hidden;
}

.tier-progress__fill::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.tier-progress__fill--gold {
  background: linear-gradient(90deg, #c9a24d, #e8c97a);
}

.tier-progress__fill--silver {
  background: linear-gradient(90deg, #7f8c9a, #a0b0bc);
}

.tier-progress__fill--standard {
  background: linear-gradient(90deg, var(--navy), #0077cc);
}

.tier-progress__fill--platinum {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

.tier-progress__fill--max {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.tier-progress__next {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tier-progress__next .emoji {
  font-size: 16px;
}

/* ── CONFETTI ────────────────────────────────────────────── */
#confetti-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  opacity: 0;
  animation: confettiFall var(--fall-duration, 2.5s) ease-in forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(105vh) rotate(var(--rotation, 720deg)) scale(.3); }
}

/* ── FLIP CARD GLOW ON HOVER ─────────────────────────────── */
.flip-card {
  transition: filter .3s ease;
}

.flip-front--gold:hover,
.flip-card:hover .flip-front--gold {
  box-shadow: 0 8px 35px rgba(201, 162, 77, .35), 0 0 25px rgba(201, 162, 77, .12);
}

.flip-front--silver:hover,
.flip-card:hover .flip-front--silver {
  box-shadow: 0 8px 30px rgba(160, 176, 188, .30), 0 0 20px rgba(160, 176, 188, .10);
}

.flip-front--standard:hover,
.flip-card:hover .flip-front--standard {
  box-shadow: 0 8px 30px rgba(0, 47, 95, .30), 0 0 20px rgba(0, 100, 200, .10);
}

/* ── COURSE ITEM HOVER ───────────────────────────────────── */
.courseItem {
  transition: transform .18s, box-shadow .18s, background .18s;
  cursor: default;
}

.courseItem:not(.muted):hover {
  transform: translateX(4px);
  box-shadow: 0 2px 10px rgba(0, 47, 95, .08);
  background: rgba(0, 47, 95, .06);
}

html[data-theme="dark"] .courseItem:not(.muted):hover {
  background: rgba(255, 255, 255, .06);
}

/* ── SKELETON LOADING ────────────────────────────────────── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(0, 47, 95, .06);
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  transform: translateX(-100%);
}

@keyframes skeletonShimmer {
  100% { transform: translateX(100%); }
}

html[data-theme="dark"] .skeleton {
  background: rgba(255, 255, 255, .06);
}

html[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
}

/* ── CARD ENTRANCE BOUNCE ────────────────────────────────── */
.card {
  animation: cardEntrance .45s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── SOCIAL LINK BOUNCE ON HOVER ─────────────────────────── */
.social-link:hover {
  animation: socialBounce .4s ease;
}

@keyframes socialBounce {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-6px) scale(1.12); }
  60%  { transform: translateY(-2px) scale(1.08); }
  100% { transform: translateY(-3px) scale(1.1); }
}

/* ── WHATSAPP FAB ENHANCED ───────────────────────────────── */
#waSupport {
  animation: fabEntrance .5s cubic-bezier(.34, 1.56, .64, 1) both;
  animation-delay: .8s;
}

@keyframes fabEntrance {
  from { opacity: 0; transform: scale(0) rotate(-45deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ── TIERS SHOWCASE ENTRANCE ─────────────────────────────── */
.tiers-showcase {
  animation: tiersEntrance .5s ease both;
  animation-delay: .15s;
}

@keyframes tiersEntrance {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flip-card:nth-child(1) { animation: flipCardEntrance .4s ease both; animation-delay: .25s; }
.flip-card:nth-child(2) { animation: flipCardEntrance .4s ease both; animation-delay: .35s; }
.flip-card:nth-child(3) { animation: flipCardEntrance .4s ease both; animation-delay: .45s; }

@keyframes flipCardEntrance {
  from { opacity: 0; transform: translateY(20px) rotateX(8deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0deg); }
}

/* ── SMOOTH NUMBER COUNTER ───────────────────────────────── */
.counter-animate {
  display: inline-block;
  transition: transform .3s ease;
}

.counter-animate.counting {
  animation: counterPop .3s ease;
}

@keyframes counterPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── BRAND LOGO HOVER ────────────────────────────────────── */
.brand__logo {
  transition: transform .3s ease, filter .3s ease;
}

.brand:hover .brand__logo {
  transform: rotate(-5deg) scale(1.05);
  filter: brightness(1.1);
}

/* ── ICON BUTTON THEME TOGGLE SPIN ───────────────────────── */
#themeToggle:active i {
  animation: themeSpin .4s ease;
}

@keyframes themeSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   📋 REGISTRATION FORM WIZARD
   ═══════════════════════════════════════════════════════════ */

/* ── WIZARD PROGRESS BAR ─────────────────────────────────── */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  margin: 14px 0 4px;
  position: relative;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.wz-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  background: var(--border);
  color: var(--muted);
  transition: all .3s ease;
  border: 2px solid var(--border);
}

.wz-label {
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  transition: color .3s;
  text-align: center;
}

.wizard-step.is-active .wz-num {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 2px 10px rgba(0, 47, 95, .25);
}

html[data-theme="dark"] .wizard-step.is-active .wz-num {
  background: #0077cc;
  border-color: #0077cc;
}

.wizard-step.is-active .wz-label { color: var(--navy); }
html[data-theme="dark"] .wizard-step.is-active .wz-label { color: #60a8e0; }

.wizard-step.is-done .wz-num {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.wizard-step.is-done .wz-label { color: #16a34a; }

.wizard-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 0 8px 16px;
  overflow: hidden;
}

.wizard-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--navy), #0077cc);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

html[data-theme="dark"] .wizard-bar-fill {
  background: linear-gradient(90deg, #0077cc, #60a8e0);
}

/* ── WIZARD PAGES ────────────────────────────────────────── */
.wizard-page {
  animation: wizardSlideIn .35s ease both;
}

@keyframes wizardSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wizard-nav {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.wizard-nav--split { justify-content: space-between; }

/* ── CUSTOM RADIO ────────────────────────────────────────── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.radio-group--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .18s;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
}

.radio-item:hover {
  border-color: var(--navy);
  background: rgba(0, 47, 95, .03);
}

html[data-theme="dark"] .radio-item:hover {
  border-color: #0077cc;
  background: rgba(0, 119, 204, .06);
}

.radio-item input[type="radio"] { display: none; }

.radio-mark {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: all .18s;
}

.radio-item input[type="radio"]:checked ~ .radio-mark {
  border-color: var(--navy);
}

.radio-item input[type="radio"]:checked ~ .radio-mark::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--navy);
}

html[data-theme="dark"] .radio-item input[type="radio"]:checked ~ .radio-mark {
  border-color: #0077cc;
}

html[data-theme="dark"] .radio-item input[type="radio"]:checked ~ .radio-mark::after {
  background: #0077cc;
}

.radio-group--inline .radio-item {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* ── CUSTOM CHECKBOX ─────────────────────────────────────── */
.check-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .18s;
  font-size: 12.5px;
  color: var(--text);
  background: var(--card);
}

.check-item:hover {
  border-color: var(--navy);
  background: rgba(0, 47, 95, .03);
}

html[data-theme="dark"] .check-item:hover {
  border-color: #0077cc;
  background: rgba(0, 119, 204, .06);
}

.check-item input[type="checkbox"] { display: none; }

.check-mark {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .18s;
  font-size: 11px;
  color: transparent;
}

.check-item input[type="checkbox"]:checked ~ .check-mark {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.check-item input[type="checkbox"]:checked ~ .check-mark::after {
  content: "✓";
  font-weight: 800;
}

html[data-theme="dark"] .check-item input[type="checkbox"]:checked ~ .check-mark {
  border-color: #0077cc;
  background: #0077cc;
}

.check-item input[type="checkbox"]:checked ~ .check-label {
  font-weight: 700;
}

/* ── COURSE SECTIONS ─────────────────────────────────────── */
.course-section {
  margin-bottom: 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.course-section__title {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  background: rgba(0, 47, 95, .04);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .course-section__title {
  color: #60a8e0;
  background: rgba(0, 119, 204, .06);
}

.course-section .check-grid {
  padding: 8px;
  gap: 4px;
}

.course-section .check-item {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
}

.course-section .check-item:hover {
  background: rgba(0, 47, 95, .05);
}

/* ── FILE UPLOAD ZONE ────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  position: relative;
}

.upload-zone i {
  font-size: 32px;
  color: var(--navy);
  opacity: .5;
  transition: opacity .18s;
}

html[data-theme="dark"] .upload-zone i { color: #60a8e0; }

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--navy);
  background: rgba(0, 47, 95, .03);
}

html[data-theme="dark"] .upload-zone:hover,
html[data-theme="dark"] .upload-zone.drag-over {
  border-color: #0077cc;
  background: rgba(0, 119, 204, .04);
}

.upload-zone:hover i, .upload-zone.drag-over i { opacity: 1; }

.upload-zone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.upload-preview {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  animation: staggerFadeIn .3s ease both;
}

.upload-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.upload-preview__pdf {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(239, 68, 68, .08);
  color: #ef4444;
  font-size: 24px;
}

.upload-preview__remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s;
}

.upload-preview__remove:hover { background: #ef4444; }

.field__hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* ── REVIEW SUMMARY ──────────────────────────────────────── */
.review-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-block {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.review-block__head {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  background: rgba(0, 47, 95, .04);
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .review-block__head {
  color: #60a8e0;
  background: rgba(0, 119, 204, .06);
}

.review-block__body {
  padding: 10px 14px;
}

.review-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(0,0,0,.04);
}

html[data-theme="dark"] .review-row {
  border-bottom-color: rgba(255,255,255,.04);
}

.review-row:last-child { border-bottom: none; }

.review-row__label {
  color: var(--muted);
  font-weight: 600;
}

.review-row__value {
  font-weight: 700;
  text-align: right;
  color: var(--text);
  max-width: 60%;
  word-break: break-word;
}

.review-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: flex-end;
  max-width: 100%;
  margin-top: 4px;
}

.review-chip {
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 47, 95, .08);
  color: var(--navy);
}

html[data-theme="dark"] .review-chip {
  background: rgba(0, 119, 204, .12);
  color: #60a8e0;
}

/* ── SUCCESS STATE ───────────────────────────────────────── */
.reg-success {
  text-align: center;
  padding: 30px 20px;
  animation: staggerFadeIn .5s ease both;
}

.reg-success__icon {
  font-size: 56px;
  color: #16a34a;
  margin-bottom: 14px;
  animation: successPop .6s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes successPop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.reg-success__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--heading);
  margin: 0 0 8px;
}

.reg-success__sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px;
}