/* "Join the waitlist" form (views/event/_waitlist_form.php): a dialog on the
   public event page, inline on the sold-out page. Public/donor-facing, so not
   on the admin token system. Reads the event page's --accent / --ink / --line
   when present (css/donation-page-v2.css) and falls back to its own values on
   the sold-out page, which loads neither. */

.wl {
  --wl-accent: var(--accent, #0d6efd);
  --wl-on-accent: var(--on-accent, #fff);
  --wl-ink: var(--ink, #14181F);
  --wl-muted: var(--muted, #667085);
  --wl-line: var(--line, #E4E7EC);
  font-family: avenirnext-medium, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--wl-ink);
  text-align: left;
}

.wl-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .25);
  overflow: auto;
}
.wl-dialog::backdrop { background: rgba(16, 24, 40, .5); }

.wl-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.wl-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.wl-x {
  width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent;
  font-size: 24px; line-height: 1; color: var(--wl-muted); cursor: pointer;
}
.wl-x:hover { background: #F2F4F7; }

.wl-body { padding: 12px 24px 24px; }
.wl-lede { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--wl-muted); }

.wl-f { display: block; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.wl-f > span, .wl-f > legend { display: block; margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 700; color: var(--wl-ink); }
.wl-f em { font-style: normal; font-weight: 400; color: var(--wl-muted); }
.wl-f input[type="text"], .wl-f input[type="email"], .wl-f input[type="tel"], .wl-f input[type="number"],
.wl-f select, .wl-f textarea {
  display: block; width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--wl-line); border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; color: var(--wl-ink);
}
.wl-f textarea { resize: vertical; min-height: 60px; }
.wl-f input:focus, .wl-f select:focus, .wl-f textarea:focus, .wl-check input:focus-visible {
  outline: 2px solid var(--wl-accent); outline-offset: 1px; border-color: var(--wl-accent);
}

.wl-row { display: flex; gap: 12px; }
.wl-row > .wl-f { flex: 1 1 auto; }
.wl-row > .wl-f--qty { flex: 0 0 96px; }

.wl-tickets { display: grid; gap: 8px; }
.wl-check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--wl-line); border-radius: 8px; cursor: pointer; font-size: 14.5px;
}
.wl-check[hidden] { display: none; }
.wl-check:has(input:checked) { border-color: var(--wl-accent); background: rgba(13, 110, 253, .04); }
.wl-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--wl-accent); flex: 0 0 auto; }

.wl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.wl-err { margin: 0 0 12px; font-size: 13.5px; font-weight: 700; color: #B42318; }
.wl-err[hidden] { display: none; }

.wl-go {
  display: block; width: 100%; height: 48px; border: 0; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: 16px; background: var(--wl-accent); color: var(--wl-on-accent);
}
.wl-go:hover:not(:disabled) { filter: brightness(.95); }
.wl-go:disabled { opacity: .6; cursor: default; }
.wl-go--quiet { background: #F2F4F7; color: var(--wl-ink); margin-top: 8px; }

.wl-done { text-align: center; padding-top: 24px; }
.wl-done[hidden], .wl-body[hidden] { display: none; }
.wl-tick {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #ECFDF3; color: #067647; font-size: 26px; font-weight: 700;
}
.wl-done-t { margin: 0 0 6px; font-size: 18px; font-weight: 700; }

/* The opener beside a sold-out ticket on the event page. */
.ev-wl {
  flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--accent, #0d6efd); border-radius: 10px;
  background: #fff; color: var(--accent-ink, var(--accent, #0d6efd));
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ev-wl:hover { background: var(--tintA, rgba(13, 110, 253, .06)); }
.ev-wl-cta { margin: 12px 0 0; text-align: center; font-size: 13.5px; color: var(--muted, #667085); }
.ev-wl-cta button {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 700; cursor: pointer;
  color: var(--accent-ink, var(--accent, #0d6efd)); text-decoration: underline; text-underline-offset: 2px;
}

/* A sold-out row in the registration form (views/event/register.php), which
   names its brand colour --primaryColor rather than --accent. */
.wl-soldout-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0; border-bottom: 1px solid #eee; }
.wl-soldout-item .ticket-name { color: #667085; }
.wl-soldout-note { display: block; font-size: 12px; font-weight: 400; color: #888; }
.wl-soldout-item .ev-wl, .wl-on-register { --accent: var(--primaryColor, #0d6efd); }
/* register.php styles every button full-width and every form as a card. */
.wl-soldout-item .ev-wl { width: auto; }
.wl-on-register form.wl { width: auto; min-width: 0; box-shadow: none; border-radius: 0; }

@media (max-width: 420px) {
  .wl-head { padding: 16px 18px 0; }
  .wl-body { padding: 10px 18px 20px; }
}
