/* ============================================================================
   DMA PUBLIC — Event registration / booking (Phase-3 slice 4, workstream C).
   Booking-specific bits only: ticket option cards + the aside ticket panel. Reuses the shared
   .pub-form / .pub-field / .pub-btn primitives and the .pub-reg card look (link membership-register.css
   alongside this). Style N tokens only, so light/dark come for free.
   Adds a small booking-local status palette (--evt-*) for available / sold-out / free states — kept
   independent of the brand colour and re-mapped for dark, mirroring public.css.
   ============================================================================ */

:root {
  --evt-ok-ink:  #1e7a37;   /* "available" / free — matches .pub-alert--ok family */
  --evt-ok-bg:   #e8f6ec;
  --evt-ok-line: #34a853;
  --evt-off-ink: var(--pub-mut);   /* sold-out / not-on-sale */
  /* Page-level notice (e.g. "you already hold this ticket"). Amber: it is neither success nor a
     validation error, and it must NOT borrow the brand red, which is reserved for actions. */
  --evt-note-ink:  #8a5a00;   /* 5.5:1 on --evt-note-bg */
  --evt-note-bg:   #fff6e5;
  --evt-note-line: #e0a63a;
}
:root[data-theme="dark"] {
  --evt-ok-ink:  #6fcf8b;
  --evt-ok-bg:   rgba(52, 168, 83, .14);
  --evt-ok-line: #3f7d54;
  --evt-note-ink:  #f0c070;
  --evt-note-bg:   rgba(224, 166, 58, .14);
  --evt-note-line: #7d6433;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --evt-ok-ink:  #6fcf8b;
    --evt-ok-bg:   rgba(52, 168, 83, .14);
    --evt-ok-line: #3f7d54;
    --evt-note-ink:  #f0c070;
    --evt-note-bg:   rgba(224, 166, 58, .14);
    --evt-note-line: #7d6433;
  }
}

/* ---- "booking as {member}" note ---- */
.evt-book__member {
  display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 18px; padding: 12px 14px;
  border: 1px solid var(--evt-ok-line); border-radius: var(--pub-radius);
  background: var(--evt-ok-bg); color: var(--pub-ink); font-size: 0.88rem;
}
.evt-book__member :where(svg) { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--evt-ok-ink); }

/* ---- page-level notice with an action (duplicate booking, post-OTP failure) ----
   Same shape as the "booking as {member}" note so the page has ONE notice language; only the
   palette differs, and it carries an optional .pub-reg__actions row with a shared .pub-btn. */
.evt-book__notice {
  display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 18px; padding: 12px 14px;
  border: 1px solid var(--evt-note-line); border-radius: var(--pub-radius);
  background: var(--evt-note-bg); color: var(--pub-ink); font-size: 0.88rem;
}
.evt-book__notice > :where(svg) { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--evt-note-ink); }
.evt-book__notice-body { flex: 1 1 auto; min-width: 0; }
.evt-book__notice-msg { margin: 0; font-weight: 600; color: var(--pub-ink); }
.evt-book__notice-detail { margin: 4px 0 0; color: var(--pub-mut); font-size: 0.84rem; }
/* .pub-reg__actions ships a 22px top margin (and interior-v4 re-asserts it at (0,2,0)); inside a
   notice that is far too much, so this override is written at (0,3,0) to win regardless of load order. */
.evt-book__notice .pub-reg__actions.evt-book__notice-actions { margin-top: 12px; }

/* ---- ticket chooser (radio cards) ---- */
.evt-book__tickets { display: grid; gap: 12px; border: 0; padding: 0; margin: 0 0 6px; }
.evt-ticket {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1.5px solid var(--pub-line); border-radius: var(--pub-radius); background: var(--pub-card);
  transition: border-color var(--motion-fast, .18s) var(--ease-out, ease),
              background var(--motion-fast, .18s) var(--ease-out, ease);
}
.evt-ticket:hover { border-color: var(--brand-red); }
.evt-ticket:has(input:checked) { border-color: var(--brand-red); background: var(--brand-navy-tint, var(--pub-soft)); }
.evt-ticket:has(input:focus-visible) { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
.evt-ticket input { margin-top: 3px; flex: none; }
.evt-ticket.is-disabled { cursor: not-allowed; opacity: .7; background: var(--pub-soft); }
.evt-ticket.is-disabled:hover { border-color: var(--pub-line); }

.evt-ticket__body { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.evt-ticket__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.evt-ticket__name { color: var(--pub-ink); font-size: 0.98rem; }
.evt-ticket__price { color: var(--pub-accent-ink); font-weight: 600; font-size: 1.02rem; white-space: nowrap; }
.evt-ticket__price.is-free { color: var(--evt-ok-ink); text-transform: uppercase; letter-spacing: .04em; font-size: .9rem; }
.evt-ticket__desc { color: var(--pub-mut); font-size: 0.85rem; }
.evt-ticket__status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }

.evt-ticket__badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: .02em;
  border-radius: 999px; padding: 2px 9px; border: 1px solid var(--pub-line); color: var(--pub-mut);
  background: var(--pub-soft);
}
.evt-ticket__badge--ok { color: var(--evt-ok-ink); background: var(--evt-ok-bg); border-color: var(--evt-ok-line); }
.evt-ticket__badge--out { color: var(--pub-red-ink); background: var(--brand-red-tint, var(--pub-soft)); border-color: var(--pub-red-ink); }
.evt-ticket__badge--closed { color: var(--evt-off-ink); }
.evt-ticket__badge--tag { color: var(--pub-accent-ink); border-color: var(--pub-accent-ink); background: transparent; }

/* ---- quantity + coupon spacing ---- */
.evt-book__qty { max-width: 180px; margin-top: 14px; }
.evt-book__coupon { margin-top: 6px; }

/* ---- aside ticket panel on the event detail page ---- */
.evt-book__panel { margin-top: 16px; }
.evt-book__ticketlist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.evt-book__ticketrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--pub-line);
}
.evt-book__ticketrow:last-child { border-bottom: 0; }
.evt-book__ticketrow.is-off { opacity: .65; }
.evt-book__ticketname { color: var(--pub-ink); font-weight: 600; font-size: 0.9rem; display: flex; flex-direction: column; gap: 2px; }
.evt-book__ticketelig { color: var(--pub-accent-ink); font-weight: 700; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; }
.evt-book__ticketmeta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.evt-book__ticketprice { color: var(--pub-accent-ink); font-weight: 600; font-size: 0.95rem; }
.evt-book__ticketprice.is-free { color: var(--evt-ok-ink); font-size: 0.82rem; text-transform: uppercase; letter-spacing: .04em; }
.evt-book__ticketstate { color: var(--pub-mut); font-size: 0.72rem; }
.evt-book__ticketstate--out { color: var(--pub-red-ink); font-weight: 700; }

/* ---- narrow screens ---- */
@media (max-width: 480px) {
  .evt-ticket { padding: 12px 14px; }
  .evt-ticket__head { flex-direction: column; gap: 2px; }
  .evt-book__qty { max-width: none; }
}

/* ---- members-only prompt (Q1 Option B) — shown in the detail aside in place of the booking panel
   when a non-active-member views a MembersOnly event. Presentation only; access is server-enforced. ---- */
.evt-membersonly {
  margin-top: 14px; padding: 16px; border: 1px solid var(--pub-line);
  border-radius: var(--pub-radius); background: var(--pub-bg-soft, var(--pub-bg));
}
.evt-membersonly__head {
  display: flex; align-items: center; gap: 8px; font-weight: 600;
  color: var(--brand-navy); margin-bottom: 6px;
}
.evt-membersonly__head :where(svg) { width: 18px; height: 18px; flex: none; }
.evt-membersonly__note { margin: 0 0 14px; color: var(--pub-mut); font-size: 0.9rem; }
.evt-membersonly .evt-register { margin-top: 8px; }

/* ── Secondary registration routes, inside the Registration & Event Pass panel ─────────
   Subordinate to the primary Register button by design: outlined rather than filled, so the
   panel keeps ONE obvious first action and these read as alternatives. Same .pub-btn
   primitive as every other control on the public site — no bespoke button. */
/* Labels past the card width are cut with "…"; the full text (and note) is in the link's title. */
/* 16 Nov 2026 (DMA): short buttons now pair up — AT MOST TWO PER ROW. Each button is at least half
   the row wide (min-width ≈ 50%), so a third can never fit beside two; it also grows with its label,
   so a long label takes the whole row (then "…" past the card width) instead of being squeezed. */
.evt-altreg { display: flex; flex-flow: row wrap; align-items: stretch; gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--pub-line); }
.evt-altreg__hd, .evt-altreg__foot { flex: 0 0 100%; }
/* Standalone (no booking panel): these links ARE the registration, so no divider above them. */
.evt-altreg.evt-altreg--solo { margin-top: 0; padding-top: 0; border-top: 0; }
.evt-altreg__hd { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--pub-mut); margin: 0; }
/* (0,2,1) - beats .dma3d .v4-btn (0,2,0) and the .pub-btn base, which both set display/padding. */
.evt-altreg a.evt-altreg__btn { display: inline-flex; flex-direction: column; align-items: flex-start;
  justify-content: center; gap: 1px; width: auto; max-width: 100%; box-sizing: border-box;
  flex: 1 1 auto; min-width: calc(50% - 6px);   /* 1px slack: two halves + the 10px gap must never round past 100% */
  margin: 0; padding: 9px 18px; text-align: left; line-height: 1.3; }
.evt-altreg__label,
.evt-altreg__note { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-altreg__label { font-weight: 700; }
.evt-altreg__note { font-size: .76rem; font-weight: 400; opacity: .85; }
.evt-altreg__foot { margin: 2px 0 0; font-size: .72rem; color: var(--pub-mut); }
