/* =========================================================
   Reserve pop-up — fits the window (no scrollbar), compact form,
   springs open from the clicked button, staggered content, smooth close
   ========================================================= */

/* ---------- no scrollbar: the form is compacted and (if needed) zoomed to fit by content.js ---------- */
.rmodal__dialog {
  width: min(100%, 600px);
  max-height: none;
  overflow: visible;
  padding-top: 0;
  transform-origin: center;
  /* open / close are keyframe animations below */
  opacity: 0;
  transform: none;
  transition: none;
}
.rmodal__dialog.rsv { overflow: visible; }

/* compact form inside the pop-up */
.rmodal .rsv__wrap { padding-top: 40px; }
.rmodal .rsv__badge { top: 40px; }
.rmodal .rsv__card { padding: 54px clamp(18px, 4vw, 30px) 22px; border-radius: 24px; }
.rmodal .rsv__title { font-size: clamp(26px, 3vw, 32px); }
.rmodal .rsv__when { margin-top: 6px; font-size: 14.5px; }
.rmodal .rsv__form { margin-top: 18px; }
.rmodal .rsv__grid { gap: 10px 12px; }
.rmodal .rfield__box { height: 48px; }
.rmodal .rsv__submit-wrap { margin-top: 14px; }
.rmodal .rsv__note { margin-top: 8px; }
.rmodal .rsv__steps { display: none; }              /* keeps the pop-up short */
.rmodal .rmodal__close { top: 52px; right: 14px; }

/* ---------- backdrop: blur + a purple glow blooming from the clicked button ---------- */
.rmodal__backdrop {
  background:
    radial-gradient(600px 600px at var(--ox, 50%) var(--oy, 50%), rgba(140, 50, 255, .28), transparent 70%),
    rgba(5, 2, 12, .8);
  transition: opacity .45s ease;
}
.rmodal.is-closing .rmodal__backdrop { opacity: 0; transition-duration: .4s; }

/* ---------- open: springs out from the button ---------- */
.rmodal.is-open .rmodal__dialog { opacity: 1; animation: pmIn .7s cubic-bezier(.22, 1.2, .36, 1) both; }
.rmodal.is-closing .rmodal__dialog { animation: pmOut .42s cubic-bezier(.55, 0, .7, .2) both; }

/* staggered content while opening */
.rmodal.is-opening .rsv__badge { animation: pmBadge .8s cubic-bezier(.34, 1.56, .64, 1) .25s both; }
.rmodal.is-opening .rsv__title,
.rmodal.is-opening .rsv__when,
.rmodal.is-opening .rfield,
.rmodal.is-opening .rsv__submit-wrap,
.rmodal.is-opening .rsv__note,
.rmodal.is-opening .rmodal__close { animation: pmUp .55s var(--ease, ease) both; }
.rmodal.is-opening .rsv__title        { animation-delay: .22s; }
.rmodal.is-opening .rsv__when         { animation-delay: .28s; }
.rmodal.is-opening .rfield:nth-child(1) { animation-delay: .34s; }
.rmodal.is-opening .rfield:nth-child(2) { animation-delay: .38s; }
.rmodal.is-opening .rfield:nth-child(3) { animation-delay: .42s; }
.rmodal.is-opening .rfield:nth-child(4) { animation-delay: .46s; }
.rmodal.is-opening .rfield:nth-child(5) { animation-delay: .50s; }
.rmodal.is-opening .rsv__submit-wrap  { animation-delay: .58s; }
.rmodal.is-opening .rsv__note         { animation-delay: .64s; }
.rmodal.is-opening .rmodal__close     { animation: pmClose .6s cubic-bezier(.34, 1.56, .64, 1) .45s both; }

@keyframes pmIn {
  0%   { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.25); filter: blur(10px); }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes pmOut {
  0%   { opacity: 1; transform: none; filter: none; }
  100% { opacity: 0; transform: translate(calc(var(--dx, 0) * .35), calc(var(--dy, 0) * .35 + 20px)) scale(.82); filter: blur(6px); }
}
@keyframes pmUp    { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pmBadge { from { opacity: 0; transform: translate(-50%, -150%) scale(.4) rotate(-30deg); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes pmClose { from { opacity: 0; transform: scale(0) rotate(-180deg); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .rmodal { padding: 10px; }
  .rmodal .rsv__card { padding-top: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .rmodal .rmodal__dialog, .rmodal .rmodal__dialog * { animation: none !important; }
  .rmodal.is-open .rmodal__dialog { opacity: 1; }
  .rmodal.is-closing .rmodal__dialog { opacity: 0; }
}
