/*
 * « Me prévenir » (#704, #845): the button under a full date and its dialog.
 * V5 tokens and shared parts from triplan-design-system.css (.tp-btn, .tp-field, .tp-label,
 * .tp-input, .tp-alert); the dialog follows the anatomy of the site's sign-in popup
 * (icon block, eyebrow, title, bordered close, bottom sheet on phones). The people counter
 * is the booking card's (.tp-destination-booking__people) and the consent card is the booking
 * form's (booking-consent.css, --reservation-flow). The scoped rules below restate values where
 * destination and theme styles would otherwise win.
 */

.tp-destination-booking__full {
  display: grid;
  gap: 6px;
}

/* V5 secondary button (.tp-btn--secondary), full width under the sold-out date. */
.tp-destination-booking .tp-destination-booking__notify {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  border: 1.5px solid var(--tp-line, #e7e0d4);
  border-radius: var(--tp-control-radius, 12px);
  background: var(--tp-surface, #fff);
  color: var(--tp-ink, #0b2239);
  font: 700 14px/1.25 var(--tp-body-font, "Inter", system-ui, sans-serif);
  text-align: center;
  box-shadow: none;
}

.tp-destination-booking .tp-destination-booking__notify i {
  color: var(--tp-cyan-hover, #087c89);
}

.tp-destination-booking .tp-destination-booking__notify:hover {
  border-color: var(--tp-cyan, #1bbaca);
  background: var(--tp-cyan-tint, #ddf6f8);
  color: var(--tp-cyan-hover, #087c89);
}

/* #845: no open date, the booking card's main button opens the same dialog. */
.tp-destination-booking .tp-destination-booking__cta--notify {
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  font-family: inherit;
  text-align: center;
}

.tp-destination-booking .tp-destination-booking__cta--notify .tp-destination-booking__cta-label {
  display: block;
  text-wrap: balance;
}

/* Dialog. The --tp-booking-* values are the booking form's, for its consent card. */
.tp-waitlist {
  --tp-booking-border: var(--tp-line);
  --tp-booking-text: var(--tp-ink);
  --tp-booking-muted: var(--tp-muted);
  position: fixed;
  inset: 0;
  z-index: 100000;
  width: min(520px, calc(100vw - 40px));
  height: fit-content;
  max-height: min(840px, calc(100dvh - 40px));
  margin: auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: var(--tp-surface, #fff);
  color: var(--tp-ink, #0b2239);
  box-shadow: 0 28px 80px rgba(12, 31, 40, 0.22), 0 8px 24px rgba(12, 31, 40, 0.08);
  overflow: hidden;
}

.tp-waitlist:not([open]) {
  display: none;
}

.tp-waitlist[open] {
  display: flex;
  flex-direction: column;
  animation: tp-waitlist-in 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.tp-waitlist::backdrop {
  background: rgba(13, 31, 41, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@keyframes tp-waitlist-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

@keyframes tp-waitlist-sheet {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* The panel fills the dialog, so a click on the dialog itself is a backdrop click. */
.tp-waitlist__panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  font-family: var(--tp-body-font, "Inter", system-ui, sans-serif);
}

.tp-waitlist__header {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 24px 68px 19px 26px;
  border-bottom: 1px solid var(--tp-line, #e7e0d4);
}

.tp-waitlist__mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: var(--tp-cyan-tint, #ddf6f8);
  color: var(--tp-cyan-hover, #087c89);
  font-size: 1.15rem;
}

.tp-waitlist__heading {
  min-width: 0;
}

.tp-waitlist__eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--tp-accent-text, #066d79);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tp-waitlist .tp-waitlist__title {
  margin: 0;
  color: var(--tp-ink, #0b2239);
  font: 750 clamp(1.25rem, 3vw, 1.55rem)/1.2 var(--tp-heading-font, "Bricolage Grotesque", system-ui, sans-serif);
  letter-spacing: -0.02em;
}

.tp-waitlist__trip {
  margin: 4px 0 0;
  color: var(--tp-muted, #5c6b79);
  font-size: 14px;
  line-height: 1.45;
}

.tp-waitlist .tp-waitlist__close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--tp-line, #e7e0d4);
  border-radius: var(--tp-control-radius, 12px);
  background: var(--tp-surface, #fff);
  box-shadow: 0 5px 14px rgba(15, 32, 39, 0.06);
  color: var(--tp-ink, #0b2239);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.tp-waitlist .tp-waitlist__close:hover {
  border-color: var(--tp-cyan, #1bbaca);
  background: var(--tp-cyan-tint, #ddf6f8);
  color: var(--tp-cyan-hover, #087c89);
}

.tp-waitlist__body {
  min-height: 0;
  padding: 20px 26px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tp-waitlist__intro {
  margin: 0 0 18px;
  color: var(--tp-slate, #3a4a57);
  font-size: 15px;
  line-height: 1.55;
}

.tp-waitlist__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.tp-waitlist__field {
  min-width: 0;
  margin: 0;
}

/* .tp-label */
.tp-waitlist .tp-waitlist__field .tp-label {
  color: var(--tp-700, #3a4a57);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.tp-waitlist .tp-waitlist__field .tp-label span {
  color: var(--tp-muted, #5c6b79);
  font-weight: 400;
}

/* .tp-input, also on the shared phone field. 16px text so phones do not zoom on focus. */
.tp-waitlist .tp-waitlist__field .tp-input,
.tp-waitlist .tp-managed-phone > input,
.tp-waitlist .tp-managed-phone__toggle {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--tp-line-2, #e4ded3);
  border-radius: var(--tp-control-radius, 12px);
  background: var(--tp-surface-2, #fbf9f5);
  color: var(--tp-ink, #0b2239);
  font: 400 16px/1.3 var(--tp-body-font, "Inter", system-ui, sans-serif);
  box-shadow: none;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.tp-waitlist .tp-waitlist__field .tp-input::placeholder,
.tp-waitlist .tp-managed-phone > input::placeholder {
  color: var(--tp-faint, #8a96a1);
}

.tp-waitlist .tp-waitlist__field .tp-input:focus,
.tp-waitlist .tp-managed-phone > input:focus,
.tp-waitlist .tp-managed-phone__toggle:focus-visible,
.tp-waitlist .tp-managed-phone.is-open .tp-managed-phone__toggle {
  border-color: var(--tp-cyan-hover, #087c89);
  background: var(--tp-surface, #fff);
  box-shadow: 0 0 0 3px var(--tp-cyan-tint, #ddf6f8);
  outline: none !important;
}

.tp-waitlist .tp-managed-phone > input[aria-invalid="true"] {
  border-color: var(--tp-err-fg, #8a1f14);
}

.tp-waitlist .tp-managed-phone__country {
  flex-basis: 112px;
}

.tp-waitlist .tp-managed-phone__toggle {
  gap: 8px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
}

.tp-waitlist .tp-managed-phone__toggle i {
  color: var(--tp-muted, #5c6b79);
}

/* The list always opens below, inside the scrolling body. */
.tp-waitlist .tp-managed-phone__menu,
.tp-waitlist .tp-managed-phone.is-above .tp-managed-phone__menu {
  top: calc(100% + 8px);
  bottom: auto;
  padding: 12px;
  border: 1px solid var(--tp-line, #e7e0d4);
  border-radius: 14px;
  box-shadow: var(--tp-shadow-xl, 0 20px 46px rgba(15, 27, 45, 0.16));
}

.tp-waitlist .tp-managed-phone__menu input[type="search"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1.5px solid var(--tp-line-2, #e4ded3);
  border-radius: 10px;
  background: var(--tp-surface-2, #fbf9f5);
  color: var(--tp-ink, #0b2239);
  font: 400 16px/1.3 var(--tp-body-font, "Inter", system-ui, sans-serif);
  box-shadow: none;
}

.tp-waitlist .tp-managed-phone__options button {
  border-radius: 9px;
  color: var(--tp-ink, #0b2239);
}

.tp-waitlist .tp-managed-phone__options button:hover,
.tp-waitlist .tp-managed-phone__options button.is-selected {
  background: var(--tp-cyan-tint, #ddf6f8);
}

.tp-waitlist .tp-waitlist__field .tp-error:not([hidden]) {
  display: block;
  color: var(--tp-err-fg, #8a1f14);
  font-size: 12px;
  line-height: 1.4;
}

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

/* The booking card's counter row keeps its look; the dialog grid sets the spacing. */
.tp-waitlist .tp-waitlist__people {
  margin: 0;
}

/* Booking-form consent card: only the spacing inside the dialog and the privacy link. */
.tp-waitlist .tp-waitlist__consent {
  margin: 18px 0 0;
}

.tp-waitlist .tp-waitlist__consent .tp-booking-consent__summary {
  cursor: default;
}

.tp-waitlist .tp-waitlist__consent .tp-booking-consent__title {
  cursor: pointer;
}

.tp-waitlist .tp-waitlist__consent .tp-booking-consent__notice a {
  color: var(--tp-accent-text, #066d79);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tp-waitlist__status {
  margin: 0;
  color: var(--tp-err-fg, #8a1f14);
  font-size: 14px;
  line-height: 1.45;
}

.tp-waitlist__status:not(:empty) {
  margin-top: 12px;
}

/* .tp-btn .tp-btn--lg with the accessible action colour (white text, AA). */
.tp-waitlist .tp-waitlist__submit {
  width: 100%;
  min-height: 50px;
  margin: 16px 0 0;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--tp-control-radius, 12px);
  background: var(--tp-action, #087c89);
  color: var(--tp-on-primary, #fff);
  font: 700 15px/1.2 var(--tp-body-font, "Inter", system-ui, sans-serif);
  box-shadow: none;
}

.tp-waitlist .tp-waitlist__submit:hover {
  background: var(--tp-action-hover, #066d79);
  color: var(--tp-on-primary, #fff);
}

.tp-waitlist .tp-waitlist__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Confirmation: .tp-alert--success, then a .tp-btn--secondary to close. */
.tp-waitlist .tp-waitlist__done-text {
  margin: 0 0 16px;
  font-size: 15px;
}

.tp-waitlist__done-text i {
  margin-top: 4px;
}

.tp-waitlist .tp-waitlist__done-close {
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 14px 28px;
  border: 1.5px solid var(--tp-line, #e7e0d4);
  border-radius: var(--tp-control-radius, 12px);
  background: var(--tp-surface, #fff);
  color: var(--tp-ink, #0b2239);
  font: 700 15px/1.2 var(--tp-body-font, "Inter", system-ui, sans-serif);
  box-shadow: none;
}

.tp-waitlist .tp-waitlist__done-close:hover {
  border-color: var(--tp-cyan, #1bbaca);
  background: var(--tp-cyan-tint, #ddf6f8);
  color: var(--tp-cyan-hover, #087c89);
}

/* Phones: bottom sheet, one column (same breakpoint as the sign-in popup). */
@media (max-width: 560px) {
  .tp-waitlist {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    margin: auto auto 10px;
    border-radius: 18px;
  }

  .tp-waitlist[open] {
    animation-name: tp-waitlist-sheet;
  }

  .tp-waitlist__header {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 18px 58px 15px 17px;
  }

  .tp-waitlist__mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .tp-waitlist .tp-waitlist__close {
    top: 15px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .tp-waitlist__body {
    padding: 16px 17px calc(17px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-waitlist[open] {
    animation: none;
  }

  .tp-destination-booking .tp-destination-booking__notify,
  .tp-waitlist .tp-waitlist__close,
  .tp-waitlist .tp-waitlist__field .tp-input,
  .tp-waitlist .tp-managed-phone > input,
  .tp-waitlist .tp-managed-phone__toggle,
  .tp-waitlist .tp-waitlist__submit,
  .tp-waitlist .tp-waitlist__done-close {
    transition: none;
  }
}
