/* ==========================================================================
   Festivus Hunger Games — authentication, profile and admin surfaces (Phase 2)
   Loaded after app.css; shares its tokens.

   Mobile-first rules that matter here:
     - every control is at least 48px tall, so a form is usable one-handed
     - inputs are 16px, which is the minimum that stops iOS zooming on focus
     - the gate is a centred column that survives a phone keyboard appearing
   ========================================================================== */

/* --------------------------------- boot ---------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 60;
}

.boot__text {
  color: var(--text-faint);
  font-size: 0.9rem;
}

/* ------------------------------- auth gate ------------------------------- */

.gate {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding:
    calc(var(--safe-top) + 32px)
    calc(var(--gutter) + var(--safe-right))
    calc(var(--safe-bottom) + 32px)
    calc(var(--gutter) + var(--safe-left));
}

.gate__inner {
  width: 100%;
  max-width: 420px;
}

.gate__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 22px;
}

.gate__mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 4px;
}

.gate__title {
  margin: 0;
  font-size: clamp(1.7rem, 8vw, 2.2rem);
  line-height: 1.07;
  font-weight: 750;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 0%, var(--metal-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gate__tagline {
  margin: 2px 0 8px;
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.gate__card { margin-top: 0; }

/* --------------------------------- forms --------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 16px 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.field__input {
  /* 16px exactly: anything smaller makes iOS Safari zoom on focus. */
  font: inherit;
  font-size: 16px;
  min-height: var(--tap);
  padding: 0 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 100%;
  appearance: none;
}

.field__input::placeholder { color: var(--text-faint); }

.field__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent-dim);
}

.field__input:autofill,
.field__input:-webkit-autofill {
  /* Chrome's yellow autofill wash is unreadable on a dark field. */
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg-elev-2) inset;
}

.field__hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-faint);
}

.form__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: #ffd9d7;
  background: color-mix(in srgb, var(--danger) 16%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
}

.form__notice {
  margin: 0;
  padding: 12px 16px;
  font-size: 0.84rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-bottom: 1px solid var(--line-soft);
}

.form__notice--bad {
  color: #ffd9d7;
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}

/* -------------------------------- buttons -------------------------------- */

.btn--block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04241b;
  font-weight: 700;
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn--danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  color: var(--danger);
}

/*
 * Secondary actions are still finger-sized. 44px is the smallest comfortable
 * touch target on a phone, and the admin rows are full of these.
 */
.btn--small {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.78rem;
  flex: 0 0 auto;
}

.btn__icon { width: 16px; height: 16px; }

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.link:hover { text-decoration: underline; }

/* ------------------------------ card extras ------------------------------ */

.card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card__text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.card__icon {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  margin-right: 6px;
  color: var(--accent);
}

.card__foot--center { text-align: center; padding-top: 2px; }

.card__actions { margin-top: 18px; }

.pill--role {
  color: var(--text);
  background: var(--bg-elev-2);
  text-transform: capitalize;
}

/* ------------------------------ invite reveal ---------------------------- */

.reveal {
  margin: 0 16px 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 12%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reveal__warning {
  margin: 0;
  font-size: 0.82rem;
  color: #f7e4b8;
}

.reveal__warning strong { color: var(--warn); }

.reveal__value {
  display: block;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--text);
  /* A long URL must wrap, not scroll the page sideways. */
  word-break: break-all;
  user-select: all;
}

/* --------------------------------- lists --------------------------------- */

.list { display: flex; flex-direction: column; }

.list__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.list__row:last-child { border-bottom: 0; }

.list__main { flex: 1 1 auto; min-width: 0; }

.list__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list__meta {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list__empty {
  margin: 0;
  padding: 18px 16px;
  font-size: 0.85rem;
  color: var(--text-faint);
  text-align: center;
}

/* ------------------------- member row actions (Phase 3) ------------------ */

.list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

/* On a phone the member row becomes two lines: identity above, controls
   below, so three 36px targets never squeeze into a 390px row. */
@media (max-width: 520px) {
  .list__row {
    flex-wrap: wrap;
  }
  .list__main { flex: 1 1 60%; }
  .list__actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    margin-top: 4px;
  }
}
