/**
 * THE REFERRAL PANEL — shared by /account and /referrals.
 *
 * Both pages load `tokens.css`, so every custom property here resolves. The
 * fallbacks are written anyway, in the form `var(--purple, #ff4d82)`, because
 * index.html does NOT load tokens and the day somebody links this file from a
 * page that does not either, it should degrade to the right colours rather than
 * to browser defaults. `refunds.html` writes its own rules the same way.
 *
 * §3.5 forbids neon accents, chart decoration, emoji and more than one accent
 * beyond the semantic three. Nothing here introduces any: the chips, the
 * read-back and the copy button all use the single `--purple` accent.
 */

/* --- pill radios ------------------------------------------------------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }

/* The radio itself is never seen but is never removed: `display:none` takes it
   out of the focus order and off the keyboard, which is the whole reason the
   control is a radio group in the first place. */
.chip-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.chip {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--line, #33264a);
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1.2;
  color: var(--body, #b9aecb);
  cursor: pointer;
  user-select: none;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}

.chip:hover { border-color: var(--purple-deep, #ff7ba3); }

/* THE SELECTED CHIP: accent border and a dim accent fill. The class is written
   by the renderer and the :checked rule below carries it live, so the pill is
   correct on first paint and after a click without the renderer being re-run. */
.chip.is-on,
.chip-input:checked + .chip {
  border-color: var(--purple, #ff4d82);
  background: var(--purple-soft, rgba(255, 77, 130, .14));
  color: var(--purple-deep, #ff7ba3);
}

/* Focus has to be visible on the LABEL, because the input it belongs to is not
   on screen. Without this the chips are keyboard-operable and invisible while
   being operated, which is worse than not being operable at all. */
.chip-input:focus-visible + .chip {
  outline: 2px solid var(--purple, #ff4d82);
  outline-offset: 2px;
}

/* --- the wallet field and its read-back -------------------------------- */

.wallet-field {
  width: 100%;
  max-width: 46ch;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line, #33264a);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: var(--ink, #fff);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
}

.wallet-field:focus {
  outline: none;
  border-color: var(--purple, #ff4d82);
}

/* THE READ-BACK. Monospace, because it exists to be compared character by
   character against a wallet held next to the screen. The two ends carry the
   accent; the ellipsis between them does not, so the eye lands on the parts
   that are actually being checked. */
.readback {
  margin: 8px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--faint, #6e6483);
}

.readback b {
  color: var(--purple-deep, #ff7ba3);
  font-weight: 600;
}

/* --- the caution ------------------------------------------------------- */

.caution {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-left: 2px solid var(--warn, #e8b04b);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, .02);
  font-size: 13px;
  color: var(--body, #b9aecb);
}

.caution strong { color: var(--ink, #fff); font-weight: 600; }

/* --- the success state ------------------------------------------------- */

.issued {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 2px;
  padding: 12px 14px;
  border: 1px solid var(--purple, #ff4d82);
  border-radius: 8px;
  background: var(--purple-soft, rgba(255, 77, 130, .14));
}

.issued-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  color: var(--ink, #fff);
  word-break: break-all;
  flex: 1 1 24ch;
}

.btn-copy {
  padding: 7px 16px;
  border: 1px solid var(--purple, #ff4d82);
  border-radius: 999px;
  background: transparent;
  color: var(--purple-deep, #ff7ba3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-copy:hover { background: rgba(255, 77, 130, .1); }

/* --- the submit -------------------------------------------------------- */

.btn-referral {
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--purple, #ff4d82);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-referral:hover { background: var(--purple-deep, #ff7ba3); }
.btn-referral:disabled { opacity: .55; cursor: default; }

/* --- what the link has brought in -------------------------------------- */

.brought {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line, #33264a);
  font-size: 13.5px;
  color: var(--body, #b9aecb);
}

.brought b { color: var(--ink, #fff); font-size: 20px; font-weight: 600; }
