/* The Referrer page (/referrer/, docs/adr/0021): the app's Oktatói program
   look on the web — warm canvas, white rounded cards, a grey code pill and
   the beige primary button. */
/* The page sits under the shared site header and footer (/partner/styles.css:
   .site-topbar, .site-footer), the same as the partner pages and /trainer/.
   The colours below are scoped to the page body so they never leak into them. */
body[data-page='referrer'],
html:has(body[data-page='referrer']) { background: #f9f5f2; }

.ref-app {
  --canvas: #f9f5f2;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --pill: #e9e5e2;
  --line: #e4ded8;
  --primary: #c5b49e;
  --primary-text: #ffffff;
  --green: #1d9b6c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  max-width: 480px;
  min-height: calc(100vh - var(--topbar-height));
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 12px) 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ref-app *, .ref-app *::before, .ref-app *::after { box-sizing: border-box; }
.ref-app [hidden], .ref-topbar-nav [hidden] { display: none !important; }

/* The right side of the shared header: once signed in, a "log out" button. */
.ref-topbar-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; margin-right: 8px; }
.ref-topbar-nav a, .ref-topbar-nav button {
  padding: 8px 12px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none;
}
.ref-topbar-nav a:hover, .ref-topbar-nav button:hover { background: var(--surface-soft); }
@media (max-width: 560px) {
  .ref-topbar-nav { margin-right: 0; }
}

.ref-card { background: var(--card); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }

/* The top card, like the app's Oktatói program card (TrainerHero): white,
   radius 22, the title and its line on the bottom edge and the glass flower
   146 x 151 peeking in 8 px from the top and 44 px past the right edge. */
.ref-hero { position: relative; overflow: hidden; border-radius: 22px; padding: 18px 18px 20px; }
.ref-hero-text { position: relative; z-index: 1; padding-top: 64px; }
.ref-hero h1 { margin: 0; padding-right: 64px; font-size: 24px; line-height: 1.15; font-weight: 900; }
.ref-hero p { margin: 4px 0 0; padding-right: 80px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.ref-hero-flower { position: absolute; top: 8px; right: -44px; width: 146px; height: 151px; overflow: visible; }

.ref-section-label { margin: 6px 4px -6px; font-size: 15px; font-weight: 600; color: var(--muted); }

.ref-how { display: flex; flex-direction: column; gap: 14px; }
.ref-how-row { display: flex; gap: 12px; align-items: center; }
.ref-how-icon {
  width: 32px; height: 32px; border-radius: 10px; background: var(--canvas);
  display: grid; place-items: center; font-weight: 800; flex: 0 0 auto;
}

.ref-code {
  display: flex; align-items: center; gap: 14px; background: var(--pill);
  border-radius: 18px; padding: 10px 10px 10px 18px;
}
.ref-code-icon { width: 24px; height: 24px; flex: 0 0 auto; }
.ref-code strong { flex: 1; font-size: 20px; letter-spacing: 0.12em; }
.ref-share {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--card);
  display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.ref-share svg { width: 22px; height: 22px; }
.ref-small { font-size: 13px; margin: 0 4px; word-break: break-all; }
.ref-muted { color: var(--muted); }

.ref-balance-label { margin: 0; font-weight: 700; color: var(--muted); }
.ref-balance-amount { margin: 4px 0 12px; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.ref-progress { height: 10px; border-radius: 999px; background: var(--pill); overflow: hidden; margin-bottom: 8px; }
.ref-progress span { display: block; height: 100%; background: var(--primary); border-radius: 999px; min-width: 10px; }
.ref-balance .ref-button { margin-top: 14px; }

.ref-invitees { padding: 6px 20px; }
.ref-invitee { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ref-invitee:last-child { border-bottom: 0; }
.ref-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--canvas); flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; color: #8a7357;
}
.ref-invitee-body { flex: 1; min-width: 0; }
.ref-invitee-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.ref-invitee-head span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 10px; position: relative; }
.ref-steps::before { content: ''; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: var(--line); }
.ref-step { position: relative; font-size: 12px; color: var(--muted); }
.ref-step:not(:first-child) { text-align: center; }
.ref-step:last-child { text-align: right; }
.ref-step i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--line); margin-bottom: 6px; position: relative; }
.ref-step:not(:first-child) i { margin-left: auto; margin-right: auto; }
.ref-step:last-child i { margin-right: 0; }
.ref-step.done i { background: var(--green); }
.ref-step b { display: block; color: var(--text); font-size: 12px; }
.ref-empty { padding: 16px 0; color: var(--muted); }

.ref-form { display: flex; flex-direction: column; gap: 12px; }
.ref-form h2, .ref-message h2, .ref-sheet h2 { margin: 0; font-size: 22px; font-weight: 800; }
.ref-form p { margin: 0; }
.ref-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.ref-field input, .ref-field select {
  font: inherit; font-size: 16px; color: var(--text); background: #f5f5f5; border: 1px solid transparent;
  border-radius: 14px; padding: 13px 14px; outline: none;
}
.ref-field input:focus, .ref-field select:focus { border-color: var(--primary); background: #fff; }
.ref-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.ref-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green); flex: 0 0 auto; }
.ref-check a { color: var(--text); }
.ref-social { display: flex; flex-direction: column; gap: 8px; }
.ref-social-button {
  font: inherit; font-weight: 700; border: 0; background: #f1f1f1; border-radius: 14px; padding: 13px; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.ref-social-logo { width: 20px; height: 20px; flex: 0 0 auto; }
.ref-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.ref-divider::before, .ref-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.ref-button {
  display: block; width: 100%; text-align: center; text-decoration: none; border: 0; cursor: pointer;
  background: var(--primary); color: var(--primary-text); font: inherit; font-weight: 800;
  border-radius: 999px; padding: 15px 18px;
}
.ref-button:disabled { background: #e4e4e4; color: #8a8a8a; cursor: default; }
.ref-button-secondary { background: var(--text); }
.ref-link-button { background: none; border: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; padding: 6px; }
.ref-error { color: #b3261e; font-size: 14px; }

.ref-message { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ref-message p { margin: 0; }
.ref-message-icon { font-size: 34px; }

.ref-screen[data-screen='loading'] { display: grid; place-items: center; min-height: 50vh; }
.ref-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--pill); border-top-color: var(--primary); animation: ref-spin 0.9s linear infinite; }
@keyframes ref-spin { to { transform: rotate(360deg); } }
.ref-screen { display: flex; flex-direction: column; gap: 16px; }

.ref-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
}

.ref-sheet {
  border: 0; border-radius: 24px; padding: 22px; width: min(440px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}
.ref-sheet::backdrop { background: rgba(0, 0, 0, 0.35); }
.ref-sheet p { margin: 8px 0; }
.ref-message-preview {
  white-space: pre-wrap; font: inherit; font-size: 14px; background: var(--canvas); border-radius: 14px; padding: 12px; margin: 8px 0;
}
.ref-sheet .ref-button { margin-top: 12px; }

/* Footer country and language pickers: copied from /trainer/ (same footer). */
.footer-market {
  margin-top: 22px;
  display: grid;
  gap: 8px;
  width: 156px;
}

.footer-market-label {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.footer-market-field {
  position: relative;
  display: flex;
  align-items: center;
}

.footer-market-flag {
  position: absolute;
  left: 10px;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.footer-market-field select {
  width: 100%;
  min-height: 36px;
  padding: 0 28px 0 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.footer-language {
  margin-top: 14px;
}

.footer-language .footer-market-field select {
  padding-left: 12px;
}

.footer-market-field select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.footer-market-chevron {
  position: absolute;
  right: 10px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

