/* Invite (ReferralView.swift): who's inviting, the QR code, the code to copy, how the reward works, the friends, then
   Save and Invite pinned to the bottom, on a plain white page. */

.page.referral {
  min-height: 100vh;
  background: var(--surface);
}
.rf-content {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 20px 0;
  color: var(--rf-ink);
}

/* Invite card */
.rf-invite-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.rf-me {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: var(--rf-avatar-icon);
  background: var(--rf-avatar);
}
.rf-name {
  margin-top: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 600;
}
.rf-tagline {
  margin-top: 4px;
  font-size: 13px;
  color: var(--rf-muted);
}
.rf-qr {
  width: 176px;
  height: 176px;
  margin-top: 18px;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff; /* black on white in both themes: scanners need the contrast */
}
.rf-qr img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.rf-qr-placeholder {
  font-size: 100px;
  color: var(--rf-faint);
}
.rf-code-row {
  margin-top: 16px;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rf-code-text {
  min-width: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.rf-code {
  font-weight: 600;
  letter-spacing: 0.5px;
  user-select: all;
  -webkit-user-select: all;
}
.rf-copy {
  flex: none;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rf-on-dark);
  background: var(--rf-dark);
  position: relative;
}
.rf-copy::after { /* a 44px tap target around the small chip */
  content: '';
  position: absolute;
  inset: -10px;
}
.rf-copy.is-copied {
  color: #fff;
  background: var(--rf-green);
}
.rf-note {
  margin-top: 18px;
  width: 100%;
  padding: 14px 16px 4px;
  border-radius: 10px;
  border: 1px solid var(--rf-note-line);
  background: var(--rf-note);
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
}
.rf-accent {
  color: var(--rf-accent);
}
.rf-rules-link {
  min-height: 44px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--rf-muted);
  text-decoration: underline;
}

/* Save and Invite, pinned to the bottom */
.rf-actions {
  position: sticky;
  bottom: 0;
  margin: 30px -20px 0;
  padding: 10px 20px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  gap: 14px;
  background: var(--surface);
}
.rf-action {
  flex: 1;
  min-height: 48px;
  border-radius: 24px;
  border: 1.5px solid var(--rf-ink);
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  color: var(--rf-ink);
}
.rf-action.is-filled {
  border-color: var(--rf-dark);
  font-weight: 600;
  color: var(--rf-on-dark);
  background: var(--rf-dark);
}
.rf-action:active {
  opacity: 0.8;
}
.rf-action:disabled {
  opacity: 0.5;
}

/* Friends */
.rf-friends {
  margin-top: 26px;
}
.rf-empty-text {
  padding: 10px 0;
  font-size: 13px;
  color: var(--rf-muted);
}
.rf-friends-head {
  padding-bottom: 6px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.rf-friends-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
}
.rf-earned {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--rf-muted);
}
.rf-earned strong {
  color: var(--rf-green);
}
.rf-friend {
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rf-friend + .rf-friend {
  border-top: 1px solid var(--rf-line);
}
.rf-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--rf-navy-light);
  background: var(--rf-lavender);
}
.rf-avatar.is-rewarded {
  color: var(--rf-green);
  background: var(--rf-green-soft);
}
.rf-friend-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rf-friend-name {
  font-size: 13.5px;
  font-weight: 700;
}
.rf-friend-email {
  font-size: 11.5px;
  color: var(--rf-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rf-friend-joined {
  font-size: 10.5px;
  color: var(--rf-faint);
}
.rf-pill {
  flex: none;
  padding: 5px 9px;
  border-radius: 14px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.rf-pill.is-paid {
  color: var(--rf-green);
  background: var(--rf-green-soft);
}
.rf-pill.is-waiting {
  color: var(--rf-amber);
  background: var(--rf-amber-soft);
}

/* Rules sheet */
.rf-rules {
  padding: 8px 20px 20px;
  color: var(--rf-ink);
}
.rf-rules-title {
  padding: 6px 0 18px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
}
.rf-rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rf-rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.45;
}
.rf-rule-number {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--rf-navy-light);
  background: var(--rf-lavender);
}
.rf-done {
  width: 100%;
  margin-top: 22px;
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--rf-on-dark);
  background: var(--rf-dark);
}

/* On phones the tab bar floats over the bottom of the page: keep Save and Invite above it. */
body.has-tabbar .rf-actions {
  bottom: calc(80px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  body.has-tabbar .rf-actions {
    bottom: 0;
  }
}
