﻿/* =====================================================================
   DASHBOARD
   ===================================================================== */
.aff-dash { padding-top: clamp(28px, 5vw, 56px); }
.aff-dash__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(20px, 3vw, 30px);
}
.aff-dash__title { font-size: clamp(1.8rem, 5vw, 2.4rem); margin-bottom: 6px; }
.aff-dash__who {
  color: var(--muted);
  font-size: .88rem;
  overflow-wrap: anywhere;
}
.aff-dash__foot {
  margin-top: 24px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.6;
  text-align: center;
}

/* ---------- Panel ---------- */
.aff-panel {
  padding: clamp(20px, 3vw, 26px);
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .aff-panel { background: var(--surface); }
.aff-panel__title {
  font-size: 1.15rem;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}
.aff-panel__intro {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  margin-bottom: 18px;
}
.aff-panel__empty {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* ---------- Referral link ---------- */
.aff-linkbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--green-line);
}
[data-theme="light"] .aff-linkbox { background: var(--green-tint); }
.aff-linkbox__url {
  font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: .88rem;
  color: var(--text);
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.aff-linkbox__actions { display: flex; gap: 8px; }
.aff-linkbox__actions .btn { flex: 1; }

/* ---------- Balance ---------- */
.aff-balance__main {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.aff-balance__label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.aff-balance__value {
  display: block;
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--accent-ink);
  margin-bottom: 8px;
}
.aff-balance__hint {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.55;
}
.aff-balance__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.aff-stat__label {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 4px;
  line-height: 1.4;
}
.aff-stat__value {
  display: block;
  font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
}

/* ---------- Funnel ---------- */
.aff-funnel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aff-funnel__step {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  text-align: center;
}
[data-theme="light"] .aff-funnel__step { background: var(--surface-2); }
.aff-funnel__step--end {
  background: var(--green-tint);
  border-color: var(--green-line);
}
.aff-funnel__num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.aff-funnel__step--end .aff-funnel__num { color: var(--accent-ink); }
.aff-funnel__label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-top: 4px;
}
.aff-funnel__sub {
  display: block;
  font-size: .76rem;
  color: var(--muted);
  margin-top: 2px;
  min-height: 1em;
}
.aff-funnel__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--muted);
}
.aff-funnel__arrow svg { width: 16px; height: 16px; transform: rotate(90deg); }
.aff-funnel__rate {
  font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: .8rem;
  color: var(--accent-ink);
}

/* ---------- Honest empty state ---------- */
.aff-empty {
  padding: 22px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="light"] .aff-empty { background: var(--surface-2); }
.aff-empty h3 { font-size: 1.05rem; margin-bottom: 10px; letter-spacing: -.02em; }
.aff-empty p { color: var(--muted); font-size: .9rem; line-height: 1.65; }
.aff-empty ul { margin: 12px 0; padding-left: 20px; }
.aff-empty li {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.65;
  margin-bottom: 6px;
}
.aff-empty li strong { color: var(--text); }
.aff-empty__fine { font-size: .82rem !important; opacity: .85; margin-top: 12px; }

/* ---------- Payout rail switch ---------- */
.aff-rail {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}
[data-theme="light"] .aff-rail { background: var(--surface-2); }
.aff-rail__btn {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.aff-rail__btn:hover { color: var(--text); }
.aff-rail__btn.is-on {
  color: #fff;
  background: var(--accent);
}

/* ---------- Withdrawal history ---------- */
.aff-history { list-style: none; margin: 0; padding: 0; }
.aff-hrow {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.aff-hrow:last-child { border-bottom: 0; padding-bottom: 0; }
.aff-hrow:first-child { padding-top: 0; }
.aff-hrow__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.aff-hrow__amount {
  font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace;
  font-size: 1.15rem;
  font-weight: 700;
}
.aff-hrow__badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--muted);
}
.aff-hrow__badge--requested,
.aff-hrow__badge--processing {
  color: var(--accent-ink);
  background: var(--green-tint);
  border-color: var(--green-line);
}
.aff-hrow__badge--paid {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.aff-hrow__badge--rejected {
  color: #E2B4B4;
  background: rgba(197, 48, 48, .10);
  border-color: rgba(197, 48, 48, .28);
}
[data-theme="light"] .aff-hrow__badge--rejected {
  color: #9B2C2C; background: #FDF0F0; border-color: #F0C9C9;
}
.aff-hrow__meta {
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.5;
}
.aff-hrow__hint {
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.5;
  margin-top: 4px;
}
.aff-hrow__reason {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .83rem;
  line-height: 1.5;
  color: #E2B4B4;
  background: rgba(197, 48, 48, .10);
  border: 1px solid rgba(197, 48, 48, .28);
}
[data-theme="light"] .aff-hrow__reason {
  color: #9B2C2C; background: #FDF0F0; border-color: #F0C9C9;
}
.aff-hrow__cancel { margin-top: 12px; }
.aff-hrow__warn {
  margin-top: 8px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}


/* =====================================================================
   TIMING STRIP — "when does my money unlock" + "what's coming next month"
   Sits under the balance grid. Both cards are hidden by aff-referrals.js
   when there is nothing truthful to show, so this container is frequently
   empty by design and must collapse cleanly rather than leave a gap.
   ===================================================================== */
.aff-timing {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.aff-timing:empty { display: none; }
.aff-timing__card {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--green-tint);
  border: 1px solid var(--green-line);
}
.aff-timing__label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.aff-timing__value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--accent-ink);
}
.aff-timing__when {
  display: block;
  margin-top: 4px;
  font-size: .92rem;
  color: var(--text);
}
.aff-timing__hint {
  display: block;
  margin-top: 6px;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--muted);
}

/* =====================================================================
   FREE-MONTH PROGRESS
   ===================================================================== */
.aff-panel--reward { border-color: var(--green-line); }
.aff-reward__bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
[data-theme="light"] .aff-reward__bar { background: #E8E3D8; }
.aff-reward__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .5s var(--ease);
}
.aff-reward__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 12px;
}
.aff-reward__count {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-ink);
}
.aff-reward__stats { font-size: .86rem; color: var(--muted); }
.aff-reward__line {
  margin: 8px 0 0;
  font-size: .92rem;
  line-height: 1.55;
  color: var(--text);
}

/* =====================================================================
   PER-REFERRAL LIST
   Phone-first: each referral is a stacked card. Widened at 620px below.
   ===================================================================== */
.aff-reflist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.aff-ref {
  padding: 15px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border);
}
[data-theme="light"] .aff-ref { background: var(--surface-2); }
/* A referral who signed up but never paid is the one row the affiliate can
   act on, so it gets a visible left edge instead of blending into the list. */
.aff-ref--signed_up { border-left: 3px solid var(--green-line); }
.aff-ref--paying    { border-left: 3px solid var(--accent); }

.aff-ref__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.aff-ref__who { font-weight: 700; font-size: .98rem; }
.aff-ref__id {
  margin-left: 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .74rem;
  font-weight: 500;
  color: var(--muted);
}
.aff-ref__badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
}
.aff-ref__badge--paying {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.aff-ref__badge--signed_up {
  color: var(--accent-ink); background: var(--green-tint); border-color: var(--green-line);
}
.aff-ref__badge--refunded {
  color: #E2B4B4; background: rgba(197, 48, 48, .10); border-color: rgba(197, 48, 48, .28);
}
[data-theme="light"] .aff-ref__badge--refunded {
  color: #9B2C2C; background: #FDF0F0; border-color: #F0C9C9;
}

.aff-ref__meta {
  margin-top: 5px;
  font-size: .81rem;
  color: var(--muted);
}
.aff-ref__money {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin-top: 10px;
}
.aff-ref__earned {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--accent-ink);
}
.aff-ref__earned-lbl { font-size: .8rem; color: var(--muted); }
.aff-ref__next {
  flex-basis: 100%;
  font-size: .82rem;
  color: var(--muted);
}
.aff-ref__hint {
  margin: 8px 0 0;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--muted);
}
