/* Premium account dashboard + motion system.
 * Loaded by /account/* surfaces. Self-contained — does not depend on
 * any inline styles or page-specific overrides.
 */

/* ── Design tokens (subset used here) ───────────────────────────── */
:root {
  --acc-gold:       #d8b15a;
  --acc-gold-soft:  rgba(216, 177, 90, 0.22);
  --acc-teal:       #6ee7d8;
  --acc-teal-soft:  rgba(110, 231, 216, 0.18);
  --acc-bg:         #0a1422;
  --acc-bg-elev:    #0d1a2b;
  --acc-bg-card:    linear-gradient(180deg, rgba(255,255,255,0.022), rgba(255,255,255,0.005));
  --acc-border:     rgba(216, 177, 90, 0.14);
  --acc-border-soft:rgba(255,255,255,0.06);
  --acc-text:       #f4f7f1;
  --acc-text-muted: rgba(196, 207, 218, 0.7);
  --acc-text-dim:   rgba(196, 207, 218, 0.45);
  --acc-radius:     12px;
  --acc-radius-sm:  8px;
}

/* ── Skeleton loader ────────────────────────────────────────────── */
.account-dash-skeleton {
  display: grid;
  gap: 16px;
  margin-block: 12px;
}
.account-dash-skeleton > div {
  height: 80px;
  border-radius: var(--acc-radius);
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 100%);
  background-size: 200% 100%;
  animation: acc-shimmer 1.6s ease-in-out infinite;
}
@keyframes acc-shimmer { to { background-position: -200% 0; } }

/* ── Hero ───────────────────────────────────────────────────────── */
.account-dash-hero {
  position: relative;
  padding: 28px 28px 24px;
  border: 1px solid var(--acc-border);
  border-radius: 16px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(216,177,90,0.10), transparent 50%),
    radial-gradient(80% 120% at 100% 100%, rgba(110,231,216,0.08), transparent 55%),
    linear-gradient(180deg, #0e1a2c 0%, #0a1422 100%);
  overflow: hidden;
  animation: acc-fadeup 360ms ease-out both;
}

.account-dash-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(216,177,90,0.06), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
  animation: acc-pulse 8s ease-in-out infinite;
}

.account-dash-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; z-index: 1; flex-wrap: wrap; }
.account-dash-identity { display: flex; align-items: center; gap: 18px; min-width: 0; }

.account-dash-avatar {
  width: 64px; height: 64px; flex: 0 0 64px;
  border-radius: 999px;
  border: 1px solid rgba(216,177,90,0.45);
  background: linear-gradient(145deg, rgba(216,177,90,0.18), rgba(216,177,90,0.05));
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 32px rgba(216,177,90,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}
.account-dash-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-dash-avatar-fallback { color: var(--acc-gold); font-weight: 700; font-size: 24px; letter-spacing: 0.04em; }

.account-dash-greeting { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.account-dash-greeting h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--acc-text);
}

.account-dash-eyebrow {
  color: rgba(216,177,90,0.85);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.account-dash-meta { color: var(--acc-text-muted); font-size: 12.5px; display: inline-flex; flex-wrap: wrap; gap: 6px 10px; }

.account-tier-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.account-tier-free         { background: rgba(110,231,216,0.12); color: #87f5e5; border: 1px solid rgba(110,231,216,0.3); }
.account-tier-premium      { background: linear-gradient(135deg, rgba(216,177,90,0.3), rgba(216,177,90,0.1)); color: #f8e9b8; border: 1px solid rgba(216,177,90,0.5); }
.account-tier-institutional{ background: linear-gradient(135deg, rgba(180,140,255,0.25), rgba(180,140,255,0.08)); color: #d8c9ff; border: 1px solid rgba(180,140,255,0.45); }

/* ── Stat tiles ─────────────────────────────────────────────────── */
.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-block: 18px;
}
.account-stat-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--acc-border-soft);
  border-radius: var(--acc-radius);
  background: var(--acc-bg-card), var(--acc-bg-elev);
  transition: border-color 200ms ease, transform 200ms ease, background 200ms ease;
  animation: acc-fadeup 400ms ease-out both;
}
.account-stat-card:hover { border-color: var(--acc-border); transform: translateY(-2px); }
.account-stat-label { color: var(--acc-text-muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.account-stat-value { color: var(--acc-text); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.account-stat-hint  { color: var(--acc-text-dim); font-size: 11.5px; }

/* ── Action cards ───────────────────────────────────────────────── */
.account-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-block: 18px;
}
.account-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--acc-border-soft);
  border-radius: var(--acc-radius);
  background: var(--acc-bg-card), var(--acc-bg-elev);
  color: var(--acc-text);
  text-decoration: none;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  animation: acc-fadeup 460ms ease-out both;
}
.account-action-card:hover {
  border-color: var(--acc-border);
  background: var(--acc-bg-card), linear-gradient(135deg, rgba(216,177,90,0.06), rgba(216,177,90,0.01));
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(2,8,23,0.45);
}
.account-action-card.is-primary {
  border-color: rgba(216,177,90,0.35);
  background: var(--acc-bg-card), linear-gradient(135deg, rgba(216,177,90,0.08), rgba(216,177,90,0.02));
}
.account-action-card.is-primary:hover {
  border-color: rgba(216,177,90,0.55);
  box-shadow: 0 14px 38px rgba(216,177,90,0.14);
}

.account-action-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--acc-border-soft);
  background: rgba(216,177,90,0.05);
  color: var(--acc-gold);
}
.account-action-icon svg { width: 20px; height: 20px; }

.account-action-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.account-action-body strong { font-size: 14px; font-weight: 700; color: var(--acc-text); }
.account-action-body span   { font-size: 12px; color: var(--acc-text-muted); line-height: 1.4; }

.account-action-arrow {
  color: var(--acc-text-dim);
  font-size: 18px;
  transition: color 200ms ease, transform 200ms ease;
}
.account-action-card:hover .account-action-arrow { color: var(--acc-gold); transform: translateX(3px); }
[dir="rtl"] .account-action-card:hover .account-action-arrow { transform: translateX(-3px); }

/* ── Activity feed ──────────────────────────────────────────────── */
.account-activity {
  padding: 18px 20px;
  border: 1px solid var(--acc-border-soft);
  border-radius: var(--acc-radius);
  background: var(--acc-bg-elev);
  margin-block: 18px;
  animation: acc-fadeup 520ms ease-out both;
}
.account-activity h2 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: var(--acc-text); letter-spacing: 0.02em; }
.account-activity ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.account-activity li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--acc-radius-sm);
  background: rgba(255,255,255,0.018);
  font-size: 12.5px;
  color: var(--acc-text-muted);
}
.account-activity-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--acc-gold);
  box-shadow: 0 0 8px var(--acc-gold);
  flex: 0 0 6px;
  animation: acc-pulse-dot 2.6s ease-in-out infinite;
}
.account-activity-text { flex: 1; }
.account-activity time { color: var(--acc-text-dim); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Secondary row ──────────────────────────────────────────────── */
.account-secondary-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-block: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--acc-border-soft);
}
.account-sign-out {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border: 1px solid rgba(225, 100, 86, 0.32);
  border-radius: 999px;
  background: rgba(225, 100, 86, 0.08);
  color: #f4b8af;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.account-sign-out:hover:not(:disabled) { background: rgba(225, 100, 86, 0.16); border-color: rgba(225, 100, 86, 0.5); color: #ffd0c8; }
.account-sign-out:disabled { opacity: 0.5; cursor: not-allowed; }
.account-secondary-link {
  display: inline-flex; align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--acc-border-soft);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: var(--acc-text-muted);
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.account-secondary-link:hover { border-color: var(--acc-border); background: rgba(255,255,255,0.05); color: var(--acc-text); }

/* ── Signed-out teaser ──────────────────────────────────────────── */
.account-signed-out-hero {
  padding: 36px 32px;
  border: 1px solid var(--acc-border);
  border-radius: 16px;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(216,177,90,0.10), transparent 50%),
    radial-gradient(80% 100% at 100% 100%, rgba(110,231,216,0.08), transparent 55%),
    var(--acc-bg-elev);
  text-align: center;
  animation: acc-fadeup 380ms ease-out both;
}
.account-signed-out-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--acc-text);
}
.account-signed-out-hero p {
  max-width: 540px; margin: 0 auto 22px;
  color: var(--acc-text-muted);
  font-size: 15px; line-height: 1.55;
}
.account-signed-out-cta { display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.account-cta-primary, .account-cta-secondary {
  display: inline-flex; align-items: center;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 180ms ease;
}
.account-cta-primary {
  background: linear-gradient(135deg, var(--acc-gold) 0%, #c79b3f 100%);
  color: #0a1422;
  border: 1px solid rgba(216,177,90,0.55);
  box-shadow: 0 10px 24px rgba(216,177,90,0.22);
}
.account-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(216,177,90,0.32); }
.account-cta-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--acc-text);
  border: 1px solid var(--acc-border-soft);
}
.account-cta-secondary:hover { background: rgba(255,255,255,0.08); border-color: var(--acc-border); }

.account-teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-block: 24px;
}
.account-teaser-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 18px 16px;
  border: 1px solid var(--acc-border-soft);
  border-radius: var(--acc-radius);
  background: var(--acc-bg-card), var(--acc-bg-elev);
  animation: acc-fadeup 520ms ease-out both;
}
.account-teaser-card strong { font-size: 13.5px; color: var(--acc-text); }
.account-teaser-card span { font-size: 12px; color: var(--acc-text-muted); line-height: 1.45; }
.account-teaser-icon {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(216,177,90,0.08);
  color: var(--acc-gold);
  margin-bottom: 4px;
}
.account-teaser-icon svg { width: 17px; height: 17px; }

/* ── Platform-wide premium motion primitives ───────────────────── */
@keyframes acc-fadeup {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes acc-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.7; }
}
@keyframes acc-pulse-dot {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  .account-dash-hero,
  .account-stat-card,
  .account-action-card,
  .account-activity,
  .account-signed-out-hero,
  .account-teaser-card { animation: none !important; }
  .account-dash-skeleton > div,
  .account-activity-dot,
  .account-dash-hero::before { animation: none !important; }
}

/* ─────────────────────────────────────────────────────────────────
 * URGENT FIXES — tighter sizing for dashboard tiles + icons.
 * ───────────────────────────────────────────────────────────────── */

/* Hero avatar — was 64px which felt oversized */
.account-dash-avatar { width: 52px; height: 52px; flex: 0 0 52px; }
.account-dash-avatar-fallback { font-size: 20px; }

/* Action card icons — was 40px which looked clunky */
.account-action-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; }
.account-action-icon svg { width: 16px; height: 16px; }

/* Tighter action card padding */
.account-action-card { padding: 14px 16px; gap: 12px; }
.account-action-body strong { font-size: 13.5px; }
.account-action-body span { font-size: 11.5px; }

/* Stat tiles — slightly smaller numbers feel more refined */
.account-stat-value { font-size: 24px; }

/* Hero greeting heading: keep proportional */
.account-dash-greeting h1 { font-size: clamp(20px, 2.6vw, 26px); }

/* Teaser icons (signed-out state) */
.account-teaser-icon { width: 28px; height: 28px; border-radius: 7px; }
.account-teaser-icon svg { width: 14px; height: 14px; }

/* Skeleton row heights — was 80px, now matches real content density */
.account-dash-skeleton > div { height: 64px; }

/* ──────────────────────────────────────────────────────────────────
 * /account/profile/ premium framing — wrap Clerk's mountUserProfile
 * inside a compact frame so it stops dominating the page. Clerk
 * defaults to ~800px wide; we cap it and tone the chrome.
 * ────────────────────────────────────────────────────────────── */
[data-clerk-mount="user-profile"] {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
}
[data-clerk-mount="user-profile"] .cl-rootBox,
[data-clerk-mount="user-profile"] .cl-card {
  width: 100% !important;
  max-width: 720px !important;
  box-shadow: none !important;
  border: 1px solid rgba(216,177,90,0.18) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.005)) !important;
  border-radius: 14px !important;
}

/* Compact profile hero — the auth-pages hero looked oversized when
 * combined with the embedded Clerk UI; trim its padding and h1. */
main[data-account-surface="account/profile/"] .market-hero,
main[data-account-surface="account/"] .market-hero {
  padding-block: 18px;
}
main[data-account-surface="account/profile/"] .market-hero h1,
main[data-account-surface="account/"] .market-hero h1 {
  font-size: clamp(22px, 2.6vw, 28px);
  margin: 4px 0 6px;
}

/* Live profile section heading — quieter than the full market-section */
#profile-mount .market-section-head,
#profile-server-truth .market-section-head {
  margin-bottom: 12px;
}
#profile-mount .market-section-head h2,
#profile-server-truth .market-section-head h2 {
  font-size: 16px;
  font-weight: 700;
}

/* Tighten the field-schema / scopes / state cards so they read as
 * supporting metadata under the live profile rather than dominating. */
#profile-fields .market-table,
#profile-scopes .market-copy,
#profile-state .market-copy {
  font-size: 12.5px;
}
#profile-fields th,
#profile-fields td { padding: 8px 10px; font-size: 12.5px; }

