/* ============================================================
   AFF — Homepage  v1
   (assets/home.css)
   ============================================================ */

/* ── Hero ───────────────────────────────────────────────────── */
.aff-hero {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 56px 24px 48px;
  position: relative;
  overflow: hidden;
}
.aff-hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.4) 40%, rgba(37,99,235,.6) 50%, rgba(37,99,235,.4) 60%, transparent);
}
.aff-hero__inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 380px;
  gap: 48px; align-items: center;
}
.aff-hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.1px; color: #60a5fa; margin-bottom: 14px;
}
.aff-hero__badge::before {
  content: ''; width: 18px; height: 2px;
  background: #60a5fa; border-radius: 2px; display: block;
}
.aff-hero__title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: clamp(32px, 4vw, 54px); font-weight: 900;
  color: #f8fafc; line-height: 1.08; margin: 0 0 14px; letter-spacing: -.8px;
}
.aff-hero__title span { color: #60a5fa; }
.aff-hero__desc {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px; line-height: 1.7; color: rgba(255,255,255,.5);
  max-width: 480px; margin: 0 0 28px;
}

/* Search bar */
.aff-hero__search {
  display: flex; gap: 0;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; overflow: hidden;
  max-width: 520px;
  transition: border-color .2s, box-shadow .2s;
}
.aff-hero__search:focus-within {
  border-color: rgba(37,99,235,.6);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.aff-hero__search-input {
  flex: 1; background: transparent; border: none; outline: none;
  padding: 13px 18px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px; color: #f8fafc;
}
.aff-hero__search-input::placeholder { color: rgba(255,255,255,.5); }
.aff-hero__search-btn {
  padding: 10px 20px; background: #2563eb; border: none;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background .18s; white-space: nowrap; margin: 4px; border-radius: 8px;
}
.aff-hero__search-btn:hover { background: #1d4ed8; }

/* Stats row */
.aff-hero__stats {
  display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap;
}
.aff-hero__stat {
  display: flex; flex-direction: column; gap: 2px;
}
.aff-hero__stat-n {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 22px; font-weight: 900; color: #f8fafc; line-height: 1;
}
.aff-hero__stat-l {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: rgba(255,255,255,.6);
}

/* Hero brand logos panel */
.aff-hero__brands {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.aff-hero__brand-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none;
  transition: background .18s, border-color .18s, transform .18s;
  cursor: pointer;
}
.aff-hero__brand-card:hover {
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.3);
  transform: translateY(-2px);
}
.aff-hero__brand-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px; font-weight: 900; color: #f8fafc;
}
.aff-hero__brand-name {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.6);
  text-align: center; text-transform: uppercase; letter-spacing: .5px;
}
.aff-hero__brand-count {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 10px; font-weight: 600; color: #60a5fa;
}

/* ── Section shared ─────────────────────────────────────────── */
.aff-home-section {
  max-width: 1200px; margin: 0 auto; padding: 44px 24px;
}
.aff-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px;
}
.aff-section-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 19px; font-weight: 900; color: #0f172a; margin: 0; letter-spacing: -.3px;
}
.aff-section-title span { color: #2563eb; }
.aff-section-link {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 700; color: #2563eb; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  transition: gap .18s;
}
.aff-section-link:hover { gap: 8px; }
.aff-section-divider {
  border: none; border-top: 1px solid #e9edf2; margin: 0;
}

.aff-home-section--tight { padding-top: 0; padding-bottom: 0; }

/* ── Brand grid ─────────────────────────────────────────────── */
.aff-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.aff-brand-tile {
  background: #fff; border: 1px solid #e9edf2; border-radius: 14px;
  padding: 18px 12px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none;
  transition: box-shadow .2s, transform .18s, border-color .2s;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.aff-brand-tile:hover {
  box-shadow: 0 6px 20px rgba(15,23,42,.08);
  transform: translateY(-2px);
  border-color: #bfdbfe;
}
.aff-brand-tile__icon {
  width: 44px; height: 44px; border-radius: 11px;
  background: #eff6ff; border: 1px solid #dbeafe;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 16px; font-weight: 900; color: #2563eb;
  transition: background .15s;
}
.aff-brand-tile:hover .aff-brand-tile__icon { background: #dbeafe; }
.aff-brand-tile__name {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 700; color: #0f172a; text-align: center;
}
.aff-brand-tile__count {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 600; color: #6b7280;
}

/* ── Recent firmware cards ──────────────────────────────────── */
.aff-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.aff-fw-card {
  background: #fff; border: 1px solid #e9edf2; border-radius: 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
  text-decoration: none;
  position: relative; overflow: hidden;
  transition: box-shadow .2s, transform .18s, border-color .2s;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.aff-fw-card::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: transparent; transition: background .2s;
}
.aff-fw-card:hover::before { background: #2563eb; }
.aff-fw-card:hover {
  box-shadow: 0 6px 20px rgba(15,23,42,.08);
  transform: translateY(-2px); border-color: #bfdbfe;
}
.aff-fw-card__top {
  display: flex; align-items: flex-start; gap: 10px;
}
.aff-fw-card__thumb {
  width: 44px; height: 44px; border-radius: 10px;
  background: #f1f5f9; border: 1px solid #e9edf2;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.aff-fw-card__meta { flex: 1; min-width: 0; }
.aff-fw-card__brand {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: #2563eb;
}
.aff-fw-card__title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px; font-weight: 700; color: #0f172a; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0 0;
}
.aff-fw-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid #f1f5f9; padding-top: 10px;
}
.aff-fw-card__date {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11.5px; color: #64748b; font-weight: 500;
}
.aff-fw-card__dl {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 12px; font-weight: 700; color: #2563eb;
  background: #eff6ff; border: 1px solid #dbeafe;
  padding: 4px 12px; border-radius: 99px;
  transition: background .15s, border-color .15s;
}
.aff-fw-card:hover .aff-fw-card__dl { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ── How it works ───────────────────────────────────────────── */
.aff-how { background: #f8f9fb; border-top: 1px solid #e9edf2; border-bottom: 1px solid #e9edf2; }
.aff-how__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
}
.aff-how__step {
  background: #fff; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.aff-how__step:not(:last-child)::after {
  content: ''; position: absolute; right: 0; top: 28px; bottom: 28px;
  width: 1px; background: #e9edf2;
}
.aff-how__num {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: #2563eb;
  display: flex; align-items: center; gap: 8px;
}
.aff-how__num::before {
  content: attr(data-n);
  width: 24px; height: 24px; border-radius: 99px;
  background: #eff6ff; border: 1px solid #dbeafe;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #2563eb;
}
.aff-how__step-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 16px; font-weight: 800; color: #0f172a; margin: 0;
}
.aff-how__step-desc {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px; line-height: 1.65; color: #64748b; margin: 0;
}

/* ── Warning banner ─────────────────────────────────────────── */
.aff-warning-bar {
  background: #fffbeb; border-top: 1px solid #fde68a; border-bottom: 1px solid #fde68a;
  padding: 12px 24px;
}
.aff-warning-bar__inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13px; color: #92400e;
}
.aff-warning-bar__icon { font-size: 16px; flex-shrink: 0; }
.aff-warning-bar strong { font-weight: 800; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .aff-hero__inner { grid-template-columns: 1fr; gap: 32px; }
  /* Brands: full width, centred, more columns on tablet */
  .aff-hero__brands {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    max-width: 100%;
    width: 100%;
    margin-inline: 0;
  }
  .aff-how__grid { grid-template-columns: 1fr; gap: 1px; }
  .aff-how__step::after { display: none; }
}
@media (max-width: 640px) {
  .aff-hero { padding: 36px 16px 32px; }
  .aff-hero__title { font-size: 30px; }
  .aff-hero__brands { grid-template-columns: repeat(3, 1fr); max-width: 100%; }
  .aff-home-section { padding: 32px 14px; }
  .aff-brand-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .aff-recent-grid { grid-template-columns: 1fr; }
}

/* ── Show More button ───────────────────────────────────────── */
.aff-show-more-wrap {
  display: flex; justify-content: center;
  margin-top: 24px;
}
.aff-show-more-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 32px; border-radius: 99px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 13.5px; font-weight: 700; color: #0f172a;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.aff-show-more-btn:hover {
  background: #0f172a; border-color: #0f172a; color: #fff;
  box-shadow: 0 4px 14px rgba(15,23,42,.18);
}
.aff-show-more-btn:hover .aff-show-more-btn__icon { stroke: #fff; }
.aff-show-more-btn:disabled {
  opacity: .6; cursor: not-allowed;
}
.aff-show-more-btn__icon { transition: stroke .18s; stroke: #64748b; }
