/* =====================================================
   Refer & Earn — /refer-and-earn/
   ===================================================== */

.refer-earn {
  --re-ink: #0b1437;
  --re-ink-2: #3a4670;
  --re-mute: #6b7390;
  --re-line: #e3e7f5;
  --re-card: #ffffff;
  --re-accent: #ff4600;
  --re-accent-2: #ff8a3d;
  --re-violet: #5b3df5;
  --re-violet-2: #8b5cf6;
  --re-emerald: #10b981;
  --re-amber: #f59e0b;
  color: var(--re-ink);
  background: linear-gradient(180deg, #fff8f3 0%, #f4f3ff 60%, #f6f8fe 100%);
  padding-bottom: clamp(64px, 8vw, 110px);
  overflow: hidden;
}

.refer-earn h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 10px;
  color: var(--re-ink);
}
.refer-earn p { color: var(--re-ink-2); line-height: 1.65; margin: 0; }

/* ---------- Hero ---------- */
.re-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(112px, 12vw, 150px) 24px clamp(70px, 6vw, 100px);
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(255, 70, 0, .12), transparent 60%),
    radial-gradient(700px 400px at 95% 10%, rgba(91, 61, 245, .14), transparent 65%),
    linear-gradient(180deg, #ffffff 0%, #fff4eb 100%);
}
.re-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 40px;
}
.re-hero__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.re-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(91, 61, 245, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 61, 245, .06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 80%);
}
.re-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  animation: reOrb 16s ease-in-out infinite;
}
.re-orb--a { width: 360px; height: 360px; left: -100px; top: -80px; background: #ffb98a; }
.re-orb--b { width: 260px; height: 260px; right: -40px; top: 80px; background: #a78bfa; animation-delay: -5s; }
.re-orb--c { width: 220px; height: 220px; left: 40%; bottom: -100px; background: #fb7185; animation-delay: -10s; }
@keyframes reOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, 18px, 0) scale(1.06); }
}

.re-confetti {
  position: absolute;
  font-size: 1.2rem;
  color: var(--re-amber);
  opacity: .7;
  animation: reTwinkle 2.6s ease-in-out infinite;
}
.re-confetti--1 { top: 22%; left: 12%; color: var(--re-violet); animation-delay: -.6s; }
.re-confetti--2 { top: 12%; right: 26%; color: var(--re-accent); animation-delay: -1.2s; }
.re-confetti--3 { bottom: 22%; left: 22%; color: var(--re-emerald); animation-delay: -1.8s; }
.re-confetti--4 { top: 60%; right: 8%; color: var(--re-accent); font-size: .9rem; animation-delay: -.3s; }
.re-confetti--5 { bottom: 8%; left: 55%; color: var(--re-violet); font-size: .85rem; animation-delay: -2.1s; }

@keyframes reTwinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: .55; }
  50% { transform: scale(1.4) rotate(15deg); opacity: 1; }
}

.re-hero__copy { position: relative; }
.re-hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 70, 0, .1);
  color: var(--re-accent);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.re-hero__title {
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.08;
  margin: 16px 0 14px;
  color: var(--re-ink);
}
.re-hero__title span {
  background: linear-gradient(135deg, var(--re-accent) 0%, var(--re-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.re-hero__title strong { font-weight: 800; }
.re-hero__tagline {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  max-width: 540px;
}

/* Referral input + button */
.re-hero__share {
  margin-top: 24px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--re-line);
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 14px 30px -18px rgba(255, 70, 0, .4);
  max-width: 540px;
}
.re-input {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 12px;
}
.re-input__label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--re-mute);
}
.re-input input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: .92rem;
  font-weight: 600;
  color: var(--re-ink);
  width: 100%;
  padding: 0;
}

.re-hero__perks {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.re-hero__perks li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  color: var(--re-ink-2);
  font-weight: 500;
}
.re-hero__perks li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--re-emerald);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
}

/* Hero art */
.re-hero__art {
  position: relative;
  display: flex;
  justify-content: center;
}
.re-stack {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 420px;
}
.re-card {
  position: absolute;
  border-radius: 22px;
  box-shadow: 0 22px 50px -20px rgba(11, 20, 55, .25);
  background: #fff;
  border: 1px solid var(--re-line);
  padding: 20px;
}
.re-card--gift {
  top: 0;
  left: 0;
  width: 78%;
  background: linear-gradient(135deg, #221b6e 0%, #5b3df5 100%);
  color: #fff;
  border-color: transparent;
  transform: rotate(-4deg);
  animation: reFloatA 6s ease-in-out infinite;
}
.re-card--gift .re-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.re-card__chip {
  font-size: .8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .18);
  padding: 5px 10px;
  border-radius: 999px;
}
.re-card__logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--re-amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #221b6e;
  font-weight: 900;
}
.re-card__digits {
  margin-top: 30px;
  letter-spacing: .12em;
  font-size: 1.05rem;
  font-weight: 600;
}
.re-card__foot {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  opacity: .85;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.re-card--coin {
  top: 38%;
  right: 0;
  width: 38%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff5e0 0%, #ffdfa0 100%);
  border-color: rgba(245, 158, 11, .35);
  transform: rotate(6deg);
  animation: reFloatB 7s ease-in-out infinite;
  min-height: 140px;
}
.re-coin {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 900;
  color: #b45309;
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: 0 8px 14px -4px rgba(245, 158, 11, .45);
}
.re-coin--big { width: 78px; height: 78px; font-size: 2rem; top: 18%; left: 22%; }
.re-coin--mid { width: 54px; height: 54px; font-size: 1.4rem; top: 50%; left: 55%; }
.re-coin--small { width: 36px; height: 36px; font-size: 1rem; top: 12%; left: 70%; }

.re-card--invite {
  bottom: 0;
  left: 12%;
  width: 70%;
  transform: rotate(3deg);
  animation: reFloatC 6.5s ease-in-out infinite;
  background: #fff;
}
.re-card--invite .re-card__inviteText {
  margin: 0;
  font-size: .92rem;
  color: var(--re-ink);
  line-height: 1.55;
}
.re-card__btn {
  display: inline-flex;
  margin-top: 10px;
  background: var(--re-accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}

@keyframes reFloatA { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-12px); } }
@keyframes reFloatB { 0%, 100% { transform: rotate(6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-10px); } }
@keyframes reFloatC { 0%, 100% { transform: rotate(3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-8px); } }

/* ---------- Buttons ---------- */
.re-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.re-btn--primary {
  background: linear-gradient(135deg, var(--re-accent) 0%, var(--re-violet) 100%);
  color: #fff;
  box-shadow: 0 12px 24px -10px rgba(255, 70, 0, .55);
}
.re-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 28px -10px rgba(255, 70, 0, .65); }
.re-btn--ghost {
  background: #fff;
  color: var(--re-ink);
  border-color: var(--re-line);
}
.re-btn--ghost:hover { border-color: var(--re-accent); color: var(--re-accent); }
.re-btn--white { background: #fff; color: var(--re-accent); box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .35); }
.re-btn--white:hover { transform: translateY(-2px); background: #fef9ee; }
.re-btn--outline { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); }
.re-btn--outline:hover { background: rgba(255, 255, 255, .22); border-color: #fff; }

/* ---------- Section heads ---------- */
.re-section {
  max-width: 1180px;
  margin: 80px auto 0;
  padding: 0 24px;
}
.re-section__head {
  text-align: center;
  margin-bottom: 36px;
}
.re-section__head p { margin: 8px auto 0; max-width: 640px; }
.re-kicker {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--re-accent);
  margin-bottom: 8px;
}

/* ---------- Steps ---------- */
.re-steps__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  counter-reset: step;
}
.re-step {
  position: relative;
  background: #fff;
  border: 1px solid var(--re-line);
  border-radius: 22px;
  padding: 26px 22px 22px;
  transition: transform .2s ease, border-color .2s ease;
}
.re-step:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 70, 0, .4);
}
.re-step__num {
  position: absolute;
  top: -14px;
  left: 22px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--re-accent) 0%, var(--re-violet) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .85rem;
  box-shadow: 0 10px 20px -8px rgba(255, 70, 0, .55);
}
.re-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(255, 70, 0, .08);
  color: var(--re-accent);
  margin: 6px 0 10px;
}
.re-step__icon svg { width: 24px; height: 24px; }
.re-step h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; color: var(--re-ink); }
.re-step p { font-size: .92rem; }

/* ---------- Tiers ---------- */
.re-tiers__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: stretch;
}
.re-tier {
  position: relative;
  background: #fff;
  border: 1px solid var(--re-line);
  border-radius: 22px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.re-tier:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px -20px rgba(255, 70, 0, .35);
  border-color: rgba(255, 70, 0, .35);
}
.re-tier--featured {
  background: linear-gradient(180deg, #fff 0%, #fff5ec 100%);
  border-color: var(--re-accent);
  box-shadow: 0 24px 40px -22px rgba(255, 70, 0, .45);
  transform: translateY(-6px);
}
.re-tier__ribbon {
  position: absolute;
  top: -12px;
  right: 18px;
  background: linear-gradient(135deg, var(--re-accent) 0%, var(--re-violet) 100%);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}
.re-tier__name {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--re-mute);
}
.re-tier__reward {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--re-accent) 0%, var(--re-violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.re-tier__reward small {
  font-size: .82rem;
  font-weight: 600;
  color: var(--re-mute);
  background: none;
  -webkit-text-fill-color: var(--re-mute);
}
.re-tier__condition {
  font-size: .92rem;
  color: var(--re-ink-2);
  margin: -4px 0 4px;
}
.re-tier__perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  flex: 1;
}
.re-tier__perks li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .9rem;
  color: var(--re-ink-2);
}
.re-tier__perks li span {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--re-emerald);
  color: #fff;
  font-size: .65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.re-tier .re-btn { margin-top: 6px; }

/* ---------- FAQ ---------- */
.re-faq__list { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.re-faq details {
  background: #fff;
  border: 1px solid var(--re-line);
  border-radius: 16px;
  padding: 16px 20px;
  transition: border-color .2s ease;
}
.re-faq details[open] { border-color: rgba(255, 70, 0, .35); box-shadow: 0 10px 24px -16px rgba(255, 70, 0, .35); }
.re-faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--re-ink);
}
.re-faq summary::-webkit-details-marker { display: none; }
.re-faq summary::after {
  content: "+";
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--re-accent);
}
.re-faq details[open] summary::after { content: "−"; }
.re-faq p { margin-top: 10px; }

/* ---------- Final CTA ---------- */
.re-cta {
  max-width: 1180px;
  margin: 90px auto 0;
  padding: 0 24px;
}
.re-cta__inner {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 46px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background:
    radial-gradient(700px 320px at 12% 10%, rgba(255, 255, 255, .18), transparent 60%),
    radial-gradient(500px 280px at 90% 80%, rgba(91, 61, 245, .35), transparent 65%),
    linear-gradient(135deg, #b91c1c 0%, #ff4600 60%, #ff8a3d 100%);
  color: #fff;
  box-shadow: 0 30px 50px -25px rgba(255, 70, 0, .55);
}
.re-cta__inner h2 { color: #fff; margin: 0 0 6px; font-size: clamp(1.3rem, 2.2vw, 1.8rem); }
.re-cta__inner p { color: rgba(255, 255, 255, .9); max-width: 560px; }
.re-cta__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .re-hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .re-hero__art { order: 2; }
  .re-stack { height: 360px; max-width: 380px; margin: 0 auto; }
}

@media (max-width: 720px) {
  .re-hero { padding: clamp(96px, 22vw, 120px) 18px 60px; }
  .re-hero__share { flex-direction: column; align-items: stretch; padding: 10px; }
  .re-hero__share .re-input { padding: 8px 4px; }
  .re-hero__share .re-btn { width: 100%; }
  .re-cta__inner { padding: 32px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .re-orb, .re-confetti, .re-card--gift, .re-card--coin, .re-card--invite { animation: none; }
  .re-step, .re-tier, .re-btn { transition: none; }
}
