/* ============================================================
   GRID+CLUB lead forms (scripts/leadform.js)
   Works in any world: everything reads the world tokens.
   ============================================================ */

.lf { --lf-gap: clamp(1.1rem, 2vw, 1.6rem); }

.lf__grid {
  display: grid;
  gap: var(--lf-gap) clamp(1rem, 2.4vw, 2rem);
}
@media (min-width: 640px) {
  .lf__grid { grid-template-columns: 1fr 1fr; }
  .lf__field { grid-column: 1 / -1; }
  .lf__field--half { grid-column: auto; }
}

.lf__field { display: grid; gap: 0.45rem; min-width: 0; }

.lf__label { color: var(--muted); display: flex; gap: 0.6em; align-items: baseline; }
.lf__opt { color: var(--muted); opacity: 0.7; letter-spacing: 0.08em; text-transform: lowercase; }

.lf__input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 1.0625rem;          /* 17px: below 16px iOS zooms the page on focus */
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 24%, transparent);
  border-radius: 0;
  padding: 0.55rem 0 0.6rem;
  transition: border-color var(--d2) var(--ease-out), background var(--d2) var(--ease-out);
}
.lf__input::placeholder { color: var(--muted); }
.lf__input:hover { border-bottom-color: var(--muted); }
.lf__input:focus { outline: none; border-bottom-color: var(--accent); }
.lf__input:focus-visible { box-shadow: 0 1px 0 0 var(--accent); }
/* Autofill paints its own pale yellow ground; keep it on brand. */
.lf__input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px var(--surface) inset;
  caret-color: var(--ink);
}

.lf__area { resize: vertical; min-height: 7.5rem; line-height: 1.5; }

.lf__select {
  appearance: none;
  cursor: pointer;
  padding-right: 1.6rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.lf__select:invalid { color: var(--muted); }
.lf__select option { color: #0a0a0a; background: #f4f4ed; }

.lf__field--check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.2rem 0.8rem;
  padding-top: 0.2rem;
}
.lf__field--check label { font-size: 0.95rem; line-height: 1.45; color: var(--ink); cursor: pointer; }
.lf__field--check .lf__err { grid-column: 2; }
.lf__check {
  width: 1.15rem; height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* A checkbox group set as toggle chips (the volunteer roles). */
.lf__field--checks { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.lf__field--checks legend { padding: 0; margin-bottom: 0.7rem; }
.lf__chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lf__chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  font-size: 0.92rem; line-height: 1.2; color: var(--ink);
  cursor: pointer;
  transition: border-color var(--d2) var(--ease-out), background-color var(--d2) var(--ease-out), color var(--d2) var(--ease-out);
}
.lf__chip input {
  appearance: none; margin: 0; flex: none;
  width: 0.8rem; height: 0.8rem;
  border: 1px solid currentColor;
  display: grid; place-items: center;
  cursor: pointer;
}
.lf__chip input:checked::after {
  content: ""; width: 0.36rem; height: 0.2rem;
  border: 2px solid currentColor; border-top: 0; border-right: 0;
  transform: translate3d(0, -1px, 0) rotate(-45deg);
}
.lf__chip:hover { border-color: var(--accent); }
.lf__chip:has(:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lf__chip:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.lf__chip input:focus-visible { outline: none; }
.is-bad .lf__chip { border-color: #ff6b5a; }

.lf__err { min-height: 0; font-size: 0.85rem; line-height: 1.35; color: #ff6b5a; }
.lf__err:empty { display: none; }
.is-bad .lf__input { border-bottom-color: #ff6b5a; }

/* The honeypot. Off-screen rather than display:none, which some bots skip. */
.lf__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.lf__foot {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 1rem 1.4rem;
  margin-top: calc(var(--lf-gap) * 1.4);
}

.lf__submit {
  display: inline-flex; align-items: center; gap: 0.9rem;
  padding: 1.05rem 1.6rem;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: var(--text-mono);
  letter-spacing: var(--track-mono); text-transform: uppercase; font-weight: 500;
  position: relative; overflow: hidden; isolation: isolate;
}
.lf__submit::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--ink); transform: translate3d(0, 101%, 0);
  transition: transform var(--d3) var(--ease-out);
}
.lf__submit i { font-style: normal; transition: transform var(--d3) var(--ease-out); }
.lf__submit:hover::after, .lf__submit:focus-visible::after { transform: none; }
.lf__submit:hover, .lf__submit:focus-visible { color: var(--ground); }
.lf__submit:hover i { transform: translate3d(0.3rem, 0, 0); }
.lf__submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lf__submit:active { transform: translate3d(0, 1px, 0); }
.lf__submit[disabled] { opacity: 0.6; cursor: progress; }
.is-sending .lf__submit span::after { content: "..."; }

.lf__status { color: var(--muted); max-width: 46ch; }
.lf__status a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }

.lf__result { display: grid; gap: 0.9rem; justify-items: start; outline: none; }
.lf__done {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2rem, 1rem + 3vw, 3.4rem); line-height: 0.9;
}
.lf__note { color: var(--muted); max-width: 48ch; }
.lf__mail { margin-top: 0.4rem; }

/* ---------- the modal ---------- */
html.lf-locked { overflow: hidden; }

.lf-dialog {
  width: min(44rem, calc(100vw - 2rem));
  max-height: calc(100svh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.lf-dialog::backdrop {
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(6px);
}
.lf-dialog[open] { animation: lf-in var(--d3) var(--ease-out); }
.lf-dialog[open]::backdrop { animation: lf-fade var(--d3) var(--ease-out); }
@keyframes lf-in { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@keyframes lf-fade { from { opacity: 0; } }

.lf-dialog__panel {
  position: relative;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  border-top: 3px solid var(--accent);
  display: grid; gap: clamp(1.4rem, 3vw, 2rem);
}
.lf-dialog__head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.lf-dialog__title {
  font-family: var(--display-face); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.3rem, 1rem + 5vw, 4.4rem); line-height: 0.86; letter-spacing: -0.01em;
  margin-top: 0.5rem;
}
.lf-dialog__lede { color: var(--muted); max-width: 40ch; margin-top: 0.8rem; }
.lf-dialog__close {
  flex: none;
  display: inline-flex; gap: 0.5em; align-items: center;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color var(--d2) var(--ease-out), color var(--d2) var(--ease-out);
}
.lf-dialog__close i { font-style: normal; font-size: 1.3em; line-height: 0.6; }
.lf-dialog__close:hover, .lf-dialog__close:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.lf-dialog__legal { color: var(--muted); border-top: 1px solid var(--line); padding-top: 1rem; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
  .lf-dialog[open], .lf-dialog[open]::backdrop { animation: none; }
  .lf__submit::after, .lf__submit i { transition: none; }
}

/* "Signing up for: Pit Wall Quiz" line above the waitlist form. */
.lf-dialog__for { margin: 0; color: var(--accent); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
