/* ─────────────────────────────────────────────────────────────────────────────
   Member panel · the public site's emerald-and-gold skin
   Loaded after style.css by user.partials.header-asset. The colours come
   from variables.css; this file adds what tokens alone cannot: dark text on
   emerald fills, the heading face, and quiet motion. Layout and flows are
   untouched.
   ────────────────────────────────────────────────────────────────────────── */

body { font-family: var(--font-family-base); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .page-title, .card-title, .chart-card-title { letter-spacing: -0.02em; }
.page-title, h1 { font-weight: 800; }

/* figures line up in columns */
.kpi-value, .stat-card-value, .ref-mini-val, .roi-metric-value, .balance-amount,
table td, .amount, .wallet-balance { font-variant-numeric: tabular-nums; }

::selection { background: rgba(16, 185, 129, 0.35); color: #fff; }
:focus-visible { outline-color: var(--color-primary); }
a { color: var(--color-primary-soft); }

/* ── Emerald fills carry dark text, as on the public site ───────────────── */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active { color: var(--color-on-primary) !important; font-weight: 700; }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: pn-shine 4s 1.5s infinite;
}
@keyframes pn-shine { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }
.btn-primary i, .btn-primary svg { color: inherit; }
/* text on the solid brand fill; .badge-primary sits on a light tint and keeps its brand-coloured text */
.bg-primary { color: var(--color-on-primary) !important; }
.form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }

/* ── Cards: a light that follows the cursor, and a small lift ───────────── */
.card, .chart-card, .kpi-card, .stat-card, .plan-card, .method-card, .security-status-card,
.referral-stat-card, .ref-mini-card, .profile-card, .portfolio-card, .panel-card, .settings-card {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s, border-color 0.35s;
}
/* painted as a background layer, so a card's own ::before/::after stay its own */
.pn-spot:hover { background-image: radial-gradient(420px circle at var(--x, 50%) var(--y, 50%), rgba(16, 185, 129, 0.07), transparent 60%); }
.kpi-card:hover, .plan-card:hover, .method-card:hover, .referral-stat-card:hover, .qa-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 22px 44px -26px rgba(16, 185, 129, 0.55);
}

/* ── Dashboard hero: the emerald field drifts slowly ────────────────────── */
.db-hero { border-color: rgba(16, 185, 129, 0.28) !important; }
.db-hero::before { animation: pn-drift 14s ease-in-out infinite alternate; }
.db-hero::after { animation: pn-drift 18s ease-in-out infinite alternate-reverse; }
@keyframes pn-drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-30px, 20px, 0) scale(1.15); } }

/* ── Sidebar: the active item glows ─────────────────────────────────────── */
.sidebar-link.active, .nav-link.active, .sidebar-item.active > a {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.28);
}
.sidebar-link.active i, .nav-link.active i { filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.6)); }

/* ── Page content rises in on load, card by card ────────────────────────── */
.page-content > *,
.page-content > .row > [class*="col"] {
  /* backwards only: once finished no transform is left behind, so fixed
     modals inside the page keep the viewport as their box */
  animation: pn-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.page-content > :nth-child(2), .page-content > .row > [class*="col"]:nth-child(2) { animation-delay: 60ms; }
.page-content > :nth-child(3), .page-content > .row > [class*="col"]:nth-child(3) { animation-delay: 120ms; }
.page-content > :nth-child(4), .page-content > .row > [class*="col"]:nth-child(4) { animation-delay: 180ms; }
.page-content > :nth-child(5), .page-content > .row > [class*="col"]:nth-child(5) { animation-delay: 240ms; }
.page-content > :nth-child(n+6), .page-content > .row > [class*="col"]:nth-child(n+6) { animation-delay: 300ms; }
@keyframes pn-rise { from { opacity: 0; transform: translateY(18px); } }

/* ── Progress bars fill in ──────────────────────────────────────────────── */
.progress-bar { animation: pn-fill 1.2s 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: 0 50%; }
[dir="rtl"] .progress-bar { transform-origin: 100% 50%; }
@keyframes pn-fill { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  .btn-primary::after, .db-hero::before, .db-hero::after { animation: none; }
  .page-content > *, .page-content > .row > [class*="col"], .progress-bar { animation: none; }
  .kpi-card:hover, .plan-card:hover, .method-card:hover, .referral-stat-card:hover, .qa-tile:hover { transform: none; }
}
