/*
 * Affiliate area of the customer panel (and the public program page).
 * Builds on .box / .box-back / .btn-main / .btn-gray of the theme. The brand colour is always var(--base-color).
 * A theme may ship its own copy as user/css/affiliate.css under its assets folder; otherwise the module prints this file.
 */

.af-head { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; width: 100%; }
.af-head h3 { margin: 0; }
.af-head small { color: #5f6368; }

.af-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; width: 100%; }
.af-tabs a { border: 1px solid #dadce0; border-radius: 50rem; color: #3c4043; font-size: 13px; padding: 5px 14px; text-decoration: none; }
.af-tabs a:hover { background: #f1f3f4; }
.af-tabs a.active { background: var(--base-color); border-color: var(--base-color); color: #fff; }
.af-tabs .bi { margin-right: 4px; }

.af-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; width: 100%; }
.af-stat { background: #fff; border: 1px solid #e8eaed; border-radius: 14px; padding: 14px 16px; }
.af-stat span { color: #5f6368; display: block; font-size: 13px; }
.af-stat strong { display: block; font-size: 1.55rem; font-weight: 600; line-height: 1.25; }
.af-stat small { color: #80868b; }
.af-stat.af-hot { border-color: color-mix(in srgb, var(--base-color) 40%, #e8eaed); }
.af-stat.af-hot strong { color: var(--base-color); }

.af-card { background: #fff; border: 1px solid #e8eaed; border-radius: 14px; margin-bottom: 14px; padding: 16px 18px; }
.af-card h5 { font-size: 1rem; font-weight: 600; margin: 0 0 10px; }
.af-card h5 .bi { color: var(--base-color); margin-right: 6px; }
.af-muted { color: #5f6368; font-size: 13px; }

.af-link { align-items: stretch; display: flex; gap: 8px; }
.af-link input { background: #f8f9fa; border: 1px solid #dadce0; border-radius: 10px; flex: 1; font-family: monospace; font-size: 13px; min-width: 0; padding: 8px 12px; }
.af-copy { white-space: nowrap; }

.af-pill { border-radius: 50rem; display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 12px; white-space: nowrap; }
.af-pill-success { background: #e6f4ea; color: #137333; }
.af-pill-warning { background: #fef7e0; color: #7a5b00; }
.af-pill-danger  { background: #fce8e6; color: #a50e0e; }
.af-pill-dark    { background: #f1f3f4; color: #5f6368; }
.af-pill-main    { background: color-mix(in srgb, var(--base-color) 12%, #fff); color: var(--base-color); }

.af-table { margin: 0; width: 100%; }
.af-table th { border-top: none; color: #5f6368; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.af-table td { font-size: 14px; vertical-align: middle; }
.af-amount { font-weight: 600; white-space: nowrap; }
.af-neg { color: #a50e0e; }

.af-bars { align-items: flex-end; display: grid; gap: 8px; grid-template-columns: repeat(var(--n, 6), 1fr); height: 150px; }
.af-bar { align-items: center; display: flex; flex-direction: column; height: 100%; justify-content: flex-end; }
.af-bar i { background: var(--base-color); border-radius: 6px 6px 0 0; display: block; min-height: 2px; width: 70%; }
.af-bar small { color: #80868b; font-size: 11px; margin-top: 4px; }

.af-steps { counter-reset: af; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.af-step { background: #fff; border: 1px solid #e8eaed; border-radius: 14px; padding: 16px; position: relative; }
.af-step::before { align-items: center; background: var(--base-color); border-radius: 50%; color: #fff; content: counter(af); counter-increment: af; display: flex; font-weight: 600; height: 28px; justify-content: center; margin-bottom: 8px; width: 28px; }
.af-step b { display: block; margin-bottom: 4px; }

.af-creatives { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.af-creative { border: 1px solid #e8eaed; border-radius: 12px; overflow: hidden; }
.af-creative .af-img { align-items: center; background: #f8f9fa; display: flex; justify-content: center; min-height: 120px; padding: 10px; }
.af-creative .af-img img { max-height: 160px; max-width: 100%; }
.af-creative .af-body { padding: 10px 12px; }
.af-creative textarea { background: #f8f9fa; border: 1px solid #dadce0; border-radius: 8px; font-family: monospace; font-size: 12px; height: 70px; width: 100%; }

.af-hero { background: color-mix(in srgb, var(--base-color) 8%, #fff); border-radius: 18px; padding: 34px 28px; text-align: center; }
.af-hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.af-hero p { color: #3c4043; font-size: 1.05rem; margin: 0 auto 18px; max-width: 640px; }
.af-rate { color: var(--base-color); font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.af-btn { background: var(--base-color); border: 0; border-radius: 50rem; color: #fff; display: inline-block; font-weight: 600; padding: 11px 28px; text-decoration: none; transition: filter .15s; }
.af-btn:hover { color: #fff; filter: brightness(.92); }
.af-terms { color: #3c4043; font-size: 14px; max-height: 260px; overflow: auto; white-space: pre-line; }

@media (max-width: 575px) {
  .af-link { flex-direction: column; }
  .af-hero { padding: 24px 16px; }
}
