/*
 * Tiendy Partners (/partners). Hand-written, no build step.
 * Signature element: the commission bar, a full block for month 1 and a
 * half-width, half-tone block for month 2 (100% + 50%).
 */
:root {
  --ink: #1E1B4B;
  --paper: #F6F7FB;
  --surface: #FFFFFF;
  --line: #E3E5F0;
  --line-strong: #C7CAE0;
  --text-2: #4A4E6B;
  --text-3: #5B5F7A;
  --month1: #4F46E5;
  --month2: #A5B4FC;
  --tint: #EEF0FF;
  --paid: #0E7A55;
  --pending: #8A5D0B;
  --danger: #B42318;
  --danger-tint: #FEF3F2;
  --display: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text: 'Plus Jakarta Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: #4338CA; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--month2); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.p-header { max-width: 1120px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.p-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 500; font-size: 20px; line-height: 1; }
.p-brand img { display: block; width: auto; height: 26px; }
.p-brand span { font-weight: 500; color: var(--month1); }
.p-header--panel { max-width: none; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0; }
.p-header--panel .p-header__inner { max-width: 1008px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; width: 100%; }
.p-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.p-nav a { padding: 10px 14px; border-radius: 8px; text-decoration: none; font-weight: 500; font-size: 15px; color: var(--text-2); }
.p-nav a[aria-current="page"] { font-weight: 700; color: var(--ink); background: var(--tint); }
.p-logout { font-size: 14px; color: var(--text-2); }

/* Layout */
.p-main { max-width: 1120px; margin: 0 auto; padding: 24px 24px 80px; }
.p-main--panel { max-width: 1008px; padding-top: 40px; display: flex; flex-direction: column; gap: 56px; }
.p-main--narrow { max-width: 460px; padding-top: 48px; }
.p-footer { border-top: 1px solid var(--line); padding: 24px; text-align: center; font-size: 14px; color: var(--text-3); }

/* Type */
.p-h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(38px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.02em; max-width: 14ch; }
.p-h1--page { font-size: 30px; font-weight: 700; max-width: none; letter-spacing: 0; line-height: 1.2; }
.p-h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.15; }
.p-h2--sm { font-size: 22px; }
.p-lead { margin: 24px 0 0; font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 52ch; }
.p-muted { color: var(--text-2); }
.p-small { font-size: 14px; color: var(--text-3); }

/* Landing hero */
.p-hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; padding-top: 32px; }
.p-hero__copy { flex: 999 1 520px; min-width: 0; }
.p-example { margin-top: 48px; max-width: 560px; }
.p-example__intro { margin: 0 0 12px; font-size: 15px; color: var(--text-2); }
.p-example__total { margin: 16px 0 0; font-family: var(--display); font-weight: 700; font-size: 28px; }
.p-example__total span { font-family: var(--text); font-weight: 500; font-size: 16px; color: var(--text-2); }

/* The commission bar */
.p-bar { display: flex; gap: 6px; align-items: stretch; }
.p-bar__m1, .p-bar__m2 { min-height: 88px; padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between; }
.p-bar__m1 { flex: 2 1 0; background: var(--month1); color: #FFFFFF; border-radius: 12px 4px 4px 12px; }
.p-bar__m2 { flex: 1 1 0; background: var(--month2); color: var(--ink); border-radius: 4px 12px 12px 4px; padding-inline: 14px; }
.p-bar__label { font-size: 14px; font-weight: 600; }
.p-bar__amount { font-family: var(--display); font-weight: 700; font-size: 30px; font-variant-numeric: tabular-nums; }
.p-bar__m2 .p-bar__amount { font-size: 24px; }

/* Mini bar in ledgers: 40px + 20px */
.p-mini { display: inline-flex; gap: 3px; vertical-align: middle; }
.p-mini__m1, .p-mini__m2 { display: inline-block; height: 16px; border-radius: 3px; }
.p-mini__m1 { width: 40px; }
.p-mini__m2 { width: 20px; }
.p-mini__m1.is-on { background: var(--month1); }
.p-mini__m2.is-on { background: var(--month2); }
.p-mini .is-off { border: 1.5px dashed #8C90AE; }
.p-mini .is-void { background: var(--line); }

/* Forms */
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.p-form { display: flex; flex-direction: column; gap: 18px; }
.p-join { flex: 1 1 380px; min-width: 0; }
.p-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.p-field__hint { font-weight: 400; color: var(--text-3); }
.p-input { font: inherit; font-weight: 400; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; }
.p-input[aria-invalid="true"] { border-color: var(--danger); }
.p-error { margin: 0; font-size: 13px; font-weight: 600; color: var(--danger); }
.p-alert { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--danger-tint); color: var(--danger); font-size: 14px; font-weight: 600; }
.p-notice { margin: 0; padding: 12px 14px; border-radius: 10px; background: #ECFDF3; color: var(--paid); font-size: 14px; font-weight: 600; }
.p-choice { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.p-choice legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.p-choice__row { display: flex; gap: 8px; flex-wrap: wrap; }
.p-choice__option { flex: 1 1 140px; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; font-size: 15px; cursor: pointer; border: 1.5px solid var(--line-strong); background: var(--surface); }
.p-choice__option:has(input:checked) { border-color: var(--month1); background: var(--tint); }
.p-choice__option input, .p-check input { accent-color: var(--month1); width: 18px; height: 18px; margin: 0; flex: none; }
.p-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.p-check input { margin-top: 2px; }
.p-payout-fields[hidden] { display: none; }

/* Buttons */
.p-btn { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 20px; border: 0; border-radius: 10px; font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.p-btn--primary { background: var(--ink); color: #FFFFFF; }
.p-btn--primary:hover { background: #2E2A6B; color: #FFFFFF; }
.p-btn--brand { background: var(--month1); color: #FFFFFF; }
.p-btn--outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); }
.p-btn--block { width: 100%; }

/* Steps and rules */
.p-section { margin-top: 96px; }
.p-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.p-steps li { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--ink); padding-top: 16px; }
.p-steps__n { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--month1); }
.p-steps strong { font-size: 17px; }
.p-steps span:last-child { font-size: 15px; line-height: 1.55; color: var(--text-2); }
.p-rules { display: flex; flex-wrap: wrap; gap: 48px; }
.p-rules__intro { flex: 1 1 300px; }
.p-rules dl { flex: 2 1 480px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 40px; }
.p-rules dt { font-weight: 700; font-size: 16px; }
.p-rules dd { margin: 6px 0 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }

/* Panel: referral link hero */
.p-link { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-top: 20px; }
.p-link__field { flex: 1 1 420px; min-width: 0; display: flex; align-items: center; background: var(--surface); border: 2px solid var(--ink); border-radius: 12px; padding: 0 18px; min-height: 64px; }
.p-link__field input { border: 0; outline: none; background: transparent; width: 100%; font-family: var(--display); font-weight: 600; font-size: clamp(18px, 2.4vw, 26px); color: var(--ink); }
.p-link__copy { min-height: 64px; padding: 0 26px; }
.p-link__copy.is-copied { background: var(--paid); }

/* Panel: funnel */
.p-funnel { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; }
.p-funnel li { flex: 1 1 180px; padding: 4px 24px; display: flex; flex-direction: column; gap: 6px; border-left: 1px solid #D6D9E8; }
.p-funnel li:first-child { padding-left: 0; border-left: 0; }
.p-funnel__label { font-size: 15px; color: var(--text-2); }
.p-funnel__value { font-family: var(--display); font-weight: 700; font-size: 44px; font-variant-numeric: tabular-nums; line-height: 1; }
.p-funnel__value--money { color: var(--month1); }
.p-funnel__rate { font-size: 13px; color: var(--text-3); }

/* Panel: next payout band */
.p-payout { background: var(--ink); color: #FFFFFF; border-radius: 16px; padding: 28px; display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; }
.p-payout__body { flex: 1 1 360px; display: flex; flex-direction: column; gap: 6px; }
.p-payout__label { font-size: 15px; color: var(--line-strong); }
.p-payout__amount { font-family: var(--display); font-weight: 700; font-size: 40px; font-variant-numeric: tabular-nums; }
.p-payout__text { font-size: 15px; color: var(--line); line-height: 1.5; }
.p-payout__meter { height: 10px; border-radius: 99px; background: #3B3770; overflow: hidden; max-width: 420px; }
.p-payout__meter span { display: block; height: 100%; background: var(--month2); }
.p-payout a { flex: 0 0 auto; color: #FFFFFF; font-weight: 600; font-size: 15px; padding: 12px 18px; border: 1.5px solid #6B67A8; border-radius: 10px; text-decoration: none; }

/* Tables */
.p-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.p-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 15px; }
.p-table th { text-align: left; color: var(--text-3); font-size: 13px; font-weight: 600; padding: 14px 12px; }
.p-table td { padding: 16px 12px; border-top: 1px solid #ECEEF5; }
.p-table th:first-child, .p-table td:first-child { padding-left: 20px; }
.p-table th:last-child, .p-table td:last-child { padding-right: 20px; }
.p-table .num { text-align: right; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-status { font-size: 14px; font-weight: 600; }
.p-status--paid { color: var(--paid); }
.p-status--pending { color: var(--pending); }
.p-status--muted { color: var(--text-3); }
.p-empty { padding: 32px 20px; text-align: center; color: var(--text-2); }
.p-legend { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); align-items: center; }
.p-legend span { display: flex; gap: 8px; align-items: center; }

/* Panel: shared helpers */
.p-measure { margin: 8px 0 0; max-width: 62ch; }
.p-after { margin: 12px 0 0; }
.p-ink { color: var(--ink); font-weight: 600; }
.p-break { overflow-wrap: anywhere; margin: 6px 0 0; }
.p-h2--xs { font-family: var(--text); font-size: 15px; font-weight: 700; }
.p-hint { margin: 20px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--tint); color: var(--ink); font-size: 15px; max-width: 72ch; }
.p-section-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.p-section-head .p-legend { margin: 0; }
.p-table tbody th { padding: 16px 12px; border-top: 1px solid #ECEEF5; color: var(--ink); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.p-table tbody th:first-child { padding-left: 20px; }
.p-btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.p-btn--outline:hover { border-color: var(--ink); }
.p-btn.is-copied { background: var(--paid); border-color: var(--paid); color: #FFFFFF; }

/* Panel: materials */
.p-banners { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.p-banner { margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.p-banner--wide { grid-column: 1 / -1; }
.p-banner__preview { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.p-banner__preview img { display: block; max-width: 100%; height: auto; }
.p-banner__body { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.p-snippet { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); width: 100%; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--paper); resize: vertical; }
.p-snippet--text { font-family: var(--text); font-size: 15px; color: var(--ink); background: var(--surface); }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.p-texts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.p-text { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.p-split { display: flex; flex-wrap: wrap; gap: 12px 48px; }
.p-split > div:first-child { flex: 1 1 240px; }
.p-split__body { flex: 2 1 420px; }
.p-split__body p { margin: 0; max-width: 62ch; }
.p-list { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.p-steps--guide { margin-top: 20px; }
.p-facts { margin: 40px 0 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px 32px; }
.p-facts dt { font-weight: 700; font-size: 15px; }
.p-facts dd { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }

/* Panel: account */
.p-account { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; }
.p-account__form { flex: 1 1 420px; max-width: 560px; min-width: 0; }
.p-account__side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 24px; padding-top: 8px; }
.p-account__side p { margin: 4px 0 0; }

@media (max-width: 640px) {
  .p-hero { gap: 40px; padding-top: 8px; }
  .p-section { margin-top: 64px; }
  .p-card { padding: 20px; }
  .p-funnel li { padding: 12px 0; border-left: 0; border-top: 1px solid #D6D9E8; flex-basis: 100%; }
  .p-funnel li:first-child { border-top: 0; }
  .p-funnel__value { font-size: 36px; }
  .p-payout { padding: 22px; }
  .p-payout__amount { font-size: 32px; }
  .p-banners { grid-template-columns: 1fr; }
  .p-facts { padding: 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  .p-link__copy, .p-btn--sm { transition: background-color 0.2s ease, border-color 0.2s ease; }
}
