/* ── Aff link page — light theme ── */
.aff-page {
  position: relative;
  overflow: hidden;
  padding: 28px 14px 52px;
  color: #3f3f46;
  background:
    radial-gradient(circle at 12% 0%, rgba(124, 58, 237, 0.10), transparent 36%),
    radial-gradient(circle at 90% 8%, rgba(251, 191, 36, 0.12), transparent 40%),
    linear-gradient(180deg, #f0f0f0 0%, #f8f5ff 48%, #f0f0f0 100%);
}

.aff-wrap {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
}

/* ── Hero ── */
.aff-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 26px 20px 22px;
  margin-bottom: 16px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(192, 132, 252, 0.18), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 16px 40px rgba(76, 29, 149, 0.10);
}

.aff-hero__media-wrap {
  display: flex;
  justify-content: center;
}

.aff-hero__media {
  display: block;
  width: min(100%, 260px);
  height: auto;
  margin: 0 auto 14px;
  filter: drop-shadow(0 12px 22px rgba(76, 29, 149, 0.22));
}

.aff-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.aff-eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.16);
  color: #7c3aed;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.aff-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 45%, #db2777 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.aff-hero__lead {
  margin: 0 auto;
  max-width: 560px;
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
}

/* ── Rate highlight ── */
.aff-rate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 18px auto 4px;
  max-width: 460px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7e0 0%, #fff1c9 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.14);
}

.aff-rate__num {
  flex: 0 0 auto;
  font-size: clamp(2.4rem, 10vw, 3.3rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.aff-rate__text {
  text-align: left;
}

.aff-rate__text b {
  display: block;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: #92400e;
  line-height: 1.35;
}

.aff-rate__text span {
  display: block;
  margin-top: 3px;
  font-size: var(--fs-sm);
  color: #b45309;
  line-height: 1.5;
}

/* ── Main grid: promo + detail ── */
.aff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ── Side column (promo + CTA) ── */
.aff-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Promo banner (คลิกได้) ── */
.aff-promo {
  display: block;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 12px 30px rgba(76, 29, 149, 0.10);
  transition: transform 0.18s, box-shadow 0.18s;
}

.aff-side-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 18px 20px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 80% 70% at 50% 0%, rgba(192, 132, 252, 0.16), transparent 65%),
    linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 12px 30px rgba(76, 29, 149, 0.06);
}

.aff-side-cta b {
  font-size: var(--fs-lg);
  font-weight: var(--fw-extrabold);
  color: var(--color-heading);
  line-height: 1.35;
}

.aff-side-cta span {
  margin: 5px 0 14px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--color-text-muted);
}

.aff-side-cta .aff-cta__btn {
  width: 100%;
}

.aff-promo:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(76, 29, 149, 0.16);
}

.aff-promo__img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Cards ── */
.aff-card {
  padding: 24px 20px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(124, 58, 237, 0.10);
  box-shadow: 0 12px 30px rgba(76, 29, 149, 0.06);
}

.aff-grid .aff-card {
  margin-bottom: 0;
}

.aff-card--detail h2 {
  text-align: left;
}

.aff-card h2 {
  margin: 0 0 14px;
  font-size: clamp(var(--fs-lg), 3.4vw, var(--fs-2xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  color: var(--color-heading);
  text-align: center;
}

.aff-card p {
  margin: 0 0 12px;
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
  word-break: keep-all;
}

.aff-card p:last-child {
  margin-bottom: 0;
}

.aff-card strong {
  color: #7c3aed;
  font-weight: var(--fw-bold);
}

/* ── Example box ── */
.aff-example {
  margin-top: 16px;
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #faf8ff 0%, #f3ecff 100%);
  border: 1px dashed rgba(124, 58, 237, 0.35);
}

.aff-example__title {
  margin: 0 0 10px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: #7c3aed;
}

.aff-example ul {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: var(--fs-sm);
  line-height: 1.8;
  color: var(--color-text);
}

.aff-example li {
  margin-bottom: 6px;
}

.aff-example li:last-child {
  margin-bottom: 0;
}

.aff-example strong {
  color: #b45309;
}

/* ── Perks ── */
.aff-perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.aff-perk {
  padding: 14px 8px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(160deg, #fff7e0, #fff1c9);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.aff-perk b {
  display: block;
  font-size: var(--fs-md);
  font-weight: var(--fw-extrabold);
  color: #b45309;
  line-height: 1.25;
}

.aff-perk span {
  display: block;
  margin-top: 3px;
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: #92400e;
}

/* ── Steps ── */
.aff-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.aff-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 18px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(160deg, #faf8ff, #f3ecff);
  border: 1px solid rgba(124, 58, 237, 0.12);
  box-shadow: 0 4px 14px rgba(76, 29, 149, 0.05);
  overflow: visible;
}

.aff-step__no {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

.aff-step b {
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--color-heading);
  line-height: 1.35;
}

.aff-step__desc {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ── Highlight band ── */
.aff-highlight {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #faf5ff 0%, #f3ecff 100%);
  border: 1px solid rgba(124, 58, 237, 0.16);
}

.aff-highlight__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.3);
}

.aff-highlight__icon svg {
  width: 24px;
  height: 24px;
}

.aff-highlight__text b {
  display: block;
  margin-bottom: 3px;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--color-heading);
  line-height: 1.4;
}

.aff-highlight__text span {
  display: block;
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--color-text-muted);
}

.aff-highlight__text strong {
  color: #b45309;
  font-weight: var(--fw-bold);
}

/* ── CTA ── */
.aff-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
  margin-bottom: 28px;
}

.aff-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 14px;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
}

.aff-cta__btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.aff-cta__btn--login {
  border: none;
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 45%, #db2777 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.32);
}

.aff-cta__btn--login:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.aff-cta__btn--register {
  background: #fff;
  color: #6d28d9;
  border: 1.5px solid rgba(124, 58, 237, 0.35);
  box-shadow: 0 4px 14px rgba(76, 29, 149, 0.06);
}

.aff-cta__btn--register:hover {
  background: #faf5ff;
  transform: translateY(-1px);
}

.aff-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.22);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: #047857;
  text-align: center;
}

@media (min-width: 600px) {
  .aff-steps {
    grid-template-columns: repeat(4, 1fr);
  }

  .aff-cta {
    flex-direction: row;
  }

  .aff-cta__btn {
    flex: 1 1 0;
  }
}

/* ── Desktop: 2-column hero + grid ── */
@media (min-width: 860px) {
  .aff-page {
    padding: 34px 20px 60px;
  }

  .aff-hero {
    display: grid;
    grid-template-columns: minmax(0, 300px) 1fr;
    align-items: center;
    gap: 28px;
    text-align: left;
    padding: 34px 36px;
  }

  .aff-hero__media {
    width: 100%;
    max-width: 300px;
    margin: 0;
  }

  .aff-hero__copy {
    align-items: flex-start;
  }

  .aff-hero h1 {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
  }

  .aff-hero__lead {
    margin: 0;
  }

  .aff-rate {
    margin: 20px 0 0;
  }

  .aff-grid {
    grid-template-columns: minmax(0, 360px) 1fr;
    align-items: stretch;
  }

  .aff-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
  }

  .aff-side-cta {
    flex: 1;
    justify-content: flex-start;
  }

  .aff-side-cta .aff-cta__btn {
    margin-top: auto;
  }
}
