/* ── Carrot Labs — Affiliate Program styles ───────────────────────
   Uses shared.css design tokens (--carrot, --black, --white,
   --gray-light, --gray-border, --text-muted, --text-soft, --green).
   ------------------------------------------------------------------ */

/* ── Shared scaffolding ── */
.aff-wrap { max-width: 1100px; margin: 0 auto; }
.aff-section { margin: 0 auto 56px; }
.aff-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--carrot); margin-bottom: 12px; }
.aff-section-title { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.aff-section-sub { font-size: 15px; color: var(--text-soft); line-height: 1.7; max-width: 620px; margin-bottom: 28px; }
.aff-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(232,98,26,0.1); color: var(--carrot-dark); border-radius: 9999px; padding: 4px 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Landing: hero ── */
.aff-hero { text-align: center; padding: 56px 20px 40px; max-width: 760px; margin: 0 auto; }
.aff-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.08; letter-spacing: -1px; margin: 14px 0 18px; }
.aff-hero p { font-size: 1.1rem; color: var(--text-soft); line-height: 1.65; margin-bottom: 28px; }
.aff-hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.aff-hero-stats { display: flex; gap: 36px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.aff-hero-stat { text-align: center; }
.aff-hero-stat .n { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.aff-hero-stat .l { font-size: 0.8rem; color: var(--text-muted); }

/* ── Commission ladder (milestone progression, not pricing) ── */
.aff-ladder { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.aff-ladder-step { position: relative; background: var(--white); border: 1.5px solid var(--gray-border); border-radius: 16px; padding: 22px 24px; text-align: center; overflow: hidden; }
.aff-ladder-step.is-mid { border-color: rgba(232,98,26,0.45); }
.aff-ladder-step.is-top { border-color: var(--carrot); background: linear-gradient(180deg, #fff 0%, #fff7f2 100%); box-shadow: 0 12px 36px rgba(232,98,26,0.10); }
.aff-ladder-rate { font-size: 2.4rem; font-weight: 800; letter-spacing: -1px; line-height: 1; color: var(--black); }
.aff-ladder-step.is-top .aff-ladder-rate { color: var(--carrot); }
.aff-ladder-rate span { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); margin-left: 3px; }
.aff-ladder-name { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); margin-top: 8px; }
.aff-ladder-note { font-size: 0.88rem; color: var(--text-soft); margin-top: 8px; line-height: 1.5; max-width: 360px; margin-left: auto; margin-right: auto; }
.aff-ladder-arrow { color: var(--carrot); font-size: 1.3rem; font-weight: 700; text-align: center; line-height: 1; transform: rotate(90deg); }
@media (min-width: 760px) {
  .aff-ladder { flex-direction: row; align-items: stretch; gap: 6px; }
  .aff-ladder-step { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .aff-ladder-arrow { transform: none; align-self: center; padding: 0 4px; }
}
.aff-ratchet-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 18px; text-align: center; }

/* ── Dual-sided callout ── */
.aff-dual { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border-radius: 18px; padding: 40px 32px; text-align: center; color: #fff; }
.aff-dual h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 800; margin-bottom: 12px; }
.aff-dual p { color: rgba(255,255,255,0.7); font-size: 1.02rem; line-height: 1.6; max-width: 560px; margin: 0 auto; }
.aff-dual .hl { color: #ffb27a; font-weight: 700; }

/* ── Vanity benefits ── */
.aff-vanity { background: var(--gray-light); border: 1px solid var(--gray-border); border-radius: 16px; padding: 28px 26px; }
.aff-vanity-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.aff-vanity-head h3 { font-size: 1.15rem; font-weight: 700; }
.aff-vanity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.aff-vanity-item { background: var(--white); border: 1px solid var(--gray-border); border-radius: 12px; padding: 20px; }
.aff-vanity-item .ico { font-size: 1.5rem; margin-bottom: 8px; }
.aff-vanity-item h4 { font-size: 0.98rem; font-weight: 700; margin-bottom: 6px; }
.aff-vanity-item p { font-size: 0.86rem; color: var(--text-soft); line-height: 1.55; }

/* ── How it works ── */
.aff-how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.aff-how-step { background: var(--white); border: 1px solid var(--gray-border); border-radius: 14px; padding: 24px 20px; text-align: center; }
.aff-how-num { width: 38px; height: 38px; border-radius: 50%; background: var(--carrot); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.aff-how-step h4 { font-size: 0.98rem; font-weight: 700; margin-bottom: 6px; }
.aff-how-step p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; }

/* ── FAQ ── */
.aff-faq { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.aff-faq details { border: 1px solid var(--gray-border); border-radius: 12px; padding: 0 18px; background: var(--white); }
.aff-faq summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 0.95rem; display: flex; justify-content: space-between; align-items: center; }
.aff-faq summary::-webkit-details-marker { display: none; }
.aff-faq summary::after { content: '+'; color: var(--text-muted); font-size: 1.3rem; font-weight: 400; }
.aff-faq details[open] summary::after { content: '–'; }
.aff-faq details p { padding: 0 0 16px; font-size: 0.9rem; color: var(--text-soft); line-height: 1.65; }

/* ── Compliance ── */
.aff-compliance { background: rgba(255,200,50,0.07); border: 1px solid rgba(255,200,50,0.25); border-radius: 14px; padding: 24px 26px; }
.aff-compliance h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.aff-compliance ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.aff-compliance li { font-size: 0.88rem; color: var(--text-soft); line-height: 1.55; display: flex; gap: 9px; align-items: flex-start; }
.aff-compliance li::before { content: '→'; color: var(--text-muted); flex-shrink: 0; }
.aff-compliance a { color: var(--carrot); font-weight: 600; }

/* ── Auth (signup / login) ── */
.aff-auth-wrap { max-width: 460px; margin: 40px auto 60px; }
.aff-auth-card { background: var(--white); border: 1px solid var(--gray-border); border-radius: 18px; padding: 36px 32px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.aff-auth-card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.aff-auth-card .lead { font-size: 0.92rem; color: var(--text-soft); margin-bottom: 24px; line-height: 1.55; }
.aff-field { margin-bottom: 16px; }
.aff-field label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.aff-field input, .aff-field select { width: 100%; padding: 11px 13px; border: 1.5px solid var(--gray-border); border-radius: 9px; font-family: inherit; font-size: 0.92rem; background: var(--white); color: var(--black); }
.aff-field input:focus, .aff-field select:focus { outline: none; border-color: var(--carrot); }
.aff-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .aff-field-row { grid-template-columns: 1fr; } }
.aff-check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 0.84rem; color: var(--text-soft); line-height: 1.5; }
.aff-check input { margin-top: 3px; accent-color: var(--carrot); flex-shrink: 0; }
.aff-check a { color: var(--carrot); font-weight: 600; }
.aff-error { color: #b91c1c; font-size: 0.85rem; margin-bottom: 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px; }
.aff-auth-submit { width: 100%; margin-top: 8px; justify-content: center; }
.aff-auth-foot { text-align: center; font-size: 0.86rem; color: var(--text-muted); margin-top: 18px; }
.aff-auth-foot a { color: var(--carrot); font-weight: 600; }
.aff-forgot { font-size: 0.82rem; color: var(--text-muted); }
.aff-forgot a { color: var(--carrot); }

/* Social / OAuth login buttons — icon pinned left, label centered */
.aff-oauth-btn {
  width: 100%; position: relative; display: flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 40px; border-radius: 8px; border: 1px solid var(--gray-border);
  background: var(--white); font-size: 0.875rem; font-weight: 500; cursor: pointer;
  font-family: inherit; color: var(--black); transition: background 0.12s, border-color 0.12s;
  margin-bottom: 10px; letter-spacing: 0; box-sizing: border-box;
}
.aff-oauth-btn:last-of-type { margin-bottom: 0; }
.aff-oauth-btn:hover { background: #fafafa; border-color: #b8b8b8; }
.aff-oauth-btn:active { background: #f3f4f6; }
.aff-oauth-btn svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  display: block; flex-shrink: 0;
}

/* "or" divider */
.aff-or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 0.8rem; letter-spacing: 0.03em; }
.aff-or::before, .aff-or::after { content: ''; flex: 1; height: 1px; background: var(--gray-border); }

/* Phone login */
.aff-phone-toggle-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1.5px solid var(--gray-border);
  background: none; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  font-family: inherit; color: var(--text-soft); margin-top: 10px;
  transition: background 0.13s, color 0.13s;
}
.aff-phone-toggle-btn:hover { background: var(--gray-light); color: var(--black); }
.aff-phone-panel { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--gray-border); }
.aff-otp-row { display: flex; gap: 8px; }
.aff-otp-row input { flex: 1; }
.aff-otp-row button { white-space: nowrap; }
.aff-ok-msg { color: #166534; font-size: 0.85rem; background: #dcfce7; border-radius: 8px; padding: 10px 12px; margin-top: 12px; }

/* ── Dashboard ── */
.aff-dash { display: grid; grid-template-columns: 1fr; gap: 28px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 900px) { .aff-dash { grid-template-columns: 220px 1fr; align-items: start; } }
.aff-dash-nav { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 900px) { .aff-dash-nav { position: sticky; top: 84px; flex-direction: column; } }
.aff-tab { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-soft); padding: 9px 14px; border-radius: 9px; background: none; border: none; cursor: pointer; text-align: left; font-family: inherit; text-decoration: none; line-height: 1.3; }
.aff-tab:hover { background: var(--gray-light); color: var(--black); }
.aff-tab.active { background: var(--gray-light); color: var(--black); }
.aff-dash-main { display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.aff-card { background: var(--white); border: 1.5px solid var(--gray-border); border-radius: 16px; padding: 26px 24px; }
.aff-card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.aff-card .card-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 18px; }

/* dashboard header */
.aff-dash-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.aff-dash-header h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.aff-tier-badge { background: var(--black); color: #fff; border-radius: 9999px; padding: 8px 16px; font-size: 0.85rem; font-weight: 700; }
.aff-progress { margin-top: 18px; }
.aff-progress-track { height: 8px; background: var(--gray-light); border-radius: 9999px; overflow: hidden; }
.aff-progress-fill { height: 100%; background: linear-gradient(90deg, var(--carrot), var(--carrot-dark)); border-radius: 9999px; transition: width 0.5s; }
.aff-progress-label { font-size: 0.82rem; color: var(--text-soft); margin-top: 8px; }

/* code box */
.aff-codebox { display: grid; gap: 16px; }
@media (min-width: 620px) { .aff-codebox { grid-template-columns: 1fr 1fr; } }
.aff-code-row { background: var(--gray-light); border: 1px solid var(--gray-border); border-radius: 12px; padding: 16px 18px; }
.aff-code-row .lbl { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.aff-code-val { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 1.05rem; font-weight: 700; word-break: break-all; margin-bottom: 12px; }
.aff-code-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.aff-copy-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--black); color: #fff; border-radius: 9999px; padding: 8px 16px; font-size: 0.82rem; font-weight: 600; cursor: pointer; border: none; font-family: inherit; transition: background 0.15s; }
.aff-copy-btn:hover { background: #222; }
.aff-copy-btn.copied { background: var(--green); }
.aff-copy-btn:disabled { background: var(--gray-border); color: var(--text-muted); cursor: not-allowed; }

/* stat grid */
.aff-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.aff-stat-card { background: var(--white); border: 1px solid var(--gray-border); border-radius: 12px; padding: 18px 18px; }
.aff-stat-card .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px; }
.aff-stat-card .k { font-size: 0.82rem; color: var(--text-soft); margin-top: 2px; }
.aff-stat-card .as-of { font-size: 0.68rem; color: var(--text-muted); margin-top: 8px; }

/* chart */
.aff-chart-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.aff-chart-ranges { display: flex; gap: 6px; }
.chart-range { font-size: 0.8rem; font-weight: 600; padding: 6px 12px; border-radius: 9999px; border: 1px solid var(--gray-border); background: var(--white); color: var(--text-soft); cursor: pointer; font-family: inherit; }
.chart-range.active { background: var(--black); color: #fff; border-color: var(--black); }
.aff-chart-wrap { position: relative; height: 280px; }

/* tables */
.aff-table-scroll { overflow-x: auto; }
.aff-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 480px; }
.aff-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; padding: 10px 12px; border-bottom: 1.5px solid var(--gray-border); }
.aff-table td { padding: 12px; border-bottom: 1px solid var(--gray-border); color: var(--text-soft); }
.aff-table tr:last-child td { border-bottom: none; }

/* status badges */
.aff-badge { display: inline-block; border-radius: 9999px; padding: 3px 11px; font-size: 0.74rem; font-weight: 700; text-transform: capitalize; }
.aff-badge.is-paid { background: #dcfce7; color: #166534; }
.aff-badge.is-available { background: rgba(232,98,26,0.12); color: var(--carrot-dark); }
.aff-badge.is-pending { background: #fef3c7; color: #92400e; }
.aff-badge.is-reversed { background: var(--gray-light); color: var(--text-muted); text-decoration: line-through; }

/* payout summary */
.aff-payout-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.aff-payout-cell { background: var(--gray-light); border-radius: 12px; padding: 16px; }
.aff-payout-cell .v { font-size: 1.3rem; font-weight: 800; }
.aff-payout-cell .k { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

/* assets */
.aff-asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.aff-asset { background: var(--gray-light); border: 1px solid var(--gray-border); border-radius: 12px; padding: 18px; }
.aff-asset-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; }
.aff-asset-text { font-size: 0.84rem; color: var(--text-soft); line-height: 1.55; margin-bottom: 12px; }
.aff-asset-note { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px; }

/* FTC strip */
.aff-ftc-strip { background: var(--black); color: #fff; border-radius: 14px; padding: 20px 24px; }
.aff-ftc-strip .k { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); font-weight: 700; margin-bottom: 8px; }
.aff-ftc-strip #ftc-line { font-size: 0.92rem; font-weight: 500; line-height: 1.5; }

/* settings */
.aff-settings-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 700px) { .aff-settings-grid { grid-template-columns: 1fr 1fr; } }
.aff-inline-msg { font-size: 0.84rem; margin-top: 10px; border-radius: 8px; padding: 9px 12px; }
.aff-inline-msg.is-ok { background: #dcfce7; color: #166534; }
.aff-inline-msg.is-err { background: #fef2f2; color: #b91c1c; }
.aff-logout-row { margin-top: 8px; }
