/* Affiliate portal (templates/affiliate/*.tpl): a related but distinct world from the public site. Indigo and teal family derived from the
   brand navy, scoped to .ap (see DESIGN.md "Affiliate portal"). Green stays on primary actions only. The legacy div#contentWrapper.ap-cw rules of
   style.css, revamp.css and components.css are beaten with the same id selector (div#contentWrapper.ap-cw below is expanded to div#contentWrapper.ap-cw at build time). */

/* ---------- tokens ---------- */
.ap {
  --ap-bg: #F4F5FB;
  --ap-surface: #FFFFFF;
  --ap-ink: #14172E;
  --ap-ink-2: #4A4F6A;
  --ap-ink-3: #5E6380;
  --ap-line: #E1E4F0;
  --ap-line-2: #C3C9E3;
  --ap-i950: #12163A;
  --ap-i900: #1B2155;
  --ap-i800: #262E73;
  --ap-i700: #323C8F;
  --ap-i600: #4553B8;
  --ap-i100: #DDE1F7;
  --ap-i50: #EEF0FB;
  --ap-on-dark: #F2F3FF;
  --ap-on-dark-soft: #BDC3EA;
  --ap-teal: #0F766E;
  --ap-teal-dark: #0B5E57;
  --ap-teal-50: #E3F4F1;
  --ap-teal-lite: #7ED8CC;
  --ap-amber: #7A4F00;
  --ap-amber-50: #FFF6E0;
  --ap-amber-line: #F0D48C;
  --ap-danger: #B42318;
  --ap-danger-50: #FEF3F2;
  --ap-action: #2E7D32;
  --ap-action-hover: #246428;
  --ap-focus: #4553B8;
  --ap-shadow: 0 1px 2px rgba(18, 22, 58, 0.05), 0 8px 24px rgba(18, 22, 58, 0.06);
  --ap-ease: cubic-bezier(0.16, 1, 0.3, 1);

  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--ap-bg); color: var(--ap-ink);
  font-family: var(--rt-font, "Manrope", "Segoe UI", system-ui, sans-serif);
  font-size: 16px; line-height: 1.6;
}
body.ap-body { margin: 0; padding: 0; background: #F4F5FB; }
.ap *, .ap *::before, .ap *::after { box-sizing: border-box; }
.ap svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ap :focus-visible, .ap-skip:focus-visible { outline: 3px solid var(--ap-focus); outline-offset: 2px; }
.ap-balance :focus-visible, .ap-side :focus-visible, .ap-ft :focus-visible { outline-color: #B8C4FF; }
.ap-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ap-skip { position: absolute; left: 12px; top: -64px; z-index: 200; padding: 10px 16px; border-radius: 10px; background: #12163A; color: #fff; font-weight: 700; text-decoration: none; }
.ap-skip:focus { top: 12px; color: #fff; }
.ap-skip:focus, .ap-skip:focus-visible { outline: 3px solid var(--ap-focus, #4553B8); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; } /* outside .ap: the var is not defined there, so it needs the fallback */

/* ---------- portal header ---------- */
.ap-hd { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--ap-line); }
.ap-hd__in { display: flex; align-items: center; gap: 24px; max-width: 1120px; min-height: 64px; margin: 0 auto; padding: 0 20px; }
.ap-brand { display: inline-flex; align-items: center; gap: 12px; flex: none; min-height: 44px; color: var(--ap-ink); text-decoration: none; }
.ap-brand img { display: block; width: auto; height: 30px; }
.ap-brand__tag { padding: 3px 9px; border-radius: 6px; background: var(--ap-i900); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4; }
.ap-hd__panel { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.ap-nav, .ap-tools { display: flex; align-items: center; gap: 4px; }
.ap-nav a, .ap-tool { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ap-ink-2); font: inherit; font-size: 15px; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.ap-nav a:hover, .ap-tool:hover { background: var(--ap-i50); color: var(--ap-i900); text-decoration: none; }
.ap-nav a[aria-current=page] { background: var(--ap-i50); color: var(--ap-i900); font-weight: 800; box-shadow: inset 0 -2px 0 var(--ap-i600); }
.ap-tool { font-size: 14px; }
.ap-logout { margin: 0; }
.ap-menubtn { display: none; }

/* ---------- shell ---------- */
.ap-main { flex: 1 0 auto; outline: 0; }
div#contentWrapper.ap-cw { background: transparent !important; padding: 0; margin: 0; font-size: 16px; line-height: 1.6; }
div#contentWrapper.ap-cw .rt-auth.aff > * { max-width: none; }
div#contentWrapper.ap-cw .rt-auth.aff { margin: 0 auto; padding: clamp(24px, 4vw, 44px) 20px clamp(48px, 6vw, 80px); max-width: 1120px; font-size: 16px; }
div#contentWrapper.ap-cw .rt-auth.aff.ap-page { max-width: 1040px; }
div#contentWrapper.ap-cw .ap-pagehead { margin: 0 0 24px; }
div#contentWrapper.ap-cw h1.ap-title { margin: 0; padding: 0; color: var(--ap-ink) !important; font-size: clamp(26px, 3.2vw, 34px) !important; font-weight: 800 !important; letter-spacing: -0.03em !important; line-height: 1.15; text-align: left !important; overflow-wrap: anywhere; }
div#contentWrapper.ap-cw p.ap-lead { max-width: 62ch; margin: 8px 0 0; color: var(--ap-ink-2); font-size: 16px; }

/* ---------- cards, text ---------- */
div#contentWrapper.ap-cw .ap-card { margin: 0 0 20px; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--ap-line); border-radius: 16px; background: var(--ap-surface); box-shadow: var(--ap-shadow); }
div#contentWrapper.ap-cw h2.ap-card__h { margin: 0 0 12px; padding: 0; color: var(--ap-ink); font-size: 18px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.3; text-align: left; }
div#contentWrapper.ap-cw h2.ap-eyebrow { margin: 0 0 10px; padding: 0; color: var(--ap-ink-3); font-size: 12px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; text-align: left; }
div#contentWrapper.ap-cw p.ap-help, div#contentWrapper.ap-cw .ap-help { margin: 0 0 14px; color: var(--ap-ink-2); font-size: 15px; line-height: 1.55; }
div#contentWrapper.ap-cw p.ap-note { margin: 14px 0 0; color: var(--ap-ink-3); font-size: 14px; }
div#contentWrapper.ap-cw p.ap-label { margin: 18px 0 8px; color: var(--ap-ink); font-size: 15px; font-weight: 700; }
div#contentWrapper.ap-cw .ap-page a:not(.ap-btn):not(.ap-chip):not(.ap-start__go) { color: #3340A6; text-underline-offset: 3px; }
div#contentWrapper.ap-cw .ap-grid { display: grid; gap: 20px; margin: 0 0 20px; }
div#contentWrapper.ap-cw .ap-grid > .ap-card { margin: 0; }
div#contentWrapper.ap-cw .ap-grid--hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
div#contentWrapper.ap-cw .ap-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- buttons, chips ---------- */
div#contentWrapper.ap-cw .ap-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 2px solid transparent; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color 0.18s, border-color 0.18s, transform 0.12s var(--ap-ease); }
div#contentWrapper.ap-cw .ap-btn--action, div#contentWrapper.ap-cw a.ap-btn--action { background: var(--ap-action); border-color: var(--ap-action); color: #fff; }
div#contentWrapper.ap-cw .ap-btn--action:hover, div#contentWrapper.ap-cw a.ap-btn--action:hover { background: var(--ap-action-hover); border-color: var(--ap-action-hover); color: #fff; text-decoration: none; }
div#contentWrapper.ap-cw .ap-btn:active { transform: scale(0.97); }
div#contentWrapper.ap-cw .ap-btn--lg { min-height: 52px; padding: 0 32px; font-size: 16px; }
div#contentWrapper.ap-cw .ap-btn.is-copied { background: var(--ap-teal); border-color: var(--ap-teal); }
.ap-ic-ok { display: none; }
.is-copied .ap-ic-ok { display: block; }
.is-copied .ap-ic-copy { display: none; }
div#contentWrapper.ap-cw .ap-chip, div#contentWrapper.ap-cw a.ap-chip, div#contentWrapper.ap-cw button.ap-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--ap-line-2); border-radius: 999px; background: #fff; color: var(--ap-ink); font: inherit; font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; transition: border-color 0.15s, background-color 0.15s, transform 0.12s var(--ap-ease); }
div#contentWrapper.ap-cw .ap-chip:hover, div#contentWrapper.ap-cw a.ap-chip:hover, div#contentWrapper.ap-cw button.ap-chip:hover { border-color: var(--ap-i600); background: var(--ap-i50); color: var(--ap-i900); text-decoration: none; }
div#contentWrapper.ap-cw .ap-chip:active { transform: scale(0.97); }
div#contentWrapper.ap-cw .ap-chip--ghost { border-color: transparent; color: #3340A6; }
div#contentWrapper.ap-cw .ap-chip[hidden] { display: none; }
div#contentWrapper.ap-cw .ap-mini { flex: none; white-space: nowrap; min-height: 40px; padding: 0 14px; border: 1px solid var(--ap-line-2); border-radius: 8px; background: #fff; color: var(--ap-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
div#contentWrapper.ap-cw .ap-mini:hover { border-color: var(--ap-i600); background: var(--ap-i50); }
div#contentWrapper.ap-cw .ap-mini.is-copied { background: var(--ap-teal-50); border-color: var(--ap-teal); color: var(--ap-teal-dark); }

/* ---------- banners ---------- */
div#contentWrapper.ap-cw .ap-banner { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--ap-i100); border-radius: 14px; background: var(--ap-i50); color: var(--ap-ink); }
div#contentWrapper.ap-cw .ap-banner--warn { background: var(--ap-amber-50); border-color: var(--ap-amber-line); }
div#contentWrapper.ap-cw .ap-banner--error { background: var(--ap-danger-50); border-color: #F5B5AF; }
.ap-banner__ic { margin-top: 1px; color: var(--ap-i600); }
.ap-banner--warn .ap-banner__ic { color: var(--ap-amber); }
.ap-banner--error .ap-banner__ic { color: var(--ap-danger); }
div#contentWrapper.ap-cw p.ap-banner__t { margin: 0 0 2px; color: var(--ap-ink); font-size: 15px; font-weight: 750; }
div#contentWrapper.ap-cw p.ap-banner__d { margin: 0; color: var(--ap-ink-2); font-size: 14px; line-height: 1.5; }

/* ---------- first steps ---------- */
div#contentWrapper.ap-cw .ap-start__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
div#contentWrapper.ap-cw .ap-start__list li { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--ap-line); border-radius: 12px; background: #fff; font-size: 15px; font-weight: 600; line-height: 1.35; }
.ap-start__mark { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 2px solid var(--ap-line-2); border-radius: 50%; color: #fff; }
.is-done .ap-start__mark { border-color: var(--ap-teal); background: var(--ap-teal); }
.is-done .ap-start__txt { color: var(--ap-ink-3); text-decoration: line-through; text-decoration-color: var(--ap-line-2); }
.ap-start__txt { flex: 1; }
div#contentWrapper.ap-cw a.ap-start__go { flex: none; padding: 8px 4px; color: #3340A6 !important; font-size: 14px; font-weight: 750; }

/* ---------- balance hero ---------- */
div#contentWrapper.ap-cw .ap-balance { border: 0; background: linear-gradient(160deg, var(--ap-i950) 0%, var(--ap-i900) 55%, var(--ap-i800) 100%); color: var(--ap-on-dark); }
div#contentWrapper.ap-cw .ap-balance h2.ap-eyebrow { color: var(--ap-on-dark-soft); }
div#contentWrapper.ap-cw .ap-balance p { margin: 0; color: inherit; }
div#contentWrapper.ap-cw .ap-balance a { color: #C9D6FF !important; text-underline-offset: 3px; }
div#contentWrapper.ap-cw p.ap-balance__label { color: var(--ap-on-dark-soft); font-size: 15px; }
div#contentWrapper.ap-cw p.ap-balance__amount { margin: 2px 0 18px; color: #fff; font-size: clamp(40px, 5.6vw, 54px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.ap-balance__amount small { margin-left: 8px; color: var(--ap-on-dark-soft); font-size: 20px; font-weight: 700; letter-spacing: 0; }
.ap-bar { height: 8px; margin: 0 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.ap-bar span { display: block; height: 100%; border-radius: 999px; background: var(--ap-teal-lite); }
@media (prefers-reduced-motion: no-preference) { .ap-bar span { animation: ap-grow 0.7s var(--ap-ease) both; } }
@keyframes ap-grow { from { width: 0; } }
div#contentWrapper.ap-cw p.ap-outlook__t { color: var(--ap-on-dark-soft); font-size: 14px; line-height: 1.55; }
div#contentWrapper.ap-cw .ap-outlook__t b { color: #fff; font-weight: 700; }
div#contentWrapper.ap-cw p.ap-outlook__sub { margin-top: 8px; color: var(--ap-on-dark-soft); font-size: 13px; }
div#contentWrapper.ap-cw p.ap-outlook__warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 14px; }
div#contentWrapper.ap-cw .ap-outlook__warn--light { background: var(--ap-amber-50); color: var(--ap-amber); }
div#contentWrapper.ap-cw .ap-balance__split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0 0; padding: 18px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.16); }
div#contentWrapper.ap-cw .ap-balance__split dt { margin: 0; color: var(--ap-on-dark-soft); font-size: 13px; font-weight: 700; }
div#contentWrapper.ap-cw .ap-balance__split dd { margin: 2px 0 0; color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.3; }
div#contentWrapper.ap-cw .ap-balance__split dd.ap-balance__d { color: var(--ap-on-dark-soft); font-size: 13px; font-weight: 500; letter-spacing: 0; line-height: 1.45; }

/* ---------- link card ---------- */
div#contentWrapper.ap-cw .ap-copy { display: flex; flex-wrap: wrap; gap: 8px; }
div#contentWrapper.ap-cw .ap-copy input.rt-auth__input { flex: 1 1 220px; width: auto !important; min-width: 0; font-size: 15px; }
div#contentWrapper.ap-cw .ap-copy .ap-btn { flex: 0 0 auto; }
div#contentWrapper.ap-cw .ap-share { display: flex; flex-wrap: wrap; gap: 8px; }
div#contentWrapper.ap-cw .ap-offer { display: flex; gap: 14px; align-items: center; margin-top: 20px; padding: 14px; border: 1px dashed #AEB7EA; border-radius: 12px; background: var(--ap-i50); }
div#contentWrapper.ap-cw .ap-offer b { display: block; color: var(--ap-ink); font-size: 15px; }
div#contentWrapper.ap-cw .ap-offer p { margin: 2px 0 0; color: var(--ap-ink-2); font-size: 13px; line-height: 1.45; }
.ap-offer__code { flex: none; padding: 6px 12px; border: 1px solid var(--ap-i100); border-radius: 8px; background: #fff; color: var(--ap-i900); font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; font-size: 16px; font-weight: 800; letter-spacing: 0.04em; }

/* ---------- funnel, legend ---------- */
div#contentWrapper.ap-cw .ap-funnel { margin: 0; padding: 0; list-style: none; }
div#contentWrapper.ap-cw .ap-funnel li { margin: 0 0 16px; }
div#contentWrapper.ap-cw .ap-funnel__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-size: 15px; color: var(--ap-ink-2); }
div#contentWrapper.ap-cw .ap-funnel__row b { color: var(--ap-ink); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ap-funnel__bar { height: 10px; border-radius: 999px; background: var(--ap-i50); overflow: hidden; }
.ap-funnel__bar span { display: block; height: 100%; border-radius: 999px; background: var(--ap-i600); }
@media (prefers-reduced-motion: no-preference) { .ap-funnel__bar span { animation: ap-grow 0.7s var(--ap-ease) both; } }
div#contentWrapper.ap-cw .ap-funnel small { display: block; margin-top: 4px; color: var(--ap-ink-3); font-size: 13px; }
div#contentWrapper.ap-cw .ap-legend { margin: 0; padding: 0; list-style: none; }
div#contentWrapper.ap-cw .ap-legend li { display: flex; gap: 12px; align-items: baseline; margin: 0 0 10px; font-size: 14px; color: var(--ap-ink-2); line-height: 1.45; }
div#contentWrapper.ap-cw .ap-legend .ap-badge { flex: 0 0 96px; text-align: center; }

/* ---------- badges, table ---------- */
.ap-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--ap-i50); color: var(--ap-i900); font-size: 13px; font-weight: 700; line-height: 1.45; white-space: nowrap; }
.ap-badge--pending, .ap-badge--po-awaiting_invoice { background: var(--ap-amber-50); color: var(--ap-amber); }
.ap-badge--approved, .ap-badge--po-invoiced, .ap-badge--po-exported { background: #E3E7FA; color: var(--ap-i900); }
.ap-badge--paid, .ap-badge--po-paid { background: var(--ap-teal-50); color: var(--ap-teal-dark); }
.ap-badge--reversed, .ap-badge--po-cancelled { background: #EFF0F5; color: var(--ap-ink-2); }
.ap-table-wrap { margin: 0 -4px; overflow-x: auto; }
div#contentWrapper.ap-cw .ap-table { width: 100%; border-collapse: collapse; font-size: 15px; }
div#contentWrapper.ap-cw .ap-table th { padding: 8px 12px; border-bottom: 1px solid var(--ap-line); color: var(--ap-ink-3); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
div#contentWrapper.ap-cw .ap-table td { padding: 12px; border-bottom: 1px solid var(--ap-line); color: var(--ap-ink); white-space: nowrap; }
div#contentWrapper.ap-cw .ap-table tbody tr:last-child td { border-bottom: 0; }
div#contentWrapper.ap-cw .ap-table tbody tr:hover td { background: #FAFBFF; }
div#contentWrapper.ap-cw .ap-table .ap-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
div#contentWrapper.ap-cw .ap-empty { display: grid; justify-items: center; gap: 4px; padding: 28px 12px; text-align: center; }
.ap-empty svg { margin-bottom: 8px; color: var(--ap-i600); stroke-width: 1.6; }
div#contentWrapper.ap-cw p.ap-empty__t { margin: 0; color: var(--ap-ink); font-size: 17px; font-weight: 750; text-align: center; }
div#contentWrapper.ap-cw p.ap-empty__d { max-width: 46ch; margin: 0; color: var(--ap-ink-2); font-size: 15px; text-align: center; }

/* ---------- profile: public page preview, drop zones ---------- */
div#contentWrapper.ap-cw .ap-pub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 28px; align-items: start; }
div#contentWrapper.ap-cw .ap-pub__form .ap-btn { margin-top: 4px; }
div#contentWrapper.ap-cw .ap-drop { position: relative; margin: 0 0 14px; }
div#contentWrapper.ap-cw .ap-drop__zone { display: grid; justify-items: center; gap: 4px; margin: 0; padding: 20px 16px; border: 2px dashed var(--ap-line-2); border-radius: 14px; background: #FAFBFF; text-align: center; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
div#contentWrapper.ap-cw .ap-drop__zone:hover, div#contentWrapper.ap-cw .ap-drop.is-over .ap-drop__zone { border-color: var(--ap-i600); background: var(--ap-i50); }
div#contentWrapper.ap-cw .ap-drop:focus-within .ap-drop__zone { outline: 3px solid var(--ap-focus); outline-offset: 2px; }
div#contentWrapper.ap-cw .ap-drop.has-file .ap-drop__zone { border-style: solid; border-color: var(--ap-teal); background: var(--ap-teal-50); }
div#contentWrapper.ap-cw .ap-drop.aff-field--bad .ap-drop__zone { border-color: var(--ap-danger); background: var(--ap-danger-50); }
div#contentWrapper.ap-cw .aff-field.ap-drop input[type=file] { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.ap-drop__ic { color: var(--ap-i600); }
div#contentWrapper.ap-cw .ap-drop__t { color: var(--ap-ink); font-size: 15px; font-weight: 700; }
div#contentWrapper.ap-cw .ap-drop__h { color: var(--ap-ink-3); font-size: 13px; line-height: 1.4; }
div#contentWrapper.ap-cw .ap-drop__file { color: var(--ap-teal-dark); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
div#contentWrapper.ap-cw .ap-drop__file[hidden], div#contentWrapper.ap-cw .ap-drop .aff-err[hidden] { display: none; }
div#contentWrapper.ap-cw .ap-pv { position: relative; border: 1px solid var(--ap-line); border-radius: 16px; background: #fff; box-shadow: var(--ap-shadow); overflow: hidden; }
div#contentWrapper.ap-cw p.ap-pv__tag { position: absolute; top: 10px; left: 10px; z-index: 1; margin: 0; padding: 3px 9px; border-radius: 6px; background: rgba(18, 22, 58, 0.78); color: #fff; font-size: 12px; font-weight: 700; }
.ap-pv__cover { height: 104px; background: linear-gradient(135deg, var(--ap-i950), var(--ap-i700)) center / cover no-repeat; }
.ap-pv__body { padding: 0 18px 18px; }
.ap-pv__avatar { display: grid; place-items: center; width: 72px; height: 72px; margin-top: -36px; border: 4px solid #fff; border-radius: 50%; background: var(--ap-i50); color: var(--ap-i700); font-size: 28px; font-weight: 800; overflow: hidden; }
.ap-pv__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ap-pv__avatar [hidden] { display: none; }
div#contentWrapper.ap-cw p.ap-pv__eyebrow { margin: 10px 0 0; color: var(--ap-ink-3); font-size: 12px; font-weight: 600; }
div#contentWrapper.ap-cw p.ap-pv__name { margin: 0; color: var(--ap-ink); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; }
div#contentWrapper.ap-cw p.ap-pv__bio { margin: 8px 0 0; color: var(--ap-ink-2); font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
div#contentWrapper.ap-cw p.ap-pv__new { margin: 0; padding: 8px 18px; background: var(--ap-amber-50); color: var(--ap-amber); font-size: 13px; font-weight: 700; }
div#contentWrapper.ap-cw .ap-pv__new[hidden] { display: none; }
div#contentWrapper.ap-cw .ap-help--bio { margin: 4px 0 14px; }
div#contentWrapper.ap-cw .ap-callout { display: flex; gap: 14px; margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--ap-i100); border-radius: 12px; background: var(--ap-i50); }
.ap-callout svg { margin-top: 2px; color: var(--ap-i600); }
div#contentWrapper.ap-cw .ap-callout p { margin: 0; color: var(--ap-ink-2); font-size: 14px; line-height: 1.5; }
div#contentWrapper.ap-cw p.ap-callout__t { color: var(--ap-ink); font-size: 15px; font-weight: 750; }
.ap-js [data-aff-pwgate]:not([data-open="1"]) { display: none; }
div#contentWrapper.ap-cw .ap-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; margin: 0 -20px; padding: 14px 20px; background: linear-gradient(to top, var(--ap-bg) 65%, rgba(244, 245, 251, 0)); }
div#contentWrapper.ap-cw .ap-page .aff-set { margin: 0 0 20px; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--ap-line); border-radius: 16px; background: #fff; box-shadow: var(--ap-shadow); min-width: 0; }
div#contentWrapper.ap-cw .ap-page .aff-set > legend { float: none; width: auto; margin: 0 0 12px; padding: 0; border: 0; color: var(--ap-ink); font-size: 18px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.3; }
div#contentWrapper.ap-cw .ap-banknote { margin: 0 0 14px; }

/* ---------- payouts ---------- */
div#contentWrapper.ap-cw .ap-next { border-left: 4px solid var(--ap-i600); }
div#contentWrapper.ap-cw .ap-next--act { border-left-color: #C98A00; background: var(--ap-amber-50); border-color: var(--ap-amber-line); border-left-color: #C98A00; }
div#contentWrapper.ap-cw p.ap-next__t { margin: 0 0 8px; color: var(--ap-ink); font-size: 18px; font-weight: 750; line-height: 1.4; }
div#contentWrapper.ap-cw .ap-billing { display: grid; gap: 0; margin: 0; }
div#contentWrapper.ap-cw .ap-billing > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--ap-line); }
div#contentWrapper.ap-cw .ap-billing dt { margin: 0; padding-top: 6px; color: var(--ap-ink-3); font-size: 13px; font-weight: 700; }
div#contentWrapper.ap-cw .ap-billing dd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; color: var(--ap-ink); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
div#contentWrapper.ap-cw .ap-payouts { display: grid; gap: 14px; }
div#contentWrapper.ap-cw .ap-payout { padding: 18px; border: 1px solid var(--ap-line); border-radius: 14px; background: #fff; }
div#contentWrapper.ap-cw .ap-payout--awaiting_invoice { border-color: var(--ap-amber-line); }
div#contentWrapper.ap-cw .ap-payout__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 16px; }
div#contentWrapper.ap-cw .ap-payout__head h3 { margin: 0; color: var(--ap-ink); font-size: 16px; font-weight: 800; }
div#contentWrapper.ap-cw .ap-payout__amt { color: var(--ap-ink); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
div#contentWrapper.ap-cw .ap-payout__head time { margin-left: auto; color: var(--ap-ink-3); font-size: 13px; }
div#contentWrapper.ap-cw .ap-tl { display: flex; margin: 0 0 16px; padding: 0; list-style: none; }
div#contentWrapper.ap-cw .ap-tl li { position: relative; flex: 1 1 0; min-width: 0; margin: 0; padding: 22px 4px 0; color: var(--ap-ink-3); font-size: 13px; font-weight: 600; line-height: 1.3; text-align: center; }
.ap-tl li::before { content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: var(--ap-line-2); }
.ap-tl li:first-child::before { display: none; }
.ap-tl__dot { position: absolute; top: 0; left: 50%; width: 14px; height: 14px; margin-left: -7px; border: 2px solid var(--ap-line-2); border-radius: 50%; background: #fff; z-index: 1; }
.ap-tl li.is-done, .ap-tl li.is-now { color: var(--ap-ink); }
.ap-tl li.is-done::before, .ap-tl li.is-now::before { background: var(--ap-teal); }
.ap-tl li.is-done .ap-tl__dot { border-color: var(--ap-teal); background: var(--ap-teal); }
.ap-tl li.is-now .ap-tl__dot { border-color: var(--ap-i600); box-shadow: 0 0 0 4px var(--ap-i100); }
.ap-tl li.is-now { font-weight: 800; }
div#contentWrapper.ap-cw .ap-invform { max-width: 560px; padding-top: 6px; border-top: 1px solid var(--ap-line); }
div#contentWrapper.ap-cw .ap-invform > .ap-help { margin-top: 14px; }
div#contentWrapper.ap-cw p.ap-payout__inv { margin: 0; color: var(--ap-ink-2); font-size: 14px; }

/* Invoice check verdict (PDF sandbox, templates/affiliate/payouts.tpl .ap-scan--*): one tinted callout per state, the words carry the state,
   the drawn icon and the tint only repeat it. "Being checked" breathes a little (reduced motion: still); "rejected" leads into the re-upload form. */
div#contentWrapper.ap-cw p.ap-scan {
  display: flex; align-items: flex-start; gap: 10px; max-width: 640px; margin: 0 0 14px; padding: 11px 14px; border: 1px solid; border-radius: 12px;
  font-size: 15px; font-weight: 600; line-height: 1.5;
}
.ap-scan::before {
  content: ""; flex: 0 0 20px; height: 20px; margin-top: 1px; background: currentColor;
  -webkit-mask: var(--ap-scan-ic) center / 20px 20px no-repeat; mask: var(--ap-scan-ic) center / 20px 20px no-repeat;
}
div#contentWrapper.ap-cw p.ap-scan--wait {
  border-color: var(--ap-i100); background: var(--ap-i50); color: var(--ap-i800);
  --ap-scan-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5' opacity='.3'/%3E%3Cpath d='M12 3.5a8.5 8.5 0 0 1 8.5 8.5'/%3E%3C/svg%3E");
}
div#contentWrapper.ap-cw p.ap-scan--ok {
  border-color: #A7DCD3; background: var(--ap-teal-50); color: var(--ap-teal-dark);
  --ap-scan-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E");
}
div#contentWrapper.ap-cw p.ap-scan--review {
  border-color: var(--ap-amber-line); background: var(--ap-amber-50); color: var(--ap-amber);
  --ap-scan-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
}
div#contentWrapper.ap-cw p.ap-scan--bad {
  border-color: #F4C7C3; background: var(--ap-danger-50); color: var(--ap-danger); font-weight: 700;
  --ap-scan-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5l9.5 16.5h-19z'/%3E%3Cpath d='M12 10v4.5M12 17.4v.1'/%3E%3C/svg%3E");
}
div#contentWrapper.ap-cw .ap-payout:has(.ap-scan--bad) { border-color: #F4C7C3; }
div#contentWrapper.ap-cw .ap-scan--bad + .ap-invform { padding-top: 0; border-top: 0; }
div#contentWrapper.ap-cw .ap-scan--bad + .ap-invform > .ap-help:first-of-type { margin-top: 4px; }
div#contentWrapper.ap-cw .ap-scan + p.ap-payout__inv { margin-top: -4px; }
@media (prefers-reduced-motion: no-preference) {
  .ap-scan--wait::before { animation: ap-scan-spin 1.1s linear infinite; }
}
@keyframes ap-scan-spin { to { transform: rotate(360deg); } }

/* ---------- sign-in, sign-up, result panels ---------- */
div#contentWrapper.ap-cw .ap-auth { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 620px); gap: clamp(24px, 4vw, 56px); justify-content: center; align-items: start; }
div#contentWrapper.ap-cw .ap-auth__col { min-width: 0; }
div#contentWrapper.ap-cw .ap-auth .rt-auth__card { padding: clamp(20px, 4vw, 32px); border: 1px solid var(--ap-line); border-radius: 18px; box-shadow: var(--ap-shadow); }
div#contentWrapper.ap-cw .ap-side { position: sticky; top: 96px; padding: 28px 26px; border-radius: 20px; background: linear-gradient(160deg, var(--ap-i950), var(--ap-i800)); color: var(--ap-on-dark); }
div#contentWrapper.ap-cw p.ap-side__kicker { margin: 0 0 8px; color: var(--ap-on-dark-soft); font-size: 12px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
div#contentWrapper.ap-cw p.ap-side__lead { margin: 0 0 20px; color: #fff; font-size: 19px; font-weight: 750; line-height: 1.35; letter-spacing: -0.01em; }
div#contentWrapper.ap-cw .ap-side__facts { margin: 0 0 20px; padding: 0; list-style: none; }
div#contentWrapper.ap-cw .ap-side__facts li { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; color: var(--ap-on-dark); font-size: 15px; line-height: 1.45; text-wrap: pretty; }
.ap-side__facts svg { margin-top: 1px; color: var(--ap-teal-lite); }
div#contentWrapper.ap-cw .ap-side a.ap-side__more { color: #C9D6FF !important; font-size: 14px; font-weight: 700; text-underline-offset: 3px; }
/* Commission rings (templates/affiliate/_ring.tpl): the arc length is the rate itself (pathLength 100). The dial keeps its square
   box through aspect-ratio before the SVG paints, so nothing shifts; the number scales with the dial (container units). */
div#contentWrapper.ap-cw .ap-rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; margin: 0 0 22px; padding: 0; list-style: none; }
div#contentWrapper.ap-cw .ap-ring { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; text-align: center; }
.ap-ring__dial { position: relative; display: block; flex: none; width: 100%; max-width: 124px; aspect-ratio: 1; container-type: inline-size; }
.ap-ring__dial svg { display: block; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); fill: none; stroke-width: 9; }
.ap-ring__track { stroke: rgba(189, 195, 234, 0.2); }
.ap-ring__arc { stroke: var(--ap-teal-lite); stroke-linecap: butt; }
.ap-ring--recurring .ap-ring__arc { stroke: #B8C4FF; }
div#contentWrapper.ap-cw .ap-ring__n { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 30px; font-size: 27cqi; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
div#contentWrapper.ap-cw .ap-ring__l { color: var(--ap-on-dark); font-size: 14px; line-height: 1.4; text-wrap: balance; }
@media (prefers-reduced-motion: no-preference) {
  .ap-ring__arc { animation: ap-ring-draw 1s var(--ap-ease) 0.15s both; }
  .ap-ring--recurring .ap-ring__arc { animation-delay: 0.3s; }
}
@keyframes ap-ring-draw { from { stroke-dasharray: 0 100; } }
div#contentWrapper.ap-cw .ap-result { display: grid; justify-items: start; gap: 14px; }
.ap-result__ic { color: var(--ap-teal); stroke-width: 1.8; }
.ap-result--bad .ap-result__ic { color: var(--ap-danger); }
div#contentWrapper.ap-cw p.ap-result__t { margin: 0; color: var(--ap-ink); font-size: 17px; font-weight: 650; line-height: 1.5; }
div#contentWrapper.ap-cw .aff-foot { margin: 16px 0 0; text-align: center; color: var(--ap-ink-2); font-size: 15px; }
div#contentWrapper.ap-cw .aff-foot a { color: #3340A6; }

/* ---------- portal footer ---------- */
.ap-ft { flex: none; background: var(--ap-i950); color: var(--ap-on-dark-soft); }
.ap-ft__ie { opacity: 0.9; }
.ap-ft__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; max-width: 1120px; margin: 0 auto; padding: 22px 20px 26px; }
.ap-ft__links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.ap-ft__links a { display: inline-block; padding: 11px 0; color: #D6DEFF; font-size: 14px; text-underline-offset: 3px; }
.ap-ft__links a:hover { color: #fff; }
.ap-ft__copy { margin: 0; color: var(--ap-on-dark-soft); font-size: 13px; }

/* ---------- form fields and legacy form rules (kept from the first version) ---------- */
.aff-field { margin: 0 0 16px; }
.aff-field label { display: block; }
.aff-field small, .aff-help { display: block; color: var(--ap-ink-3, #5D6B82); }
.aff-err { margin: 4px 0 0; color: #B42318; }
.aff-form button[type=submit].rt-auth__submit { width: auto; min-width: 160px; }
.aff-set { min-width: 0; }
.aff-set legend { float: none; width: auto; }
.aff-field select.aff-select, .aff-field textarea.aff-textarea { display: block; width: 100%; max-width: none; float: none; margin: 0; padding: 0 14px; border: 1px solid #8792A2; border-radius: 10px; background: #fff; font: inherit; font-size: 16px; color: #101828; box-shadow: none; }
.aff-field select.aff-select { height: 48px; }
.aff-field textarea.aff-textarea { padding: 12px 14px; height: auto; min-height: 96px; }
.aff-field--bad input.rt-auth__input { border-color: #B42318 !important; }
/* company billing: affiliates are companies only, so the Individual/Company toggle is hidden (type=juridica stays checked) */
.aff-set .rt-bf-fieldset:has([data-bf-type]) { display: none; }
.aff-set .rt-bf { width: 100%; }
.aff-set .aff-err { margin: 0 0 12px; }
/* billing verification badge (templates/_billing_status.tpl) between the help line and the fields */
.aff-set .aff-bv { margin: 14px 0 22px; }
/* Legacy div#contentWrapper.ap-cw input/textarea rules (css/style.css) float and shade every field; restore the shared billing form's own look. */
div#contentWrapper.ap-cw .rt-bf input.rt-bf-input, div#contentWrapper.ap-cw .rt-bf select.rt-bf-input { float: none; width: 100%; height: 48px; margin: 0; padding: 0 14px; border: 1px solid #8792A2; border-radius: 10px; background: #fff; box-shadow: none; color: #101828; font-size: 16px; }
div#contentWrapper.ap-cw .rt-bf select.rt-bf-select { padding-right: 40px; background: #fff url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%235D6B82' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M6 9.5l6 6 6-6'/></svg>") no-repeat right 12px center/18px 18px; }
div#contentWrapper.ap-cw .rt-bf input.rt-bf-input:focus, div#contentWrapper.ap-cw .rt-bf select.rt-bf-input:focus { border-color: #2D6FE3; box-shadow: 0 0 0 3px rgba(45, 111, 227, 0.22); }
div#contentWrapper.ap-cw .rt-bf .rt-bf-cui input.rt-bf-input { flex: 1 1 auto; width: auto; min-width: 0; }
div#contentWrapper.ap-cw .rt-bf label.rt-bf-label { float: none; width: auto; height: auto; margin: 0 0 6px; padding: 0; position: static; display: block; font-size: 15px; font-weight: 700; line-height: 1.4; }
div#contentWrapper.ap-cw .rt-bf .rt-bf-field { float: none; width: auto; }
div#contentWrapper.ap-cw .aff-field input.rt-auth__input { max-width: none; }
div#contentWrapper.ap-cw .aff-field textarea.aff-textarea { float: none; width: 100%; margin: 0; min-height: 96px; padding: 12px 14px; border: 1px solid #8792A2; border-radius: 10px; background: #fff; box-shadow: none; font-size: 16px; resize: vertical; }
div#contentWrapper.ap-cw .aff-field select.aff-select { float: none; width: 100%; max-width: none; margin: 0; }

/* ---------- sign-up wizard ---------- */
.aff-wiz { max-width: 640px; margin: 0 auto; }
.aff-steps { display: flex; margin: 0 0 8px; padding: 0; list-style: none; }
.aff-steps__item { position: relative; flex: 1 1 0; min-width: 0; margin: 0; }
.aff-steps__item + .aff-steps__item::before { content: ""; position: absolute; top: 18px; right: 50%; width: 100%; height: 2px; background: #E1E4F0; z-index: 0; }
.aff-steps__btn { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 0 4px; border: 0; background: none; font: inherit; color: #5E6380; cursor: default; }
.aff-steps__btn:not(:disabled) { cursor: pointer; }
.aff-steps__btn:not(:disabled):hover .aff-steps__title { text-decoration: underline; }
.aff-steps__btn:focus-visible { outline: 3px solid #4553B8; outline-offset: 2px; border-radius: 8px; }
.aff-steps__mark { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #C3C9E3; color: #5E6380; font-weight: 700; font-size: 15px; }
.aff-steps__check { position: absolute; inset: 0; margin: auto; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.aff-steps__title { font-size: 14px; font-weight: 700; line-height: 1.3; text-align: center; }
.aff-steps__item[data-state=current] .aff-steps__mark { background: #1B2155; box-shadow: none; color: #fff; }
.aff-steps__item[data-state=current] .aff-steps__title { color: #14172E; }
.aff-steps__item[data-state=done] .aff-steps__mark { background: #E3F4F1; box-shadow: none; color: #0F766E; }
.aff-steps__item[data-state=done] .aff-steps__num { opacity: 0; }
.aff-steps__item[data-state=done] .aff-steps__check { opacity: 1; }
.aff-steps__item[data-state=done] .aff-steps__title { color: #0B5E57; }
.aff-steps__item[data-state=done] + .aff-steps__item::before { background: #0F766E; }
.aff-steps__of { margin: 0 0 16px; text-align: center; font-size: 14px; color: #5E6380; }
.aff-panel { padding: clamp(20px, 4vw, 32px); }
.aff-panel.rt-auth__card { padding: clamp(20px, 4vw, 32px); }
.aff-step__h { margin: 0 0 8px; padding: 0; font-size: 1.25rem; line-height: 1.3; color: #14172E; outline: 0; }
div#contentWrapper.ap-cw .aff-step__h { padding: 0; margin: 0 0 8px; color: #14172E; }
.aff-step > .aff-help { margin: 0 0 20px; }
.aff-step[hidden] { display: none; }
.aff-formerr { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: #FEF3F2; color: #B42318; font-size: 15px; }
.aff-formerr[hidden] { display: none; }
.aff-wiz .aff-err { margin: 6px 0 0; font-size: 14px; color: #B42318; }
.aff-wiz .aff-err[hidden] { display: none; }
.aff-wiz .aff-field small.rt-auth__hint { margin-top: 6px; }
.aff-slugprev { margin: -4px 0 4px; font-size: 15px; color: #4A4F6A; }
.aff-slugprev__url { display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: 2px 8px; border-radius: 6px; background: #EEF0FB; color: #14172E; }
.aff-wiz .aff-set { margin: 0 0 20px; padding: 0; border: 0; background: none; box-shadow: none; }
.aff-wiz .aff-set > legend { display: none; }
.aff-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; line-height: 1.5; }
div#contentWrapper.ap-cw .aff-check input[type=checkbox] { flex: 0 0 auto; float: none; width: 22px; height: 22px; min-width: 22px; margin: 1px 0 0; padding: 0; accent-color: #2E7D32; }
.aff-check a { color: #3340A6; text-underline-offset: 3px; }
.aff-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; margin-top: 24px; }
.aff-actions .rt-auth__submit { margin: 0; }
.aff-back { height: 46px; padding: 0 22px; border: 1.5px solid #8792A2; border-radius: 999px; background: #fff; color: #14172E; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; transition: border-color 0.15s, transform 0.12s var(--ap-ease, ease); }
.aff-back:hover { border-color: #14172E; }
.aff-back:active { transform: scale(0.97); }
.aff-back:focus-visible, .aff-wiz .rt-auth__submit:focus-visible { outline: 3px solid #4553B8; outline-offset: 2px; }
.aff-back[hidden] { display: none; }
.aff-wiz .cf-turnstile { margin-top: 8px; }
.aff-nojs { margin: 0 0 16px; text-align: center; }
.aff-step .rt-bf-fieldset:has([data-bf-type]) { display: none; }
.aff-wiz .aff-actions .rt-auth__submit { width: auto; min-width: 160px; flex: 1 1 200px; }
.aff-actions [data-aff-back] { margin-right: 0; }
div#contentWrapper.ap-cw .aff-wiz .aff-err { margin: 6px 0 0; font-size: 14px; line-height: 1.4; color: #B42318; }
div#contentWrapper.ap-cw .aff-wiz .aff-err[hidden], div#contentWrapper.ap-cw .aff-wiz .aff-formerr[hidden] { display: none; }
div#contentWrapper.ap-cw .aff-wiz .aff-formerr { color: #B42318; }
.aff-field .selectboxit-container, .aff-field .selectboxit-container .selectboxit { width: 100% !important; }
.aff-field .selectboxit-container .selectboxit { height: 48px; border: 1px solid #8792A2; border-radius: 10px; background: #fff; }
.aff-field .selectboxit-container .selectboxit-text { line-height: 46px; font-size: 16px; color: #14172E; }
.aff-field .selectboxit-container .selectboxit-arrow-container { line-height: 46px; }
div#contentWrapper.ap-cw .aff-err { color: #B42318; font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .aff-steps__mark { transition: background-color 0.2s, color 0.2s; }
  .aff-step:not([hidden]) { animation: ap-in-fwd 0.34s var(--ap-ease) both; }
  .aff-wiz[data-dir=back] .aff-step:not([hidden]) { animation-name: ap-in-back; }
  .ap-banner, .ap-card { animation: ap-rise 0.4s var(--ap-ease) both; }
  .ap-is-copied-pop, .is-copied .ap-ic-ok { animation: ap-pop 0.28s var(--ap-ease) both; }
}
@keyframes ap-in-fwd { from { opacity: 0; transform: translateX(18px); } }
@keyframes ap-in-back { from { opacity: 0; transform: translateX(-18px); } }
@keyframes ap-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes ap-pop { from { transform: scale(0.5); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 899px) {
  .ap-hd__in { gap: 12px; }
  .ap-js .ap-menubtn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-left: auto; padding: 0 14px; border: 1.5px solid var(--ap-line-2); border-radius: 10px; background: #fff; color: var(--ap-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
  .ap-menubtn__bars { position: relative; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: background-color 0.15s; }
  .ap-menubtn__bars::before, .ap-menubtn__bars::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.2s var(--ap-ease); }
  .ap-menubtn__bars::before { top: -6px; }
  .ap-menubtn__bars::after { top: 6px; }
  .ap-menu-open .ap-menubtn__bars { background: transparent; }
  .ap-menu-open .ap-menubtn__bars::before { transform: translateY(6px) rotate(45deg); }
  .ap-menu-open .ap-menubtn__bars::after { transform: translateY(-6px) rotate(-45deg); }
  .ap-hd__panel { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .ap-js .ap-hd__panel { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 12px 16px 18px; border-bottom: 1px solid var(--ap-line); background: #fff; box-shadow: 0 18px 32px rgba(18, 22, 58, 0.12); }
  .ap-js.ap-menu-open .ap-hd__panel { display: flex; }
  .ap-hd__in { flex-wrap: wrap; }
  .ap-js .ap-hd__in { flex-wrap: nowrap; }
  .ap-nav, .ap-tools { flex-direction: column; align-items: stretch; gap: 2px; }
  .ap-nav a, .ap-tool { min-height: 48px; font-size: 16px; }
  .ap-tools { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ap-line); }
  .ap-tools .ap-logout .ap-tool { width: 100%; }
  div#contentWrapper.ap-cw .ap-grid--hero, div#contentWrapper.ap-cw .ap-grid--two { grid-template-columns: minmax(0, 1fr); }
  div#contentWrapper.ap-cw .ap-auth { grid-template-columns: minmax(0, 1fr); }
  div#contentWrapper.ap-cw .ap-side { position: static; order: 2; }
  div#contentWrapper.ap-cw .ap-pub { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ap-brand__tag { font-size: 11px; }
  .ap-brand img { height: 26px; }
  div#contentWrapper.ap-cw .ap-card { border-radius: 14px; }
  .ap-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  div#contentWrapper.ap-cw .ap-table, div#contentWrapper.ap-cw .ap-table tbody, div#contentWrapper.ap-cw .ap-table tr, div#contentWrapper.ap-cw .ap-table td { display: block; width: 100%; }
  div#contentWrapper.ap-cw .ap-table tr { padding: 10px 0; border-bottom: 1px solid var(--ap-line); }
  div#contentWrapper.ap-cw .ap-table td { display: flex; justify-content: space-between; gap: 16px; padding: 5px 4px; border: 0; white-space: normal; text-align: right; }
  div#contentWrapper.ap-cw .ap-table td::before { content: attr(data-label); color: var(--ap-ink-3); font-size: 13px; font-weight: 700; text-align: left; }
  div#contentWrapper.ap-cw .ap-table .ap-num { text-align: right; }
  div#contentWrapper.ap-cw .ap-table tbody tr:hover td { background: none; }
  div#contentWrapper.ap-cw .ap-billing > div { grid-template-columns: minmax(0, 1fr); }
  div#contentWrapper.ap-cw .ap-billing dt { padding-top: 0; }
  div#contentWrapper.ap-cw .ap-payout__head time { margin-left: 0; width: 100%; }
  div#contentWrapper.ap-cw .ap-tl li { font-size: 12px; padding-left: 0; padding-right: 0; }
  div#contentWrapper.ap-cw .ap-offer { flex-wrap: wrap; }
  div#contentWrapper.ap-cw .ap-balance__split { gap: 12px; }
  div#contentWrapper.ap-cw .ap-legend .ap-badge { flex-basis: 88px; }
  .aff-actions { flex-direction: column-reverse; align-items: stretch; }
  .aff-actions [data-aff-back], .aff-wiz .aff-actions .rt-auth__submit, .aff-back { width: 100%; }
  .aff-steps__title { font-size: 13px; }
  .aff-wiz .aff-actions .rt-auth__submit { flex: 0 0 auto; }
  div#contentWrapper.ap-cw .aff-form .ap-btn:not(.ap-btn--lg), div#contentWrapper.ap-cw .ap-invform .ap-btn { width: 100%; }
  div#contentWrapper.ap-cw .ap-savebar .ap-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ap *, .ap *::before, .ap *::after { animation: none !important; transition: none !important; }
}

/* Next-step link inside the balance hero (dark surface): reads as an action, not body text. */
div#contentWrapper.ap-cw .ap-balance p.ap-outlook__warn a {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--ap-ink, #14183a) !important; /* beats the hero's light link colour (.ap-balance a, !important) */
  font-weight: 600;
  text-decoration: none;
}
div#contentWrapper.ap-cw .ap-balance p.ap-outlook__warn a:hover { text-decoration: underline; }
div#contentWrapper.ap-cw .ap-balance p.ap-outlook__warn a:focus-visible { outline: 3px solid #9fb0ff; outline-offset: 2px; }

/* ---------- program promo page + terms (affiliate_program*.tpl, affiliate_terms*.tpl), scoped to .ap-prog / .ap-doc ---------- */
div#contentWrapper.ap-cw .ap-btn--ghost { background: transparent; border-color: var(--ap-line-2); color: var(--ap-i900); }
div#contentWrapper.ap-cw .ap-btn--ghost:hover { background: var(--ap-i50); border-color: var(--ap-i600); text-decoration: none; }
div#contentWrapper.ap-cw .ap-btn--ghost-dark { background: transparent; border-color: rgba(222, 227, 255, 0.55); color: #fff; }
div#contentWrapper.ap-cw .ap-btn--ghost-dark:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; color: #fff; text-decoration: none; }

div#contentWrapper.ap-cw .ap-prog { display: block; }
div#contentWrapper.ap-cw .ap-prog h1, div#contentWrapper.ap-cw .ap-prog h2, div#contentWrapper.ap-cw .ap-prog h3 { padding: 0; text-align: left; letter-spacing: -0.02em; }
div#contentWrapper.ap-cw .ap-prog p { margin: 0; }
div#contentWrapper.ap-cw .ap-prog__hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; padding: clamp(26px, 5vw, 56px); border-radius: 24px; background: linear-gradient(160deg, var(--ap-i950) 0%, var(--ap-i900) 55%, var(--ap-i800) 100%); color: var(--ap-on-dark); box-shadow: var(--ap-shadow); }
div#contentWrapper.ap-cw .ap-prog__kicker { margin: 0 0 14px; color: var(--ap-teal-lite); font-size: 13px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
div#contentWrapper.ap-cw h1.ap-prog__title { margin: 0 0 16px; color: #fff !important; font-size: clamp(28px, 4.2vw, 44px) !important; font-weight: 800 !important; line-height: 1.12; text-align: left !important; text-wrap: balance; overflow-wrap: anywhere; }
div#contentWrapper.ap-cw .ap-prog__lead { max-width: 52ch; color: var(--ap-on-dark-soft); font-size: 17px; line-height: 1.6; }
div#contentWrapper.ap-cw .ap-prog__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
div#contentWrapper.ap-cw .ap-prog__fine { margin-top: 14px !important; color: var(--ap-on-dark-soft); font-size: 14px; }
div#contentWrapper.ap-cw .ap-prog__rates { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
div#contentWrapper.ap-cw .ap-prog__rates li { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border: 1px solid rgba(189, 195, 234, 0.28); border-radius: 18px; background: rgba(255, 255, 255, 0.07); }
div#contentWrapper.ap-cw .ap-prog__rate { flex: none; min-width: 3.2ch; color: #fff; font-size: clamp(38px, 5vw, 54px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
div#contentWrapper.ap-cw .ap-prog__rate-l { color: var(--ap-on-dark-soft); font-size: 15px; line-height: 1.45; }
div#contentWrapper.ap-cw .ap-prog__rates .ap-ring { flex-direction: row; text-align: left; }
div#contentWrapper.ap-cw .ap-prog__rates .ap-ring__dial { width: clamp(88px, 12vw, 112px); }
div#contentWrapper.ap-cw .ap-prog__rates .ap-ring__l { color: var(--ap-on-dark-soft); font-size: 15px; line-height: 1.45; text-wrap: pretty; }

div#contentWrapper.ap-cw .ap-prog__sec { margin-top: clamp(40px, 6vw, 72px); }
div#contentWrapper.ap-cw .ap-prog__eyebrow { margin: 0 0 8px; color: var(--ap-teal); font-size: 12px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
div#contentWrapper.ap-cw h2.ap-prog__h2 { margin: 0 0 22px; color: var(--ap-ink); font-size: clamp(24px, 3vw, 32px); font-weight: 800; line-height: 1.2; }
div#contentWrapper.ap-cw .ap-prog h3 { margin: 0 0 6px; color: var(--ap-ink); font-size: 17px; font-weight: 750; line-height: 1.3; }
div#contentWrapper.ap-cw .ap-prog__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
div#contentWrapper.ap-cw .ap-prog__steps li { position: relative; margin: 0; padding: 20px; border: 1px solid var(--ap-line); border-radius: 16px; background: var(--ap-surface); box-shadow: var(--ap-shadow); }
div#contentWrapper.ap-cw .ap-prog__steps li::marker { content: ""; }
div#contentWrapper.ap-cw .ap-prog__n { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-bottom: 12px; border-radius: 50%; background: var(--ap-i900); color: #fff; font-size: 15px; font-weight: 800; }
div#contentWrapper.ap-cw .ap-prog__steps p, div#contentWrapper.ap-cw .ap-prog__card p, div#contentWrapper.ap-cw .ap-prog__aside p { color: var(--ap-ink-2); font-size: 15px; line-height: 1.55; }
div#contentWrapper.ap-cw .ap-prog__note { margin-top: 18px !important; padding: 14px 18px; border-left: 4px solid var(--ap-i600); border-radius: 0 12px 12px 0; background: var(--ap-i50); color: var(--ap-ink-2); font-size: 15px; }

div#contentWrapper.ap-cw .ap-prog__split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
div#contentWrapper.ap-cw .ap-prog__list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--ap-line); border-radius: 16px; background: var(--ap-surface); box-shadow: var(--ap-shadow); }
div#contentWrapper.ap-cw .ap-prog__list li { position: relative; margin: 0; padding: 16px 20px 16px 52px; border-top: 1px solid var(--ap-line); color: var(--ap-ink-2); font-size: 16px; line-height: 1.5; }
div#contentWrapper.ap-cw .ap-prog__list li:first-child { border-top: 0; }
div#contentWrapper.ap-cw .ap-prog__list li::before { content: ""; position: absolute; left: 20px; top: 19px; width: 16px; height: 9px; border-left: 3px solid var(--ap-teal); border-bottom: 3px solid var(--ap-teal); transform: rotate(-45deg); }
div#contentWrapper.ap-cw .ap-prog__list strong { color: var(--ap-ink); }
div#contentWrapper.ap-cw .ap-prog__aside { padding: 22px; border-radius: 16px; background: var(--ap-teal-50); }
div#contentWrapper.ap-cw .ap-prog__aside p + p { margin-top: 10px; }
div#contentWrapper.ap-cw .ap-prog__aside a { color: var(--ap-teal-dark) !important; font-weight: 700; }

div#contentWrapper.ap-cw .ap-prog__cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
div#contentWrapper.ap-cw .ap-prog__card { padding: 22px; border: 1px solid var(--ap-line); border-top: 4px solid var(--ap-i600); border-radius: 16px; background: var(--ap-surface); box-shadow: var(--ap-shadow); }

div#contentWrapper.ap-cw .ap-prog__faq { display: grid; gap: 10px; max-width: 800px; }
div#contentWrapper.ap-cw .ap-prog__faq details { border: 1px solid var(--ap-line); border-radius: 14px; background: var(--ap-surface); }
div#contentWrapper.ap-cw .ap-prog__faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 12px 18px; color: var(--ap-ink); font-size: 16px; font-weight: 700; cursor: pointer; list-style: none; }
div#contentWrapper.ap-cw .ap-prog__faq summary::-webkit-details-marker { display: none; }
div#contentWrapper.ap-cw .ap-prog__faq summary::after { content: "+"; flex: none; color: var(--ap-i600); font-size: 22px; font-weight: 600; line-height: 1; }
div#contentWrapper.ap-cw .ap-prog__faq details[open] summary::after { content: "\2212"; }
div#contentWrapper.ap-cw .ap-prog__faq details p { padding: 0 18px 16px; color: var(--ap-ink-2); font-size: 15px; line-height: 1.6; }

div#contentWrapper.ap-cw .ap-prog__final { margin-top: clamp(40px, 6vw, 72px); padding: clamp(26px, 5vw, 48px); border-radius: 24px; background: linear-gradient(160deg, var(--ap-i950) 0%, var(--ap-i900) 55%, var(--ap-i800) 100%); color: var(--ap-on-dark); text-align: center; }
div#contentWrapper.ap-cw .ap-prog__final h2.ap-prog__h2 { margin-bottom: 10px; color: #fff; text-align: center !important; }
div#contentWrapper.ap-cw .ap-prog__final p { color: var(--ap-on-dark-soft); font-size: 17px; }
div#contentWrapper.ap-cw .ap-prog__final .ap-prog__cta { justify-content: center; }

/* terms document */
div#contentWrapper.ap-cw .ap-doc { max-width: 820px; }
div#contentWrapper.ap-cw .ap-doc__s { margin: 0 0 14px; padding: clamp(18px, 3vw, 26px); border: 1px solid var(--ap-line); border-radius: 16px; background: var(--ap-surface); }
div#contentWrapper.ap-cw h2.ap-doc__h { margin: 0 0 12px; padding: 0; color: var(--ap-ink); font-size: 19px; font-weight: 750; line-height: 1.3; text-align: left; }
div#contentWrapper.ap-cw .ap-doc__s p, div#contentWrapper.ap-cw .ap-doc__s li { color: var(--ap-ink-2); font-size: 16px; line-height: 1.65; }
div#contentWrapper.ap-cw .ap-doc__s p { margin: 0 0 10px; }
div#contentWrapper.ap-cw .ap-doc__s ul { margin: 0; padding-left: 22px; }
div#contentWrapper.ap-cw .ap-doc__s li { margin: 0 0 8px; }
div#contentWrapper.ap-cw .ap-doc__s strong { color: var(--ap-ink); }
div#contentWrapper.ap-cw .ap-doc__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

@media (max-width: 899px) {
  div#contentWrapper.ap-cw .ap-prog__hero, div#contentWrapper.ap-cw .ap-prog__split { grid-template-columns: minmax(0, 1fr); }
  div#contentWrapper.ap-cw .ap-prog__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  div#contentWrapper.ap-cw .ap-prog__cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  div#contentWrapper.ap-cw .ap-prog__hero, div#contentWrapper.ap-cw .ap-prog__final { border-radius: 18px; }
  div#contentWrapper.ap-cw .ap-prog__steps { grid-template-columns: minmax(0, 1fr); }
  div#contentWrapper.ap-cw .ap-prog__cta .ap-btn { width: 100%; }
  div#contentWrapper.ap-cw .ap-prog__rates li { padding: 16px; gap: 14px; }
  div#contentWrapper.ap-cw .ap-doc__actions .ap-btn { width: 100%; }
}
/* the company address as checked (and, if Google corrected it, as corrected) */
.aff-addrnote { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: #ECFDF3; color: #05603A; font-size: 15px; line-height: 1.45; }
.aff-addrnote[hidden] { display: none; }

/* touch targets: lone links in their own line and inline notice links get a 40px+ hit area on phones */
@media (max-width: 640px) {
  div#contentWrapper.ap-cw .aff-foot a, div#contentWrapper.ap-cw .ap-page p > a:only-child, div#contentWrapper.ap-cw .ap-outlook__warn a { display: inline-block; padding: 10px 4px; margin: -10px -4px; }
}

/* sign-up wizard, phones: the CUI field and its ANAF button wrap instead of pushing the form wider than the screen (the shared billing form only wraps at 360px) */
.ap-auth__col, .aff-wiz { min-width: 0; }
@media (max-width: 480px) {
  div#contentWrapper.ap-cw .rt-bf-cui { flex-wrap: wrap; }
  div#contentWrapper.ap-cw .rt-bf .rt-bf-lookup { flex: 1 1 100%; width: 100%; }
}
/* selectBoxIt takes keyboard focus on its own span: show the same ring as every other control (WebKit draws none) */
.ap .selectboxit:focus, .ap .selectboxit-focus .selectboxit { outline: 3px solid var(--ap-focus, #4553B8); outline-offset: 2px; }

/* Errors in the portal forms: red, right under the input they are about (before its help text), the input outlined red.
   The legacy div#contentWrapper p rule (css/style.css) greys every paragraph and the field rule above resets the border,
   so both are restored here at the same specificity. js/affiliate_portal.js (RtAffBf) places the billing errors. */
div#contentWrapper.ap-cw .rt-bf p.rt-bf-error { display: flex; margin: 6px 0 0; color: #B42318; font-size: 14px; font-weight: 600; line-height: 1.45; }
div#contentWrapper.ap-cw .rt-bf p.rt-bf-error[hidden] { display: none; }
div#contentWrapper.ap-cw .rt-bf p.aff-bf-err + .rt-bf-help { margin-top: 4px; }
div#contentWrapper.ap-cw .rt-bf .rt-bf-address p.rt-bf-error[data-error-for="address"] { margin: -8px 0 16px; }
div#contentWrapper.ap-cw .rt-bf input.rt-bf-input[aria-invalid="true"],
div#contentWrapper.ap-cw .rt-bf select.rt-bf-input[aria-invalid="true"],
div#contentWrapper.ap-cw input.rt-auth__input[aria-invalid="true"] { border-color: #B42318; }
div#contentWrapper.ap-cw .rt-bf input.rt-bf-input[aria-invalid="true"]:focus,
div#contentWrapper.ap-cw input.rt-auth__input[aria-invalid="true"]:focus { border-color: #B42318; box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18); }
div#contentWrapper.ap-cw .aff-field p.aff-err + .rt-auth__hint { margin-top: 4px; }
/* IBAN note from js/iban_fill.js ("Banca Transilvania · BTRLRO22 (din IBAN)"): the field's hint style, a warning (merged bank,
   BIC of another bank) in amber; the field's own help sits right under it */
div#contentWrapper.ap-cw .aff-field small.aff-iban-note { display: block; margin-top: 6px !important; color: var(--au-ink-2, #344054) !important; }
div#contentWrapper.ap-cw .aff-field small.aff-iban-note[hidden] { display: none; }
div#contentWrapper.ap-cw .aff-field small.aff-iban-note[data-warn] { color: #B54708 !important; }
div#contentWrapper.ap-cw .aff-field small.aff-iban-note + small.rt-auth__hint { margin-top: 2px !important; }
