/* ==========================================================================
 * PHASE 8C -- THE SHARED JOIN CODE AND THE GROUP INVITE LIST
 * ==========================================================================
 *
 * Two surfaces:
 *
 *   THE GATE     a join-code box under Sign In, and the invite's name on the
 *                registration card. This is the screen a dozen relatives meet
 *                on a dozen different phones, so it is sized for 320px first
 *                and left alone as the viewport grows.
 *
 *   THE ADMIN    one row per Group Invite, carrying a code somebody has to be
 *                able to read out and four controls somebody has to be able to
 *                hit with a thumb.
 *
 * --------------------------------------------------------------------------
 * ONLY TOKENS THAT EXIST
 * --------------------------------------------------------------------------
 * Phase 8B shipped a stylesheet reading `--surface`, `--border`, `--muted` and
 * `--ink`, none of which this project defines, each with a LIGHT fallback -- so
 * every Event card rendered white text on white. The real palette is
 * `--bg` / `--bg-elev` / `--bg-elev-2` / `--line` / `--line-soft` / `--text` /
 * `--text-dim` / `--text-faint` / `--metal` / `--accent` / `--warn` /
 * `--danger` / `--radius` / `--radius-sm` / `--tap` / `--gutter`, and
 * `tests/phase8c-ui.test.js` asserts that NO stylesheet in this project reads a
 * property nothing defines.
 *
 * --------------------------------------------------------------------------
 * EVERY RULE THAT CHANGES A BACKGROUND ALSO SETS A COLOUR
 * --------------------------------------------------------------------------
 * The other half of that lesson. Inheriting a foreground across a surface
 * change is how white-on-white happens, whichever direction the theme moves in
 * later.
 * ======================================================================== */

/* ==========================================================================
 * THE GATE
 * ======================================================================== */

/*
 * The join-code box is SECONDARY to Sign In, and says so quietly: a flatter
 * surface and no shadow, so the primary card still reads as the main thing on
 * the screen. It is not hidden behind a disclosure, because somebody who has
 * been handed a code needs to find it without being taught where to look.
 */
.gate__card--secondary {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line-soft);
  box-shadow: none;
}

/*
 * A CODE FIELD, not a text field. Wide letter spacing and a monospaced face
 * because the thing being typed is dictated character by character, and
 * "FESTIVUS26" in a proportional face is where 0 becomes O.
 */
.field__input--code {
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/*
 * "You've been invited to: Festivus Finale 2026".
 *
 * The one line on the signup screen that confirms the right link was opened,
 * so it is the loudest thing above the form. It wraps rather than truncating:
 * an invitation whose name is cut off mid-word tells somebody less than
 * nothing, and the name is the whole point of the line.
 */
.gate__invited {
  margin: 0;
  padding: 12px 16px 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* ==========================================================================
 * THE ADMIN LIST
 * ======================================================================== */

/*
 * A Group Invite row carries more than a member row: a name, a code, a usage
 * count, a mode, an expiry and up to five controls. So it stacks from the
 * start rather than at a breakpoint -- `.list__row` only wraps below 520px,
 * which is too late for a 390px phone holding this much.
 */
.gi-row {
  flex-wrap: wrap;
  align-items: flex-start;
}

/*
 * THE CODE GETS ITS OWN LINE, selectable, in a monospaced face. It is the
 * thing an administrator will be asked for out loud and the thing they will
 * long-press to copy when the clipboard button has been refused -- which it
 * will be, in a private window or over plain HTTP.
 */
.gi-row__code {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--metal);
  user-select: all;
  overflow-wrap: anywhere;
}

/*
 * "3 waiting for approval". A queue nobody notices is a queue nobody works
 * through, so this is warn-coloured -- the same token the application already
 * uses for "something is waiting on you" -- rather than another grey line.
 */
.gi-row__pending {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warn);
}

/*
 * The controls take the full width of the row and wrap onto as many lines as
 * they need. Five small buttons squeezed onto one 320px line is the layout
 * that produced one-character-per-line names on the television in Phase 8B,
 * in a different costume.
 */
.gi-row__actions {
  flex: 1 1 100%;
  justify-content: flex-start;
  margin-top: 8px;
}

/*
 * A tap target that is tall enough on a phone. `.btn--small` is sized for a
 * desktop-ish row; these are pressed with a thumb at a party, often by
 * somebody holding a drink.
 */
@media (max-width: 520px) {
  .gi-row__actions .btn {
    min-height: 40px;
  }
}

/* The code, repeated large, in the dialog shown just after creation. */
.gi-dialog__code {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  color: var(--metal);
  background: var(--bg-elev-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  user-select: all;
  overflow-wrap: anywhere;
}
