/* GLOBAL "Book a demo" MODAL — Figma 1178:2030 (Mo 2026-11-19).
   Markup: parts/rp-demo-modal.html · JS: assets/js/rp-demo-modal.js · switch: inc/demo-modal.php.
   Everything is scoped under #rp-dm so it is safe on WP pages AND on the static Webflow snapshots
   (/pricing etc.), whose global h2/p/ul/img rules would otherwise leak in.
   The HubSpot form renders in an iframe — its styling is injected from rp-demo-modal.js, not here. */

#rp-dm[hidden] { display: none !important; }
#rp-dm {
  position: fixed; inset: 0; z-index: 2147483647; /* max: above the HubSpot chat bubble + cookie bar (Mo 2026-11-19) */
  display: flex; align-items: center; justify-content: center;
  padding: 24px; box-sizing: border-box;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  font-family: Mulish, sans-serif;
}
#rp-dm *, #rp-dm *::before, #rp-dm *::after { box-sizing: border-box; }
#rp-dm .rp-dm__overlay { position: fixed; inset: 0; background: rgba(2, 17, 67, .6); }

#rp-dm .rp-dm__dialog {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 48px;
  width: 100%; max-width: 1120px; margin: auto;
  padding: 72px 56px 48px;
  border-radius: 24px;
  background: linear-gradient(180deg, #112C8C 0%, #021143 100%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  color: #fff; text-align: left;
}

/* close */
#rp-dm .rp-dm__close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 22px; background: rgba(255, 255, 255, .12);
  cursor: pointer; transition: background .2s ease;
}
#rp-dm .rp-dm__close:hover { background: rgba(255, 255, 255, .22); }
#rp-dm .rp-dm__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* left */
#rp-dm .rp-dm__left { flex: 0 0 456px; width: 456px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
#rp-dm .rp-dm__title {
  margin: 0; padding: 0; font-family: Mulish, sans-serif;
  font-size: 34px; line-height: 1.15; font-weight: 700; color: #fff;
  text-transform: none; letter-spacing: 0; text-align: left;
  margin-bottom: 8px; /* breathing room above the first field */
}
#rp-dm .rp-dm__form { position: relative; min-height: 120px; }
/* loader: CSS ring instead of the white-background spinner GIF (it showed as a white square on the navy modal) */
#rp-dm .rp-dm__loader {
  display: block; width: 44px; height: 44px; margin: 40px auto;
  border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: #fff;
  animation: rp-dm-spin .8s linear infinite;
}
@keyframes rp-dm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #rp-dm .rp-dm__loader { animation-duration: 2s; } }
#rp-dm .rp-dm__form.is-ready .rp-dm__loader { display: none; }
#rp-dm #rp-dm-form { margin: -4px; } /* matches the 4px body gutter inside the form iframe (focus ring room) */
#rp-dm #rp-dm-form iframe { width: 100% !important; display: block; border: 0; }
#rp-dm .rp-dm__legal { margin: -4px 0 0; font-size: 12px; line-height: 1.5; font-weight: 400; color: #C7D4FF; text-align: center; }
#rp-dm .rp-dm__legal a { color: #fff; text-decoration: none; }
#rp-dm .rp-dm__legal a:hover { text-decoration: underline; }

/* divider */
#rp-dm .rp-dm__divider { align-self: stretch; flex: 0 0 1px; width: 1px; background: rgba(255, 255, 255, .18); }

/* right */
#rp-dm .rp-dm__right { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
#rp-dm .rp-dm__why-h { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; color: #fff; }
#rp-dm .rp-dm__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
#rp-dm .rp-dm__list li { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 0; font-size: 16px; line-height: 1.45; color: #fff; }
#rp-dm .rp-dm__list li::before { content: none; }
#rp-dm .rp-dm__list svg { flex: 0 0 22px; margin-top: 2px; }
#rp-dm .rp-dm__list b { font-weight: 700; }
/* badges scale with the column: 4 × 17.5% + 1 × 20% + 4 gaps × 2.5% = 100% of a row capped at 420px */
#rp-dm .rp-dm__badges { display: flex; align-items: flex-start; justify-content: center; gap: 2.5%; flex-wrap: nowrap; width: 100%; max-width: 420px; }
#rp-dm .rp-dm__badges img { display: block; width: 17.5%; height: auto; max-width: none; margin: 0; flex: 0 0 auto; min-width: 0; }
#rp-dm .rp-dm__badges img.rp-dm__badge-lg { width: 20%; }
/* proof block (Mo 2026-11-19): divider → G2 / Capterra chips → badge row (Leader larger, tops aligned) */
#rp-dm .rp-dm__sep { display: none; } /* Mo 2026-11-19: no divider on any size */
#rp-dm .rp-dm__chips { width: 100%; max-width: 420px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
#rp-dm .rp-dm__chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  background: #FAFBFF; font-size: 13.5px; line-height: 20px; font-weight: 700; white-space: nowrap;
}
#rp-dm .rp-dm__chip img { width: 20px; height: 20px; display: block; margin: 0; flex: 0 0 20px; }
#rp-dm .rp-dm__chip--g2 { border: 1px solid #FF492C; color: #FF492C; }
#rp-dm .rp-dm__chip--cap { border: 1px solid #FAFBFF; color: #044D80; font-weight: 400; }
#rp-dm .rp-dm__chip--cap b { font-weight: 700; }
#rp-dm .rp-dm__proof { align-self: center; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* DESKTOP (Mo 2026-11-19): badges in an arc (Figma 1269:2531 layout) with the two chips stacked in the middle */
@media (min-width: 1101px) {
  #rp-dm .rp-dm__proof { position: relative; display: block; max-width: 400px; aspect-ratio: 454.5 / 242; margin-top: 18px; }
  #rp-dm .rp-dm__badges { position: absolute; inset: 0; display: block; max-width: none; }
  #rp-dm .rp-dm__badges img { position: absolute; width: 17.46%; }
  #rp-dm .rp-dm__badges .rp-dm__b1 { left: 0;      top: 59.74%; }
  #rp-dm .rp-dm__badges .rp-dm__b2 { left: 20.04%; top: 24.09%; }
  #rp-dm .rp-dm__badges .rp-dm__b3 { left: 40.07%; top: 0; width: 19.86%; }
  #rp-dm .rp-dm__badges .rp-dm__b4 { left: 62.58%; top: 24.09%; }
  #rp-dm .rp-dm__badges .rp-dm__b5 { left: 82.54%; top: 59.74%; }
  #rp-dm .rp-dm__chips { position: absolute; z-index: 1; left: 50%; top: 63%; transform: translateX(-50%);
    width: auto; max-width: none; flex-direction: column; align-items: center; gap: 6px; }
  #rp-dm .rp-dm__chip { font-size: 11.5px; line-height: 15px; padding: 5px 9px; gap: 6px; }
  #rp-dm .rp-dm__chip img { width: 16px; height: 16px; flex-basis: 16px; }
}

body.rp-dm-open { overflow: hidden !important; }
/* while the modal is open, the HubSpot chat launcher (also max z-index) is hidden so it can't sit on top */
body.rp-dm-open #hubspot-messages-iframe-container { visibility: hidden !important; }

/* short laptop screens (e.g. 1512×758): tighten vertically so the dialog fits without scrolling */
@media (min-width: 1101px) and (max-height: 840px) {
  #rp-dm { padding: 16px 24px; }
  #rp-dm .rp-dm__dialog { padding: 48px 56px 32px; }
  #rp-dm .rp-dm__left { gap: 14px; }
  #rp-dm .rp-dm__title { font-size: 30px; }
}

/* tablet: below the 2-column width the dialog stacks — form first, proof below */
@media (max-width: 1100px) {
  #rp-dm .rp-dm__dialog { flex-direction: column; align-items: stretch; max-width: 640px; padding: 64px 40px 40px; gap: 32px; }
  #rp-dm .rp-dm__left { flex: none; width: 100%; }
  #rp-dm .rp-dm__divider { flex: 0 0 1px; width: 100%; height: 1px; }
  #rp-dm .rp-dm__right { gap: 20px; }
  /* tablet + phone (Mo 2026-11-19): only the proof (chips + badges) under the form — no heading / 3 points,
     and no second divider (the stacked layout already has one between form and proof) */
  #rp-dm .rp-dm__why-h, #rp-dm .rp-dm__list, #rp-dm .rp-dm__sep { display: none; }
}
/* phone */
@media (max-width: 767px) {
  #rp-dm { padding: 12px; align-items: flex-start; }
  #rp-dm .rp-dm__dialog { padding: 56px 20px 28px; border-radius: 16px; gap: 24px; }
  #rp-dm .rp-dm__close { top: 12px; right: 12px; }
  #rp-dm .rp-dm__why-h { font-size: 19px; }
  #rp-dm .rp-dm__list { gap: 14px; }
  #rp-dm .rp-dm__chips { max-width: none; flex-wrap: nowrap; gap: 6px; }
  #rp-dm .rp-dm__chip { font-size: 11px; line-height: 16px; padding: 6px 8px; gap: 5px; }
  #rp-dm .rp-dm__chip img { width: 14px; height: 14px; flex-basis: 14px; }
  #rp-dm .rp-dm__proof { gap: 12px; max-width: 340px; }
  #rp-dm .rp-dm__left { gap: 14px; }
  #rp-dm .rp-dm__title { font-size: 24px; }
  #rp-dm .rp-dm__legal { font-size: 11px; }
  #rp-dm .rp-dm__list li { font-size: 15px; }
}

/* ── ARABIC / RTL (parts/ar-rp-demo-modal.html, Mo 2026-11-19) ─────────────────────────────
   Same layout mirrored by dir="rtl"; only the things that don't flip on their own are set here. */
#rp-dm[dir="rtl"], #rp-dm[dir="rtl"] .rp-dm__title { font-family: Almarai, Mulish, sans-serif; }
#rp-dm[dir="rtl"] .rp-dm__dialog,
#rp-dm[dir="rtl"] .rp-dm__title { text-align: right; }
#rp-dm[dir="rtl"] .rp-dm__close { right: auto; left: 20px; }
#rp-dm[dir="rtl"] .rp-dm__title { line-height: 1.3; }
#rp-dm[dir="rtl"] .rp-dm__list li { line-height: 1.6; }
#rp-dm[dir="rtl"] .rp-dm__chip { font-family: Almarai, Mulish, sans-serif; }
#rp-dm[dir="rtl"] .rp-dm__legal { text-align: center; }
@media (max-width: 767px) {
  #rp-dm[dir="rtl"] .rp-dm__close { left: 12px; right: auto; }
}
