/* ============================================================
   REFER & EARN PAGE — refer-and-earn.css
   PART 1: Refer & Earn Hero only.
   Reuses global.css tokens/utilities (variables, .btn, .section-eyebrow,
   .reveal-fade/.reveal-right). Page-specific classes prefixed "refer-".
   ============================================================ */

.refer-hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  width: 100%;
  padding: calc(var(--nav-h) + 60px) clamp(40px, 6vw, 120px) 80px;
  overflow: hidden;
}

/* ---- background ---- */
.refer-hero__bg { position: absolute; inset: 0; z-index: -1; }
.refer-hero__glow {
  position: absolute;
  top: -20%;
  left: -8%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c-copper) 0%, transparent 70%);
  filter: blur(120px);
  opacity: 0.36;
  animation: auroraFloat 17s ease-in-out infinite;
  will-change: transform;
}
.refer-hero__radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 75% 45%, rgba(227,172,130,0.08), transparent 60%);
}
.refer-hero__noise {
  position: absolute; inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
}

/* ---- layout ---- */
.refer-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}

/* ---- left copy ---- */
.refer-hero__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.18;
  letter-spacing: 0.2px;
  color: var(--c-text-1);
  margin-top: 18px;
}

.refer-hero__slogan {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--c-rose-gold);
  margin-top: 18px;
}

.refer-hero__desc {
  margin-top: 20px;
  max-width: 480px;
  color: var(--c-text-2);
  font-size: 1rem;
  line-height: 1.75;
}

.refer-hero__actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---- right: pure CSS/HTML referral composition ---- */
.refer-hero__visual { display: flex; align-items: center; justify-content: center; }

.refer-hero__composition {
  position: relative;
  width: min(400px, 92%);
  aspect-ratio: 1/1;
}

.refer-hero__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(217,155,110,0.3);
}
.refer-hero__ring--1 { inset: 12%; animation: referRingSpin 26s linear infinite; }
.refer-hero__ring--2 {
  inset: -2%;
  border-style: dashed;
  border-color: rgba(227,172,130,0.2);
  animation: referRingSpin 36s linear infinite reverse;
}
@keyframes referRingSpin { to { transform: rotate(360deg); } }

.refer-hero__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.refer-hero__connector {
  stroke: rgba(217,155,110,0.4);
  stroke-width: 1;
  stroke-dasharray: 5 7;
  animation: referLineDash 3s linear infinite;
  animation-delay: var(--ld, 0s);
}
/* referral-flow connectors: faster, denser dash to read as "flow" toward the reward */
.refer-hero__connector--flow {
  stroke: rgba(217,155,110,0.55);
  stroke-width: 1.4;
  stroke-dasharray: 3 9;
  animation: referLineFlow 1.6s linear infinite;
}
@keyframes referLineDash { to { stroke-dashoffset: -120; } }
@keyframes referLineFlow { to { stroke-dashoffset: -48; } }

/* floating user avatars (referrer / referred) */
.refer-hero__avatar {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--c-line);
  box-shadow: 0 16px 32px rgba(0,0,0,0.35);
  will-change: transform;
}
.refer-hero__avatar svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--c-copper-light);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.refer-hero__avatar--1 {
  top: 4%;
  left: 8%;
  animation: referAvatarFloat 5.5s ease-in-out infinite;
}
.refer-hero__avatar--2 {
  bottom: 12%;
  left: 12%;
  animation: referAvatarFloat 6.5s ease-in-out infinite reverse;
  animation-delay: -2s;
}
@keyframes referAvatarFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* gift box + coin badges */
.refer-hero__icon-badge {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--c-line);
  box-shadow: 0 16px 32px rgba(0,0,0,0.35);
  will-change: transform;
}
.refer-hero__icon-badge svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--c-copper-light);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.refer-hero__icon-badge--gift {
  top: 8%;
  right: 6%;
  animation: referBadgeFloat 6s ease-in-out infinite;
}
.refer-hero__icon-badge--coin {
  bottom: 6%;
  right: 14%;
  animation: referBadgeFloat 5s ease-in-out infinite reverse;
  animation-delay: -1.5s;
}
@keyframes referBadgeFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}

/* connection nodes */
.refer-hero__node {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-copper-light);
  box-shadow: 0 0 12px 3px rgba(217,155,110,0.55);
  will-change: transform;
}
.refer-hero__node--1 { top: 34%; left: 46%; animation: referNodeDrift 5s ease-in-out infinite; }
.refer-hero__node--2 { bottom: 30%; right: 40%; animation: referNodeDrift 6s ease-in-out infinite reverse; animation-delay: -2s; }
@keyframes referNodeDrift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -10px); }
}

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .refer-hero { padding-inline: 40px; text-align: center; }
  .refer-hero__inner { grid-template-columns: 1fr; gap: 46px; }
  .refer-hero__desc { margin-inline: auto; }
  .refer-hero__actions { justify-content: center; }
  .refer-hero__visual { order: -1; }
}
@media (max-width: 640px) {
  .refer-hero { padding-inline: 20px; min-height: auto; padding-top: calc(var(--nav-h) + 40px); padding-bottom: 60px; }
  .refer-hero__actions { flex-direction: column; align-items: stretch; }
  .refer-hero__actions .btn { justify-content: center; }
  .refer-hero__composition { width: min(300px, 88%); }
  .refer-hero__avatar, .refer-hero__icon-badge { width: 46px; height: 46px; }
  .refer-hero__avatar svg, .refer-hero__icon-badge svg { width: 20px; height: 20px; }
}

/* ============================================================
   WHY REFER THROUGH RUDRION — PART 2
   No glassmorphism, no rotating borders. Editorial panels +
   a premium reward badge + a 5-step process strip with a
   continuously moving copper glow along its connecting line.
   ============================================================ */

.refer-why {
  position: relative;
  width: 100%;
  padding-block: 0 140px;
  padding-inline: clamp(40px, 6vw, 120px);
}

.refer-why__inner {
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  gap: 80px;
  align-items: start;
}

/* ---- left: copy + reward badge + CTA ---- */
.refer-why__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.2;
  color: var(--c-text-1);
  margin: 16px 0 20px;
}

.refer-why__desc {
  color: var(--c-text-2);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 460px;
  margin-bottom: 30px;
}
.refer-why__desc strong { color: var(--c-copper-light); font-weight: 600; }

.refer-why__badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 28px 30px;
  max-width: 300px;
  border: 1px solid rgba(217,155,110,0.35);
  border-radius: var(--radius-m);
  background: linear-gradient(160deg, rgba(217,155,110,0.08), transparent 70%);
  box-shadow: 0 0 34px rgba(217,155,110,0.12);
  margin-bottom: 32px;
}
.refer-why__badge-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}
.refer-why__badge-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--c-copper-light);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.refer-why__badge-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-3);
}
.refer-why__badge-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  background: var(--grad-copper-soft);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1.15;
}
.refer-why__badge-sub {
  font-size: 0.84rem;
  color: var(--c-text-2);
}

.refer-why__cta { width: fit-content; }

/* ---- right: editorial feature panels ---- */
.refer-why__features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 44px 36px;
}

.refer-feature {
  position: relative;
  padding: 10px 0;
  transition: transform var(--dur-fast) var(--ease-out);
}
.refer-feature:hover { transform: translateY(-8px); }

.refer-feature__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-line);
  margin-bottom: 18px;
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med), box-shadow var(--dur-med);
}
.refer-feature:hover .refer-feature__icon {
  transform: rotate(8deg);
  border-color: rgba(217,155,110,0.5);
  box-shadow: 0 0 18px rgba(217,155,110,0.25);
}
.refer-feature__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--c-copper-light);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refer-feature h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text-1);
  margin-bottom: 8px;
}
.refer-feature p {
  color: var(--c-text-2);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 14px;
}

.refer-feature__accent {
  display: block;
  width: 32px;
  height: 1px;
  background: var(--c-copper-light);
  opacity: 0.5;
  transition: width var(--dur-med) var(--ease-out);
}
.refer-feature:hover .refer-feature__accent { width: 54px; }

/* ---- 5-step process strip ---- */
.refer-process {
  position: relative;
  max-width: 1100px;
  margin: 120px auto 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  text-align: center;
}


/* ---- Center Glass Node w/ Brand Logo ---- */
.refer-hero__center-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(18, 18, 22, 0.85); /* Dark Glass Backdrop so logo colors pop out cleanly */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(217, 155, 110, 0.4); /* Premium Copper Ring Border */
  box-shadow: 0 0 45px rgba(217, 155, 110, 0.3),
              0 15px 35px rgba(0, 0, 0, 0.7),
              inset 0 1px 2px rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 5;
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med), box-shadow var(--dur-med);
}

.refer-hero__brand-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Soft Backlight Glow to pop the logo out from background */
  filter: drop-shadow(0 0 12px rgba(217, 155, 110, 0.35)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
  transition: transform var(--dur-fast) var(--ease-out);
}

/* Hover Effect */
.refer-hero__composition:hover .refer-hero__center-logo {
  transform: translate(-50%, -52%) scale(1.06);
  border-color: rgba(217, 155, 110, 0.7);
  box-shadow: 0 0 60px rgba(217, 155, 110, 0.45),
              0 20px 40px rgba(0, 0, 0, 0.8);
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
  .refer-hero__center-logo {
    width: 96px;
    height: 96px;
    padding: 16px;
  }
}
.refer-process__line {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--c-line);
  overflow: hidden;
}
.refer-process__line-glow {
  position: absolute;
  top: 50%;
  left: -80px;
  width: 80px;
  height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--c-copper-light), transparent);
  filter: blur(1.5px);
  box-shadow: 0 0 12px rgba(217,155,110,0.7);
  animation: referProcessGlow 4.5s linear infinite;
  will-change: transform;
}
@keyframes referProcessGlow {
  0%   { left: -80px; }
  100% { left: 100%; }
}

.refer-process__step { position: relative; padding-top: 40px; }
.refer-process__num {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 29px;
  height: 29px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-copper-light);
  background: var(--c-black-panel);
  border: 1px solid rgba(217,155,110,0.4);
}
.refer-process__step h4 {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--c-text-2);
  line-height: 1.4;
}

/* ---- responsive ---- */
@media (max-width: 1400px) {
  .refer-why { padding-inline: 60px; }
}
@media (max-width: 1080px) {
  .refer-why { padding-inline: 40px; }
  .refer-why__inner { grid-template-columns: 1fr; gap: 56px; }
  .refer-process { grid-template-columns: repeat(3, 1fr); row-gap: 44px; margin-top: 90px; }
  .refer-process__line { display: none; }
}
@media (max-width: 640px) {
  .refer-why { padding-block: 0 100px; padding-inline: 20px; }
  .refer-why__badge { max-width: 100%; align-items: center; text-align: center; margin-inline: auto; }
  .refer-why__cta { width: 100%; justify-content: center; }
  .refer-why__features { grid-template-columns: 1fr; }
  .refer-feature:hover { transform: none; }
  .refer-process { grid-template-columns: 1fr; row-gap: 34px; margin-top: 70px; }
}

/* ============================================================
   PREMIUM REFERRAL POPUP FORM
   Modal + success modal. Backdrop-filter on the overlay itself
   provides the "page blurs behind the popup" effect.
   ============================================================ */

.refer-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 4, 3, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s var(--ease-out);
}
.refer-popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.refer-popup {
  position: relative;
  width: min(700px, 90vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--c-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(217, 155, 110, 0.3);
  border-radius: 24px;
  padding: clamp(32px, 4vw, 48px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), 0 0 60px rgba(217, 155, 110, 0.14);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: transform 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
}
.refer-popup-overlay.is-open .refer-popup {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.refer-popup__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-line);
  color: var(--c-text-2);
  font-size: 1.3rem;
  line-height: 1;
  transition: border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.refer-popup__close:hover {
  border-color: rgba(217, 155, 110, 0.5);
  color: var(--c-copper-light);
  box-shadow: 0 0 16px rgba(217, 155, 110, 0.3);
  transform: rotate(90deg);
}

.refer-popup__header { margin-bottom: 30px; padding-right: 30px; }
.refer-popup__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  line-height: 1.3;
  color: var(--c-text-1);
  margin: 14px 0 14px;
}
.refer-popup__heading--center { text-align: center; margin-top: 0; }
.refer-popup__desc { color: var(--c-text-2); font-size: 0.92rem; line-height: 1.7; }
.refer-popup__desc--center { text-align: center; max-width: 420px; margin: 0 auto 14px; }

/* ---- form ---- */
.refer-popup__fieldset {
  border: none;
  padding: 0;
  margin: 0 0 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 14px;
}
.refer-popup__fieldset legend {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-copper-light);
  margin-bottom: 16px;
  padding: 0;
}
.refer-popup__fieldset + .refer-popup__fieldset {
  padding-top: 22px;
  border-top: 1px solid var(--c-line);
}

.refer-popup__field { display: flex; flex-direction: column; gap: 6px; }
.refer-popup__field--file,
.refer-popup__field--full {
  grid-column: 1 / -1;
}

.refer-popup__field label {
  font-size: 0.82rem;
  color: var(--c-text-2);
}
.refer-popup__field label span {
  color: var(--c-text-3);
  font-size: 0.74rem;
}

.refer-popup__field input,
.refer-popup__field select,
.refer-popup__field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-s);
  color: var(--c-text-1);
  padding: 11px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.refer-popup__field textarea { resize: vertical; min-height: 70px; }
.refer-popup__field input:focus,
.refer-popup__field select:focus,
.refer-popup__field textarea:focus {
  outline: none;
  border-color: var(--c-copper-light);
  background: rgba(217, 155, 110, 0.05);
  box-shadow: 0 0 0 3px rgba(217, 155, 110, 0.14);
}
.refer-popup__field input.is-invalid,
.refer-popup__field select.is-invalid {
  border-color: rgba(224, 105, 92, 0.7);
}

.refer-popup__error {
  font-size: 0.76rem;
  color: #e0695c;
  min-height: 1em;
}
.refer-popup__error:empty { display: none; }

.refer-popup__actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.refer-popup__actions--center { justify-content: center; margin-top: 30px; }
.refer-popup__submit,
.refer-popup__cancel { flex: 1 1 auto; justify-content: center; }

/* ---- success modal ---- */
.refer-popup--success {
  text-align: center;
  max-width: 480px;
}

.refer-popup__success-icon {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 26px;
}
.refer-popup__success-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(217, 155, 110, 0.4);
}
.refer-popup__success-glow {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 155, 110, 0.35), transparent 70%);
  filter: blur(18px);
  animation: referSuccessGlowPulse 2.4s ease-in-out infinite;
}
@keyframes referSuccessGlowPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
.refer-popup__success-check {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 22px;
  fill: none;
  stroke: var(--c-copper-light);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: referCheckDraw 0.6s var(--ease-out) 0.25s forwards, referIconFloat 3s ease-in-out 0.9s infinite;
}
@keyframes referCheckDraw { to { stroke-dashoffset: 0; } }
@keyframes referIconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  .refer-popup__fieldset { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .refer-popup { width: min(700px, 95vw); padding: 28px 20px; max-height: 92vh; }
  .refer-popup__header { padding-right: 26px; }
  .refer-popup__actions { flex-direction: column; }
  .refer-popup__actions--center { flex-direction: column-reverse; }
}