/*
 * affiliate.css
 * All styles for the affiliate system:
 *   - Public landing page     (.aff-*)
 *   - Sign-up form            (.affsu-*)
 *   - Affiliate login page    (.aff-login-*)
 *   - Affiliate portal        (.affp-*)
 */

/* ─── Shared helpers ────────────────────────────────────────── */
.aff-logo {
  display: inline-flex;
  align-items: center;
}
.aff-logo svg {
  height: 28px;
  width: auto;
}

/* ─── LANDING PAGE ──────────────────────────────────────────── */
.aff-hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-gradient);
  padding: 6rem 1.25rem 0;
  text-align: center;
  min-height: 540px;
  display: flex;
  flex-direction: column;
}
.aff-hero-orbs { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.aff-orb-1 {
  position: absolute; top: -120px; right: -80px;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(215,49,109,.25) 0%, transparent 70%);
}
.aff-orb-2 {
  position: absolute; bottom: 40px; left: -100px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(1,123,198,.2) 0%, transparent 70%);
}
.aff-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.aff-hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding-bottom: 4rem; }
.aff-hero-btns { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.aff-hero-bottom {
  width: 100%; height: 48px; margin-top: auto;
  background: linear-gradient(to bottom, transparent, rgba(245,244,248,.08));
}

.btn-outline-white {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.5rem; border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 999px; color: white; text-decoration: none;
  font-weight: 600; font-size: .925rem;
  background: rgba(255,255,255,.06); backdrop-filter: blur(6px);
  transition: all .2s;
}
.btn-outline-white:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.6); }

.aff-intro-section  { padding: 4rem 1.25rem; background: #f5f4f8; }
.aff-intro-inner    { max-width: 720px; margin: 0 auto; }
.aff-intro-h2       { font-size: clamp(1.5rem,3.5vw,2rem); font-weight: 800; letter-spacing: -.025em; color: var(--foreground); margin-bottom: 1.25rem; }
.aff-intro-body p   { color: rgba(25,8,49,.7); line-height: 1.75; font-size: 1.0625rem; margin-bottom: 1rem; }

.aff-benefits-section  { padding: 4.5rem 1.25rem; background: white; }
.aff-benefits-inner    { max-width: 900px; margin: 0 auto; text-align: center; }
.aff-benefits-h2       { font-size: clamp(1.5rem,3.5vw,2rem); font-weight: 800; letter-spacing: -.025em; color: var(--foreground); margin-bottom: .75rem; }
.aff-benefits-p        { color: rgba(25,8,49,.6); font-size: 1.0625rem; max-width: 580px; margin: 0 auto 3rem; line-height: 1.6; }
.aff-benefits-grid     { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); }
.aff-benefit           { padding: 1.75rem 1.25rem; border-radius: 1rem; background: #f8f7fc; text-align: left; transition: transform .2s, box-shadow .2s; }
.aff-benefit:hover     { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.08); }
.aff-benefit-icon      { width: 48px; height: 48px; background: var(--hero-gradient); border-radius: .75rem; display: flex; align-items: center; justify-content: center; color: white; margin-bottom: 1rem; }
.aff-benefit-title     { font-weight: 700; font-size: 1rem; color: var(--foreground); margin-bottom: .5rem; }
.aff-benefit-desc      { font-size: .9rem; color: rgba(25,8,49,.6); line-height: 1.6; }

.aff-cust-testi-section { padding: 4.5rem 1.25rem; background: #f5f4f8; }
.aff-cust-testi-inner   { max-width: 820px; margin: 0 auto; }
.aff-testi-h2           { font-size: clamp(1.5rem,3.5vw,2rem); font-weight: 800; letter-spacing: -.025em; color: var(--foreground); margin-bottom: 2rem; text-align: center; }
.aff-testi-grid         { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); }
.aff-testi-card         { background: white; border-radius: 1rem; padding: 1.75rem; box-shadow: 0 2px 12px rgba(0,0,0,.06); transition: transform .2s, box-shadow .2s; }
.aff-testi-card:hover   { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.aff-testi-quote-icon   { color: var(--accent); margin-bottom: 1rem; }
.aff-testi-text         { font-size: 1rem; color: rgba(25,8,49,.75); line-height: 1.65; margin-bottom: 1rem; }
.aff-testi-author       { font-size: .875rem; color: rgba(25,8,49,.45); }

.aff-quote-section  { padding: 4.5rem 1.25rem; background: white; }
.aff-quote-inner    { max-width: 640px; margin: 0 auto; text-align: center; }
.aff-quote-card     { background: var(--hero-gradient); border-radius: 1.25rem; padding: 2.5rem 2rem; }
.aff-quote-text     { font-size: 1.0625rem; color: rgba(255,255,255,.85); line-height: 1.7; margin-bottom: 1rem; }
.aff-quote-author   { font-size: .875rem; color: rgba(255,255,255,.55); }

.aff-join-section   { padding: 4.5rem 1.25rem 5rem; background: #f5f4f8; }
.aff-join-inner     { max-width: 540px; margin: 0 auto; text-align: center; }
.aff-join-h2        { font-size: clamp(1.5rem,3.5vw,2rem); font-weight: 800; letter-spacing: -.025em; color: var(--foreground); margin-bottom: .625rem; }
.aff-join-p         { color: rgba(25,8,49,.6); font-size: 1rem; margin-bottom: 2rem; }

/* ─── SIGN-UP FORM PAGE ─────────────────────────────────────── */
.affsu-hero {
  position: relative; overflow: hidden;
  background: var(--hero-gradient);
  padding: 5.5rem 1.25rem 4rem; text-align: center;
}
.affsu-hero-orbs { position: absolute; inset: 0; pointer-events: none; }
.affsu-orb-1 {
  position: absolute; top: -80px; right: -60px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(215,49,109,.22) 0%, transparent 70%);
}
.affsu-orb-2 {
  position: absolute; bottom: -40px; left: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(1,123,198,.18) 0%, transparent 70%);
}
.affsu-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.affsu-hero-inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.affsu-perks       { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.affsu-perk        { display: inline-flex; align-items: center; gap: .5rem; color: rgba(255,255,255,.75); font-size: .875rem; font-weight: 500; }
.affsu-perk-icon   { color: white; display: flex; }

.affsu-form-section   { background: #f5f4f8; padding: 3.5rem 1.25rem 5rem; }
.affsu-form-inner     { max-width: 680px; margin: 0 auto; }
.affsu-alert          { border-radius: .625rem; padding: 1rem 1.25rem; margin-bottom: 1.5rem; font-size: .9rem; line-height: 1.5; }
.affsu-alert-danger   { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); color: #dc2626; }
.affsu-fieldset       { background: white; border-radius: 1rem; padding: 1.75rem; margin-bottom: 1.25rem; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.affsu-fieldset-title { font-size: 1rem; font-weight: 700; color: var(--foreground); margin-bottom: .25rem; }
.affsu-fieldset-sub   { font-size: .875rem; color: rgba(25,8,49,.5); margin-bottom: 1.25rem; }
.affsu-row2           { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 520px) { .affsu-row2 { grid-template-columns: 1fr; } }
.affsu-field          { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.affsu-field:last-child { margin-bottom: 0; }
.affsu-label          { font-size: .875rem; font-weight: 500; color: rgba(25,8,49,.75); }
.affsu-input,
.affsu-textarea,
.affsu-select {
  width: 100%; border: 1.5px solid rgba(25,8,49,.12);
  border-radius: .5rem; padding: .65rem .875rem;
  font-size: .9375rem; color: var(--foreground); background: #fafafa;
  font-family: inherit; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.affsu-input:focus,
.affsu-textarea:focus,
.affsu-select:focus   { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(215,49,109,.1); }
.affsu-input-error    { border-color: #ef4444 !important; }
.affsu-textarea       { resize: vertical; }
.affsu-channels       { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .4rem; }
.affsu-ch-btn {
  border: 1.5px solid rgba(25,8,49,.15); background: #fafafa; color: rgba(25,8,49,.65);
  border-radius: 999px; padding: .35rem .875rem; font-size: .825rem; font-weight: 500;
  cursor: pointer; transition: all .2s;
}
.affsu-ch-btn:hover  { border-color: var(--accent); color: var(--accent); }
.affsu-ch-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.affsu-error         { font-size: .8rem; color: #ef4444; display: none; }
.affsu-error.visible { display: block; }
.affsu-divider       { border: none; border-top: 1px solid rgba(25,8,49,.08); margin: 1.5rem 0; }
.affsu-terms-row     { display: flex; align-items: flex-start; gap: .625rem; cursor: pointer; }
.affsu-terms-text    { font-size: .875rem; color: rgba(25,8,49,.65); line-height: 1.5; }
.affsu-terms-text a  { color: var(--accent); text-decoration: none; }

/* ─── AFFILIATE LOGIN PAGE ──────────────────────────────────── */
.aff-login-page {
  min-height: 100vh; background: #0d0e14;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem 1.25rem; position: relative; overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.aff-login-orbs { position: absolute; inset: 0; pointer-events: none; }
.aff-login-orb-1 {
  position: absolute; top: -100px; left: -80px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(215,49,109,.15) 0%, transparent 65%);
}
.aff-login-orb-2 {
  position: absolute; bottom: -80px; right: -60px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(1,123,198,.12) 0%, transparent 65%);
}
.aff-login-orb-3 {
  position: absolute; top: 40%; left: 40%;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,.08) 0%, transparent 65%);
}
.aff-login-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
}
.aff-login-wrap {
  position: relative; z-index: 1; width: 100%; max-width: 880px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
@media (max-width: 680px) {
  .aff-login-wrap { grid-template-columns: 1fr; gap: 2rem; }
  .aff-login-brand { text-align: center; }
  .aff-login-perks { align-items: center; }
}
.aff-login-logo           { display: inline-block; margin-bottom: 1.5rem; }
.aff-login-logo svg       { height: 28px; width: auto; }
.aff-portal-badge         { display: inline-flex; align-items: center; gap: .5rem; background: rgba(129,140,248,.12); border: 1px solid rgba(129,140,248,.2); border-radius: 999px; padding: .3rem .875rem; font-size: .8rem; font-weight: 600; color: #818cf8; margin-bottom: 1.25rem; }
.aff-portal-badge-icon    { display: flex; }
.aff-portal-badge-label   { }
.aff-login-h1             { font-size: clamp(1.75rem,4vw,2.5rem); font-weight: 800; color: white; line-height: 1.2; margin-bottom: .875rem; letter-spacing: -.03em; font-family: 'Poppins', sans-serif; }
.aff-login-h1 .accent     { background: linear-gradient(135deg,#d7316d,#017bc6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.aff-login-tagline        { color: rgba(255,255,255,.5); font-size: .9375rem; line-height: 1.65; margin-bottom: 1.75rem; }
.aff-login-perks          { display: flex; flex-direction: column; gap: .625rem; }
.aff-login-perk           { display: flex; align-items: center; gap: .625rem; }
.aff-login-perk-icon      { width: 20px; height: 20px; background: rgba(74,222,128,.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #4ade80; flex-shrink: 0; }
.aff-login-perk-text      { font-size: .875rem; color: rgba(255,255,255,.65); }
.aff-login-card-wrap      { position: relative; }
.aff-login-card-glow      { position: absolute; inset: -1px; border-radius: 1.25rem; background: linear-gradient(135deg,rgba(215,49,109,.3),rgba(1,123,198,.3)); filter: blur(12px); opacity: .5; }
.aff-login-card           { position: relative; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 1.25rem; padding: 2rem; backdrop-filter: blur(12px); }
.aff-login-card-title     { font-size: 1.25rem; font-weight: 700; color: white; margin-bottom: .25rem; }
.aff-login-card-sub       { font-size: .875rem; color: rgba(255,255,255,.45); margin-bottom: 1.5rem; }
.aff-login-error-msg      { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); border-radius: .5rem; padding: .65rem .875rem; color: #f87171; font-size: .875rem; margin-bottom: 1.25rem; }
.aff-login-field          { margin-bottom: 1.125rem; }
.aff-login-label          { display: block; font-size: .8rem; font-weight: 500; color: rgba(255,255,255,.6); margin-bottom: .4rem; }
.aff-login-input          { width: 100%; background: rgba(255,255,255,.05); border: 1.5px solid rgba(255,255,255,.1); border-radius: .5rem; padding: .65rem .875rem; font-size: .9375rem; color: white; outline: none; transition: border-color .2s, box-shadow .2s; font-family: inherit; }
.aff-login-input:focus    { border-color: rgba(215,49,109,.6); box-shadow: 0 0 0 3px rgba(215,49,109,.1); }
.aff-login-input::placeholder { color: rgba(255,255,255,.25); }
.aff-login-pw-wrap        { position: relative; }
.aff-login-pw-btn         { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: rgba(255,255,255,.4); display: flex; transition: color .2s; }
.aff-login-pw-btn:hover   { color: rgba(255,255,255,.8); }
.aff-login-bottom-row     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.aff-login-remember       { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: rgba(255,255,255,.5); cursor: pointer; }
.aff-login-forgot         { font-size: .8rem; color: rgba(255,255,255,.45); text-decoration: none; transition: color .2s; }
.aff-login-forgot:hover   { color: rgba(255,255,255,.8); }
.aff-login-submit {
  width: 100%; padding: .75rem; position: relative; overflow: hidden;
  background: linear-gradient(135deg,#d7316d,#017bc6); border: none;
  border-radius: .625rem; color: white; font-weight: 700; font-size: .9375rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .5rem;
  transition: opacity .2s; font-family: inherit;
}
.aff-login-submit:hover     { opacity: .9; }
.aff-login-card-divider     { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 1.5rem 0; }
.aff-login-apply-row        { text-align: center; font-size: .875rem; color: rgba(255,255,255,.4); }
.aff-login-apply-row a      { color: #818cf8; text-decoration: none; font-weight: 500; }
.aff-login-apply-row a:hover { text-decoration: underline; }
.aff-login-copyright        { position: relative; z-index: 1; margin-top: 2rem; font-size: .8rem; color: rgba(255,255,255,.25); text-align: center; }
/* btn-overlay reuse on login submit */
.aff-login-submit .btn-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.08); opacity: 0; transition: opacity .2s; }
.aff-login-submit:hover .btn-overlay { opacity: 1; }

/* ─── AFFILIATE PORTAL (sidebar layout) ────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --port-bg:      #f0f0f5;
  --port-sidebar: #1a1625;
  --port-topbar:  #1a1625;
  --port-card:    #ffffff;
  --port-border:  #e4e2ec;
  --port-text:    #1a1625;
  --port-muted:   #7a7690;
  --port-accent:  #d7316d;
  --port-sidebar-w: 220px;
  --port-topbar-h:  54px;
}

.affp-body {
  background: var(--port-bg);
  color: var(--port-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ── TOPBAR ── */
.affp-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--port-topbar-h);
  background: var(--port-topbar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.affp-topbar-left  { display: flex; align-items: center; gap: .75rem; }
.affp-topbar-right { display: flex; align-items: center; gap: .625rem; }
.affp-topbar-logo svg { height: 24px; width: auto; display: block; }
.affp-sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.5); display: flex; padding: .25rem;
  border-radius: 4px; transition: color .2s;
}
.affp-sidebar-toggle:hover { color: white; }
.affp-portal-badge {
  background: var(--port-accent); color: white;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  border-radius: 4px; padding: .2rem .5rem; text-transform: uppercase;
}
.affp-topbar-user  { font-size: .8rem; color: rgba(255,255,255,.55); }
.affp-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--port-accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.affp-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; flex-shrink: 0;
}
.affp-status-text { font-size: .75rem; color: rgba(255,255,255,.35); }

/* ── SHELL (sidebar + content) ── */
.affp-shell {
  display: flex;
  padding-top: var(--port-topbar-h);
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.affp-sidebar {
  width: var(--port-sidebar-w);
  background: var(--port-sidebar);
  position: fixed; top: var(--port-topbar-h); bottom: 0; left: 0;
  overflow-y: auto; z-index: 100;
  padding: 1.25rem 0 2rem;
  transition: transform .25s;
}
@media (max-width: 768px) {
  .affp-sidebar { transform: translateX(-100%); }
  .affp-sidebar.affp-sidebar--open { transform: translateX(0); }
  .affp-content { margin-left: 0 !important; }
}
.affp-sidenav { padding: 0 .625rem; }
.affp-sidenav-group-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: .25rem .75rem; margin-bottom: .375rem; margin-top: .25rem;
}
.affp-sidenav-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .75rem; border-radius: 6px;
  font-size: .825rem; font-weight: 500;
  color: rgba(255,255,255,.55); text-decoration: none;
  cursor: pointer; background: none; border: none; width: 100%;
  transition: background .15s, color .15s; margin-bottom: .125rem;
  font-family: inherit;
}
.affp-sidenav-link:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.affp-sidenav-link.active { background: var(--port-accent); color: white; font-weight: 600; }
.affp-sidenav-icon { display: flex; flex-shrink: 0; }
.affp-sidenav-info {
  display: flex; align-items: center; gap: .5rem;
  padding: .375rem .75rem; font-size: .75rem;
  color: rgba(255,255,255,.3);
}
.affp-logout-form  { margin-top: .25rem; }
.affp-logout-btn   { color: rgba(255,255,255,.4); }
.affp-logout-btn:hover { background: rgba(239,68,68,.12); color: #f87171; }

/* ── CONTENT AREA ── */
.affp-content {
  margin-left: var(--port-sidebar-w);
  flex: 1; min-width: 0;
  padding: 0;
}

/* ── PAGE HEADER BAR ── */
.affp-page-header {
  background: var(--port-topbar);
  padding: .875rem 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.affp-page-title-row { display: flex; align-items: center; gap: .75rem; }
.affp-page-icon {
  width: 32px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.affp-page-icon--red    { background: rgba(215,49,109,.2); color: #d7316d; }
.affp-page-icon--blue   { background: rgba(96,165,250,.2); color: #60a5fa; }
.affp-page-icon--green  { background: rgba(74,222,128,.2); color: #4ade80; }
.affp-page-icon--purple { background: rgba(167,139,250,.2); color: #a78bfa; }
.affp-page-icon--orange { background: rgba(251,146,60,.2);  color: #fb923c; }
.affp-page-icon--teal   { background: rgba(45,212,191,.2);  color: #2dd4bf; }
.affp-page-h1 {
  font-size: 1.0625rem; font-weight: 700;
  color: white; letter-spacing: -.01em;
}

/* ── FLASH MESSAGES ── */
.affp-flash {
  margin: 1rem 1.75rem 0;
  padding: .7rem 1rem; border-radius: 7px; font-size: .85rem;
}
.affp-flash--success { background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.25); color: #4ade80; }
.affp-flash--error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25);  color: #f87171; }
.affp-flash--info    { background: rgba(96,165,250,.1);  border: 1px solid rgba(96,165,250,.25);  color: #60a5fa; }

/* ── INNER CONTENT PADDING ── */
.affp-inner { padding: 1.5rem 1.75rem 4rem; }

/* ── STAT CARDS ── */
.affp-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1000px) { .affp-stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px)  { .affp-stats-grid { grid-template-columns: 1fr; } }

.affp-stat-card {
  background: var(--port-card); border: 1px solid var(--port-border);
  border-radius: 10px; padding: 1.125rem;
  display: flex; align-items: center; gap: .875rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.affp-stat-icon {
  width: 42px; height: 42px; border-radius: 9px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.affp-stat-icon--red    { background: rgba(215,49,109,.1);  color: #d7316d; }
.affp-stat-icon--blue   { background: rgba(96,165,250,.1);  color: #60a5fa; }
.affp-stat-icon--green  { background: rgba(74,222,128,.1);  color: #4ade80; }
.affp-stat-icon--purple { background: rgba(167,139,250,.1); color: #a78bfa; }
.affp-stat-icon--orange { background: rgba(251,146,60,.1);  color: #fb923c; }
.affp-stat-icon--teal   { background: rgba(45,212,191,.1);  color: #2dd4bf; }
.affp-stat-label {
  font-size: .7rem; font-weight: 600; color: var(--port-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .2rem;
}
.affp-stat-value { font-size: 1.375rem; font-weight: 800; color: var(--port-text); line-height: 1.1; }

/* ── CARDS ── */
.affp-card {
  background: var(--port-card); border: 1px solid var(--port-border);
  border-radius: 10px; margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05); overflow: hidden;
}
.affp-card-head {
  display: flex; align-items: center; gap: .625rem;
  padding: .875rem 1.25rem; border-bottom: 1px solid var(--port-border);
  background: var(--port-topbar);
}
.affp-card-head-icon {
  width: 24px; height: 24px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
}
.affp-card-head-icon--red    { background: rgba(215,49,109,.2);  color: #d7316d; }
.affp-card-head-icon--green  { background: rgba(74,222,128,.2);  color: #4ade80; }
.affp-card-head-icon--blue   { background: rgba(96,165,250,.2);  color: #60a5fa; }
.affp-card-head-icon--purple { background: rgba(167,139,250,.2); color: #a78bfa; }
.affp-card-head-icon--teal   { background: rgba(45,212,191,.2);  color: #2dd4bf; }
.affp-card-title { font-size: .875rem; font-weight: 600; color: white; }
.affp-card-body { padding: 1.25rem; }

/* ── REFERRAL LINK ── */
.affp-link-row   { display: flex; gap: .625rem; flex-wrap: wrap; }
.affp-link-input {
  flex: 1; min-width: 0;
  background: var(--port-bg); border: 1.5px solid var(--port-border);
  border-radius: 7px; padding: .6rem .875rem;
  color: var(--port-muted); font-size: .8125rem; font-family: monospace;
  outline: none;
}
.affp-copy-btn {
  flex-shrink: 0; padding: .6rem 1.125rem;
  background: var(--port-accent); border: none;
  border-radius: 7px; color: white; font-weight: 700; font-size: .8rem;
  cursor: pointer; transition: opacity .2s; font-family: inherit;
  display: inline-flex; align-items: center; gap: .35rem;
}
.affp-copy-btn:hover { opacity: .85; }
.affp-link-tip { font-size: .775rem; color: var(--port-muted); margin-top: .5rem; }

/* ── TABLES ── */
.affp-table-wrap { overflow-x: auto; }
.affp-table      { width: 100%; border-collapse: collapse; font-size: .825rem; }
.affp-table thead th {
  padding: .625rem 1rem; text-align: left;
  font-size: .68rem; font-weight: 600; color: var(--port-muted);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--port-border); white-space: nowrap;
}
.affp-table tbody td {
  padding: .875rem 1rem; color: var(--port-text);
  border-bottom: 1px solid var(--port-border);
}
.affp-table tbody tr:last-child td { border-bottom: none; }
.affp-table tbody tr:hover td { background: rgba(0,0,0,.018); }

/* ── BADGES ── */
.affp-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  border-radius: 999px; padding: 2px 10px;
  font-size: .73rem; font-weight: 600;
}
.affp-badge--green  { background: rgba(74,222,128,.12);  color: #16a34a; }
.affp-badge--red    { background: rgba(239,68,68,.1);    color: #dc2626; }
.affp-badge--grey   { background: rgba(0,0,0,.06);       color: var(--port-muted); }
.affp-badge--amber  { background: rgba(251,191,36,.12);  color: #d97706; }
.affp-badge--blue   { background: rgba(96,165,250,.12);  color: #2563eb; }
.affp-badge--teal   { background: rgba(45,212,191,.12);  color: #0d9488; }
.affp-badge svg     { flex-shrink: 0; }

/* ── EMPTY STATE ── */
.affp-empty { text-align: center; padding: 3rem 1.25rem; color: var(--port-muted); }
.affp-empty svg { display: block; margin: 0 auto 1rem; opacity: .3; }

/* ── BUTTONS ── */
.affp-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.125rem; border-radius: 7px; font-size: .825rem;
  font-weight: 600; cursor: pointer; transition: opacity .2s; font-family: inherit;
  text-decoration: none; border: none;
}
.affp-btn--primary { background: var(--port-accent); color: white; }
.affp-btn--primary:hover { opacity: .85; }
.affp-btn--outline { background: transparent; border: 1.5px solid var(--port-border); color: var(--port-text); }
.affp-btn--outline:hover { border-color: var(--port-accent); color: var(--port-accent); }

/* ── FORMS ── */
.affp-form-group { margin-bottom: 1rem; }
.affp-form-label { display: block; font-size: .8rem; font-weight: 500; color: var(--port-muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em; }
.affp-form-input,
.affp-form-select,
.affp-form-textarea {
  width: 100%; background: var(--port-bg); border: 1.5px solid var(--port-border);
  border-radius: 7px; padding: .6rem .875rem;
  font-size: .875rem; color: var(--port-text); outline: none; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.affp-form-input:focus,
.affp-form-select:focus,
.affp-form-textarea:focus { border-color: var(--port-accent); box-shadow: 0 0 0 3px rgba(215,49,109,.08); }
.affp-form-input::placeholder,
.affp-form-textarea::placeholder { color: rgba(0,0,0,.3); }

/* ── PROGRESS BAR ── */
.affp-progress-track { height: 6px; background: var(--port-border); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.affp-progress-fill  { height: 100%; border-radius: 999px; background: var(--port-accent); transition: width .4s; }

/* ── TIER CARDS ── */
.affp-tier-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 600px) { .affp-tier-grid { grid-template-columns: 1fr; } }
.affp-tier-card {
  border: 2px solid var(--port-border); border-radius: 10px;
  padding: 1.125rem; text-align: center; transition: border-color .2s;
}
.affp-tier-card.current { border-color: var(--port-accent); background: rgba(215,49,109,.03); }
.affp-tier-icon    { font-size: 1.5rem; margin-bottom: .375rem; }
.affp-tier-name    { font-size: .9rem; font-weight: 700; color: var(--port-text); margin-bottom: .125rem; }
.affp-tier-pct     { font-size: 1.375rem; font-weight: 800; color: var(--port-text); }
.affp-tier-sub     { font-size: .75rem; color: var(--port-muted); }
.affp-tier-note    { font-size: .8rem; color: var(--port-muted); margin-top: .75rem; }

/* ── PAYMENT METHOD SELECTOR ── */
.affp-pay-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: .75rem; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .affp-pay-grid { grid-template-columns: repeat(2,1fr); } }
.affp-pay-card {
  border: 2px solid var(--port-border); border-radius: 9px;
  padding: 1rem; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.affp-pay-card:hover   { border-color: rgba(215,49,109,.4); }
.affp-pay-card.active  { border-color: var(--port-accent); background: rgba(215,49,109,.04); }
.affp-pay-icon         { font-size: 1.25rem; margin-bottom: .375rem; display: flex; justify-content: center; }
.affp-pay-name         { font-size: .8rem; font-weight: 600; color: var(--port-text); margin-bottom: .125rem; }
.affp-pay-desc         { font-size: .7rem; color: var(--port-muted); }

/* ── PROFILE AVATAR ── */
.affp-profile-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem;
}
.affp-profile-avatar {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--port-accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; font-weight: 700; flex-shrink: 0;
}
.affp-profile-name { font-size: 1.0625rem; font-weight: 700; color: var(--port-text); margin-bottom: .1rem; }
.affp-profile-meta { font-size: .775rem; color: var(--port-muted); }

/* ── SOCIAL INPUT ── */
.affp-social-field { position: relative; margin-bottom: .875rem; }
.affp-social-label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--port-muted); margin-bottom: .35rem;
}
.affp-social-input {
  width: 100%; background: var(--port-bg); border: 1.5px solid var(--port-border);
  border-radius: 7px; padding: .6rem .875rem; font-size: .875rem;
  color: var(--port-text); outline: none; font-family: inherit;
  transition: border-color .2s;
}
.affp-social-input:focus { border-color: var(--port-accent); }
.affp-social-input::placeholder { color: rgba(0,0,0,.3); }

/* ── CHART CONTAINERS ── */
.affp-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (max-width: 800px) { .affp-charts-grid { grid-template-columns: 1fr; } }
.affp-chart-box { min-height: 220px; position: relative; }
canvas { display: block; width: 100% !important; max-height: 220px; }

/* ── ICON BUTTONS ── */
.affp-icon-btn {
  background: none; border: 1px solid var(--port-border); border-radius: 5px;
  padding: .3rem .4rem; cursor: pointer; display: inline-flex; align-items: center;
  color: var(--port-muted); transition: all .15s;
}
.affp-icon-btn:hover { border-color: var(--port-accent); color: var(--port-accent); }
.affp-icon-btn--danger:hover { border-color: #dc2626; color: #dc2626; }

/* ── DONUT / DEVICE BOXES ── */
.affp-device-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; }
.affp-device-box  { border: 1px solid var(--port-border); border-radius: 9px; padding: .875rem; text-align: center; background: var(--port-bg); }
.affp-device-val  { font-size: 1.125rem; font-weight: 700; color: var(--port-text); }
.affp-device-lbl  { font-size: .72rem; color: var(--port-muted); margin-top: .125rem; }
