
/* ===========================================================================
 * Refer and earn.
 *
 * The customer page has one job: make the link easy to send. Everything here
 * serves that -- the offer stated once in plain numbers, the link one tap from
 * the clipboard, and the share targets in the order people actually use them.
 * ======================================================================== */

/* ---- the offer ----------------------------------------------------------
 * A dark band, because this is the one page in the portal that is selling
 * something rather than reporting something, and it should not read as another
 * row of statistics. */
.ref-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
  padding: 30px 32px;
  border-radius: 18px;
  background: var(--dark);
  color: var(--dark-ink);
}

.ref-kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #93c5fd;
}
.ref-hero-copy h2 {
  margin: 10px 0 0;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  color: #fff;
}
.ref-hero-copy p {
  margin: 12px 0 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--dark-ink-muted);
}

.ref-hero-panel {
  padding: 20px;
  border: 1px solid var(--dark-line);
  border-radius: 14px;
  background: var(--dark-raised);
}
.ref-field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dark-ink-muted);
}

.ref-copy-row { display: flex; gap: 8px; }

.ref-field {
  flex: 1 1 auto;
  /* Without this a long absolute URL sets the flex item's intrinsic width and
     pushes the whole panel wider than its column. */
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--dark-line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ref-field:focus {
  outline: 2px solid rgba(147, 197, 253, .5);
  outline-offset: 1px;
}
.ref-field--code {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .18em;
  text-align: center;
}

.ref-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease;
}
.ref-copy:hover { background: var(--brand-dark); }
/* Green on success, because "Copied" needs to be believed at a glance and the
   word alone changing is easy to miss on a button you just pressed. */
.ref-copy.is-done { background: var(--ok); }

.ref-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dark-ink-muted);
}

/* ---- sharing ------------------------------------------------------------
 * WhatsApp first and visually distinct, because it is how a link actually gets
 * sent between two people who know each other -- which is the entire mechanism
 * this page exists to support. */
.ref-share { display: flex; flex-wrap: wrap; gap: 9px; }

.ref-share-btn,
.ref-share-btn:link,
.ref-share-btn:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.ref-share-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--brand-rgb), .45);
  background: var(--brand-soft);
  color: var(--ink);
}
.ref-share-btn i { font-size: 15px; color: var(--ink-muted); }
.ref-share-btn:hover i { color: var(--brand); }

/* The one exception to the single-accent rule on this page, and it earns it:
   WhatsApp's green is the recognition cue people scan for, and a row of five
   identical buttons is a row nobody's eye lands on. */
.ref-share--whatsapp,
.ref-share--whatsapp:link,
.ref-share--whatsapp:visited {
  border-color: rgba(37, 211, 102, .4);
  background: rgba(37, 211, 102, .08);
}
.ref-share--whatsapp i { color: #25d366; }
.ref-share--whatsapp:hover {
  background: rgba(37, 211, 102, .16);
  border-color: rgba(37, 211, 102, .6);
}
.ref-share--whatsapp:hover i { color: #1da851; }

.ref-message { margin-top: 16px; }
.ref-message summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}
.ref-message p {
  margin: 12px 0;
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--surface-sunken);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-body);
  overflow-wrap: anywhere;
}

/* ---- the funnel ---------------------------------------------------------- */
.stat-note {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.ref-table td { vertical-align: middle; }

/* ---- the admin leaderboard ---------------------------------------------- */
.ref-leaders { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.ref-leaders li {
  position: relative;
  counter-increment: rank;
  padding: 11px 46px 11px 30px;
  border-top: 1px solid var(--surface-line);
  font-size: 13.5px;
}
.ref-leaders li:first-child { border-top: 0; }
.ref-leaders li::before {
  content: counter(rank);
  position: absolute;
  left: 0;
  top: 12px;
  width: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
}
.ref-leader-count {
  position: absolute;
  right: 0;
  top: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-darker);
  font-size: 12px;
  font-weight: 700;
}

/* ---- the invitation notice on the sign-up form -------------------------- */
.invite-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--brand-rgb), .3);
  border-radius: 10px;
  background: rgba(var(--brand-rgb), .07);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-body);
}
.invite-note i { color: var(--brand); margin-top: 2px; }

.invite-toggle { margin-bottom: 16px; }
.invite-toggle summary {
  font-size: 12.5px;
  color: var(--ink-muted);
  cursor: pointer;
}
.invite-toggle input { margin-top: 9px; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .ref-hero { grid-template-columns: 1fr; gap: 22px; padding: 24px 20px; }
}

@media (max-width: 520px) {
  .ref-hero { padding: 20px 16px; border-radius: 14px; }
  .ref-field { font-size: 12px; }
  .ref-field--code { font-size: 15px; letter-spacing: .14em; }
  /* Full width and wrapping to two per row: a thumb needs the target, and five
     share buttons squeezed onto one line are five buttons nobody hits. */
  .ref-share-btn { flex: 1 1 calc(50% - 5px); justify-content: center; }
  .ref-copy span { display: none; }   /* the icon carries it at this width */
  .ref-copy { padding: 10px 13px; }
}
