/* ==========================================================================
   Registration consent checkbox + Release & Waiver modal
   Shared by index-en.html (dialog#attendeeDialog) and index-vi.html.
   Relies on the design tokens defined in vi-registration.css.
   ========================================================================== */

/* ---------- Consent row (step 2 of the registration dialog) ---------- */

.attendee-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--registration-line);
  border-radius: 6px;
  background: var(--registration-surface);
  cursor: pointer;
}

.attendee-consent:has(input:checked) {
  border-color: var(--registration-red);
  background: #fff7f8;
}

/* Until the waiver document is agreed to, the box reads as locked: it can only
   be ticked from inside the dialog, so clicking it opens the document. */
.attendee-consent.is-locked input {
  cursor: not-allowed;
  opacity: 0.5;
}

.attendee-consent.is-locked .attendee-consent-text {
  color: var(--registration-muted);
}

.attendee-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--registration-red);
  cursor: pointer;
}

.attendee-consent-text {
  color: var(--registration-ink);
  font-size: 13.5px;
  line-height: 1.55;
}

/* Inline trigger that opens the waiver document. Styled as a link, works as a
   real button so keyboard users can activate it with Enter/Space. */
.waiver-consent-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--registration-red);
  background: none;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.waiver-consent-link:hover,
.waiver-consent-link:focus-visible {
  color: var(--registration-red-dark);
}

/* ---------- Waiver document dialog ---------- */

/* Inherits sizing, radius and ::backdrop from .attendee-dialog. Only the
   internal layout changes: fixed header + scrolling body + fixed footer. */
.waiver-dialog {
  width: min(860px, calc(100% - 32px));
  overflow: hidden;
}

/* display is only set while open, otherwise the closed dialog would stay
   visible (the UA stylesheet relies on `dialog:not([open]) { display: none }`). */
.waiver-dialog[open] {
  display: flex;
  flex-direction: column;
}

.waiver-dialog-close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--registration-line);
  border-radius: 50%;
  color: var(--registration-ink);
  background: #fff;
  cursor: pointer;
}

.waiver-dialog-close:hover {
  border-color: var(--registration-red);
  color: var(--registration-red);
}

.waiver-dialog-head {
  flex: 0 0 auto;
  padding: 20px 64px 14px clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--registration-line);
  background: #fff;
}

.waiver-dialog-kicker {
  margin: 0;
  color: var(--registration-red);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.waiver-dialog-head h2 {
  margin: 7px 0 0;
  color: var(--registration-ink);
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.2;
}

.waiver-dialog-sub {
  margin: 7px 0 0;
  color: var(--registration-muted);
  font-size: 13px;
  line-height: 1.45;
}

.waiver-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px clamp(20px, 4vw, 40px) 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #c7c7c7 transparent;
  scrollbar-width: thin;
}

.waiver-dialog-foot {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--registration-line);
  background: #fff;
}

.waiver-dialog-hint {
  min-width: 0;
  margin: 0;
  color: var(--registration-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.waiver-dialog-hint[hidden] {
  display: none;
}

.waiver-agree {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid var(--registration-red);
  border-radius: 5px;
  color: #fff;
  background: var(--registration-red);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.waiver-agree:disabled {
  border-color: var(--registration-line);
  color: #9a9a9a;
  background: #f1f1f1;
  cursor: not-allowed;
}

/* ---------- Waiver document content ---------- */

.waiver-doc {
  color: var(--registration-ink);
  font-size: 14px;
  line-height: 1.62;
}

.waiver-doc h3 {
  margin: 0;
  font-size: clamp(18px, 2.3vw, 23px);
  line-height: 1.22;
}

.waiver-doc-org {
  margin: 0;
  color: var(--registration-red);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.waiver-doc-meta {
  display: grid;
  gap: 3px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--registration-muted);
  font-size: 13px;
  list-style: none;
}

.waiver-doc-meta strong {
  color: var(--registration-ink);
  font-weight: 700;
}

.waiver-doc-intro {
  margin: 16px 0 0;
  font-weight: 600;
}

.waiver-doc h4 {
  margin: 24px 0 8px;
  font-size: 15px;
  line-height: 1.35;
}

.waiver-doc p {
  margin: 0 0 12px;
}

.waiver-doc > :last-child {
  margin-bottom: 4px;
}

@media (max-width: 560px) {
  .waiver-dialog-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .waiver-agree {
    width: 100%;
  }
}
