/* public/styles/affiliate.css — DR-1421 "Refer & Earn" dashboard.
   Built on the shared design tokens (tokens.css) so it tracks light/dark and the
   rest of the app's rhythm. Money accent = amber (the Creator/earnings hue). */

#affiliateContent { display: grid; gap: 16px; }

.aff-h2 { font-size: 15px; font-weight: 650; margin: 0 0 12px; color: var(--fg-0); }

/* ── Referral link hero ─────────────────────────────────────────────────── */
.aff-link-card { border-left: 3px solid var(--amber); }
.aff-link-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.aff-link-label { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); }
.aff-code { margin-top: 4px; font-size: 13px; color: var(--fg-2); }
.aff-code strong { font-family: var(--font-mono); color: var(--fg-0); letter-spacing: .06em; }
.aff-earn-badge {
  flex: none; align-self: center;
  font-size: 12px; font-weight: 650; color: var(--amber-text);
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.aff-link-row { display: flex; gap: 8px; align-items: stretch; }
.aff-link-input {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--font-mono); font-size: 13px;
  padding: 10px 12px; border-radius: var(--r-md, 10px);
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--fg-1);
}
.aff-copy { flex: none; white-space: nowrap; }
/* (RG-3) Done states are green: var(--spoof-bright, #34d399) always resolved to the red. */
.aff-copy.is-copied { background: var(--green); border-color: var(--green); color: var(--on-green); }
.aff-link-hint { margin-top: 10px; line-height: 1.45; }

/* ── Funnel stats ───────────────────────────────────────────────────────── */
.aff-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.aff-stat {
  background: var(--bg-2); border: 1px solid var(--line-1); border-radius: 12px;
  padding: 14px 16px; text-align: center;
}
.aff-stat-n { font-size: 24px; font-weight: 700; color: var(--fg-0); font-variant-numeric: tabular-nums; }
.aff-stat-l { font-size: 12.5px; font-weight: 600; color: var(--fg-2); margin-top: 2px; }
.aff-stat-h { margin-top: 3px; }

/* ── Earnings buckets ───────────────────────────────────────────────────── */
.aff-earn-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.aff-earn-tile {
  background: var(--bg-2); border: 1px solid var(--line-1); border-radius: 12px; padding: 14px 16px;
}
.aff-earn-tile.is-hero {
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  background: color-mix(in srgb, var(--amber) 10%, var(--bg-2));
}
.aff-earn-l { font-size: 11.5px; font-weight: 600; color: var(--fg-3); text-transform: uppercase; letter-spacing: .03em; }
.aff-earn-v { font-size: 22px; font-weight: 700; color: var(--fg-0); margin-top: 6px; font-variant-numeric: tabular-nums; }
.aff-earn-tile.is-hero .aff-earn-v { color: var(--amber-text); }
.aff-earn-h { margin-top: 3px; }

/* ── Withdraw ───────────────────────────────────────────────────────────── */
.aff-withdraw-sub { margin: -4px 0 14px; }
.aff-label { font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); margin: 12px 0 8px; }
.aff-details {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 46px;
  font-size: 13.5px; padding: 10px 12px; border-radius: var(--r-md, 10px);
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--fg-1);
}
.aff-details:disabled { opacity: .5; cursor: not-allowed; }
.aff-request { width: 100%; margin-top: 12px; }
.aff-request:disabled { opacity: .55; cursor: not-allowed; }
.aff-withdraw-note { margin-top: 10px; line-height: 1.4; }
.aff-msg { margin-top: 10px; font-size: 13px; padding: 9px 12px; border-radius: 8px; }
.aff-msg[data-kind="error"] { color: var(--spoof-text); background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }

.aff-inreview { display: flex; align-items: center; gap: 14px; }
.aff-inreview-badge {
  flex: none; font-size: 12px; font-weight: 650; color: var(--amber-text);
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
  padding: 5px 12px; border-radius: 999px;
}
.aff-inreview-amt { font-size: 16px; font-weight: 650; color: var(--fg-0); }

/* ── How it works ───────────────────────────────────────────────────────── */
.aff-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.aff-step { display: flex; gap: 10px; align-items: flex-start; }
.aff-step-n {
  flex: none; width: 24px; height: 24px; border-radius: 999px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  color: var(--amber-text); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
}
.aff-step-t { font-size: 13.5px; font-weight: 600; color: var(--fg-0); margin-bottom: 2px; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.aff-table-wrap { overflow-x: auto; }
.aff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aff-table th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-3); padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.aff-table td { padding: 10px; border-bottom: 1px solid var(--line-1); color: var(--fg-2); white-space: nowrap; }
.aff-table td strong { color: var(--fg-0); }
.aff-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.aff-table tr:last-child td { border-bottom: 0; }

.aff-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.aff-badge.ok { color: var(--green-text); background: color-mix(in srgb, var(--green) 14%, transparent); }
.aff-badge.pending { color: var(--amber-text); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.aff-badge.off { color: var(--fg-4); background: color-mix(in srgb, var(--fg-4) 14%, transparent); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .aff-earn-grid { grid-template-columns: repeat(2, 1fr); }
  .aff-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .aff-stats { grid-template-columns: 1fr; }
  .aff-earn-grid { grid-template-columns: 1fr 1fr; }
  .aff-link-row { flex-direction: column; }
  .aff-copy { width: 100%; }
}
