/* ===================================================================
   XS Peptides — Affiliate portal styles (affiliate.html only)
   Leans on styles.css for tokens, header, buttons, footer; everything
   here is prefixed af- to stay out of the shared stylesheet's way.
   =================================================================== */

.af-hero { border-bottom: 1px solid var(--line); padding: 64px 0 56px; background:
    radial-gradient(900px 480px at 90% -10%, rgba(1,99,217,.10), transparent 62%),
    radial-gradient(640px 420px at 4% 110%, rgba(0,187,127,.06), transparent 60%), var(--background); }
.af-hero h1 { font-size: clamp(34px, 4.4vw, 52px); letter-spacing: -.035em; margin: 14px 0 12px; }
.af-hero p { color: var(--muted); font-size: 17px; max-width: 560px; }

.af-main { padding: 56px 0 90px; }
.af-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }

/* ---------- auth ---------- */
.af-auth { max-width: 440px; margin: 0 auto; padding: 34px 34px 38px; }
.af-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface); border-radius: 999px; padding: 5px; margin-bottom: 26px; }
.af-tabs button { border-radius: 999px; padding: 10px 0; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .18s, color .18s; }
.af-tabs button.on { background: #fff; color: var(--foreground); box-shadow: var(--shadow-1); }
.af-form { display: grid; gap: 16px; }
.af-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--foreground); }
.af-form label span { color: var(--muted); font-weight: 500; }
.af-form input { border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; font-family: var(--font-body); color: var(--foreground); background: #fff; transition: border-color .15s, box-shadow .15s; }
.af-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1,99,217,.14); }
.af-err { color: var(--red); font-size: 13.5px; font-weight: 500; min-height: 18px; }
.af-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 4px; }
.af-note a, .af-link { color: var(--blue); font-weight: 600; cursor: pointer; }

/* verify-email notice */
.af-verify { text-align: center; padding: 10px 0 4px; }
.af-verify .ic { width: 58px; height: 58px; border-radius: 50%; background: var(--surface-2); color: var(--blue); display: grid; place-items: center; margin: 0 auto 16px; }
.af-verify .ic svg { width: 26px; height: 26px; }
.af-verify h3 { margin-bottom: 8px; }
.af-verify p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.af-devlink { margin-top: 14px; font-size: 13px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; word-break: break-all; }

/* ---------- dashboard ---------- */
.af-dashhead { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.af-dashhead .who h2 { font-size: 26px; }
.af-dashhead .who p { color: var(--muted); font-size: 14px; margin-top: 3px; }

.af-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.af-kpi { padding: 20px 22px; }
.af-kpi .t { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.af-kpi .v { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.af-kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.af-kpi .s b { color: var(--green-deep); font-weight: 600; }

/* clicks chart — single-series bars, quiet axis */
.af-chart { padding: 22px 24px 16px; margin-bottom: 16px; }
.af-chart .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.af-chart .head h3 { font-size: 15px; }
.af-chart .head span { font-size: 12.5px; color: var(--muted); }
.af-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; border-bottom: 1px solid var(--line); }
.af-bars .b { flex: 1; min-height: 2px; background: var(--blue); border-radius: 3px 3px 0 0; opacity: .85; transition: opacity .15s; position: relative; }
.af-bars .b.zero { background: var(--line); }
.af-bars .b:hover { opacity: 1; }
.af-bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--foreground); color: #fff; font-size: 11.5px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.af-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding-top: 6px; font-variant-numeric: tabular-nums; }

.af-grid2 { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; align-items: start; }

/* links & codes */
.af-links { padding: 24px; }
.af-links h3, .af-orders h3 { font-size: 16px; margin-bottom: 4px; }
.af-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.af-newcode { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; margin-bottom: 20px; }
.af-newcode input { border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 13px; font-size: 14px; font-family: var(--font-body); }
.af-newcode input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1,99,217,.14); }
.af-code { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; }
.af-code.is-off { opacity: .55; }
.af-code .row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.af-code .code { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.af-code .label { font-size: 12.5px; color: var(--muted); }
.af-code .row1 .spacer { flex: 1; }
.af-pill { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.af-pill.on { background: rgba(0,187,127,.12); color: var(--green-deep); }
.af-pill.off { background: var(--surface-2); color: var(--muted); }
.af-code .linkrow { display: flex; gap: 8px; margin: 12px 0 10px; }
.af-code .linkrow input { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 9px 12px; font-size: 12.5px; color: var(--muted); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.af-code .stats { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.af-code .stats b { color: var(--foreground); font-weight: 600; }
.af-mini { font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; transition: border-color .15s, background .15s, color .15s; }
.af-mini:hover { border-color: var(--foreground); }
.af-mini.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.af-mini.primary:hover { background: var(--blue-deep); }
.af-mini.copied { background: var(--green); border-color: var(--green); color: #fff; }

/* referred orders */
.af-orders { padding: 24px; }
.af-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.af-table th { text-align: left; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.af-table td { padding: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.af-table tr:last-child td { border-bottom: 0; }
.af-table .num { font-weight: 600; }
.af-status { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.af-status.paid { background: rgba(0,187,127,.12); color: var(--green-deep); }
.af-status.pending { background: rgba(245,166,35,.14); color: #9a6a00; }
.af-status.refunded { background: rgba(251,44,54,.1); color: var(--red); }
.af-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 26px 0; }

/* how it works */
.af-how { margin-top: 42px; }
.af-how h3 { font-size: 18px; margin-bottom: 18px; }
.af-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.af-step { padding: 22px; }
.af-step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--blue); font-weight: 700; display: grid; place-items: center; font-size: 14px; margin-bottom: 12px; }
.af-step h4 { font-size: 15px; margin-bottom: 6px; }
.af-step p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.af-terms { margin-top: 20px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 900px) {
  .af-kpis { grid-template-columns: repeat(2, 1fr); }
  .af-grid2 { grid-template-columns: 1fr; }
  .af-steps { grid-template-columns: 1fr; }
  .af-newcode { grid-template-columns: 1fr; }
}
