/* ═══════════════════════════════════════════════════════════════════════
   M-A-S-T-E-R.ai — the waitlist dialog (inc/waitlist-ui.php).

   Centred rather than a side drawer: the cart drawer is a running tally you
   glance at, and this is one short task you finish and leave. Making them
   look the same would say they are the same kind of thing.
   ═══════════════════════════════════════════════════════════════════════ */

.master-wl-scrim {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
}

body.master-wl-open { overflow: hidden; }

.master-wl {
  /* This theme has no global border-box reset — .master-container is deliberately
     content-box — so without this the padding is added to the width and the
     dialog hangs a few pixels past both edges of a phone. */
  box-sizing: border-box;
  position: fixed;
  z-index: 1210;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(calc(100vw - 32px), 460px);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--master-color-chalk);
  border-radius: 18px;
  padding: clamp(24px, 4vw, 34px);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.28);
  animation: master-wl-in 180ms ease-out both;
}

@keyframes master-wl-in {
  from { opacity: 0; translate: -50% calc(-50% + 12px); }
  to   { opacity: 1; translate: -50% -50%; }
}

@media (prefers-reduced-motion: reduce) {
  .master-wl { animation: none; }
}

.master-wl__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--master-color-graphite);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.master-wl__close:hover,
.master-wl__close:focus-visible { background: var(--master-color-tracing); color: #111827; }

.master-wl__title {
  font-family: var(--master-font-display, "Space Grotesk", sans-serif);
  font-size: clamp(22px, 3.4vw, 27px);
  line-height: 1.15;
  margin: 6px 0 0;
  color: var(--master-color-plumb);
  text-wrap: balance;
}

/* The dates, given the weight the dates deserve — this is the one fact the
   person is checking before they hand over an address. */
.master-wl__for {
  margin: 10px 0 0;
  font-weight: 700;
  font-size: 17px;
  color: var(--master-color-index);
}

.master-wl__for:empty { display: none; }

.master-wl__promise {
  margin: 10px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--master-color-graphite);
}

/* ── The form ─────────────────────────────────────────────────────────── */

.master-wl__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 0;
}

.master-wl__field { margin: 0; }

.master-wl__field label {
  display: block;
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--master-color-graphite);
}

.master-wl__field label span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--master-color-quiet);
}

.master-wl__field input,
.master-wl__field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px; /* iOS zooms anything under 16px on focus. */
  color: var(--master-color-plumb);
  background: var(--master-color-chalk);
  border: 1px solid var(--master-color-scribe);
  border-radius: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.master-wl__field textarea { resize: vertical; min-height: 62px; }

.master-wl__field input:focus,
.master-wl__field textarea:focus {
  outline: none;
  border-color: var(--master-color-index);
  box-shadow: 0 0 0 3px rgba(215, 55, 79, 0.15);
}

/* Off-screen rather than display:none — some bots skip hidden fields, and a
   field they skip cannot catch them. */
.master-wl__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.master-wl__err {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--master-color-minium-wash);
  border: 1px solid var(--master-color-minium);
  color: var(--master-color-minium);
  font-size: 14px;
  line-height: 1.45;
}

.master-wl__submit {
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--master-color-index);
  color: var(--master-color-chalk);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.master-wl__submit:hover:not(:disabled) { background: var(--master-color-index-pressed); }
.master-wl__submit:active:not(:disabled) { transform: translateY(1px); }
.master-wl__submit:disabled { opacity: 0.6; cursor: default; }

.master-wl__submit--quiet {
  background: none;
  color: var(--master-color-plumb);
  border: 1px solid var(--master-color-scribe);
}

.master-wl__submit--quiet:hover:not(:disabled) { background: var(--master-color-tracing); }

.master-wl__fine {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--master-color-graphite);
  text-align: center;
}

/* ── Done ─────────────────────────────────────────────────────────────── */

.master-wl__done { text-align: center; padding: 8px 0 0; }

.master-wl__tick {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--master-color-index-wash);
  color: var(--master-color-index);
  font-size: 27px;
  line-height: 1;
}

.master-wl__msg {
  margin: 10px 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--master-color-graphite);
}

/* ── Triggers ─────────────────────────────────────────────────────────── */

/* A waitlist button is not an enrol button and must not be dressed as one:
   it is the honest second-best, so it reads as a considered offer rather than
   a consolation prize. */
.master-wl-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 11px 20px;
  border: 1px solid var(--master-color-index);
  border-radius: 999px;
  background: none;
  color: var(--master-color-index);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.master-wl-trigger:hover,
.master-wl-trigger:focus-visible { background: #d7374f; color: var(--master-color-chalk); }

.master-wl-trigger::after { content: "\2192"; font-weight: 400; }

/* Inside a cohort deck the trigger sits beside Enroll buttons, so it takes
   their metrics — a round pill at a larger size made the one full cohort the
   loudest thing in a row of six. */
.master-cohort-card .master-wl-trigger {
  min-height: 0;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

/* On the navy cohort deck the coral outline disappears into the card. */
.master-cohort-card:not(.master-cohort-card--light) .master-wl-trigger {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--master-color-chalk);
}

.master-cohort-card:not(.master-cohort-card--light) .master-wl-trigger:hover,
.master-cohort-card:not(.master-cohort-card--light) .master-wl-trigger:focus-visible {
  background: var(--master-color-chalk);
  color: var(--master-color-plumb);
  border-color: var(--master-color-chalk);
}

@media (max-width: 420px) {
  .master-wl { border-radius: 14px; padding: 22px 18px; }
  .master-wl-trigger { width: 100%; justify-content: center; }
}
