/* ==========================================================================
   Book a Demo — modern glass popup (replaces the old side drawer)
   Uses the theme tokens from theme.css (light / night); fallbacks keep it
   working on its own. Surfaces use 78% opacity glass (--pg-glass-alpha).
   ========================================================================== */

/* The old side drawer is retired; the popup below replaces it */
#demoDrawer { display: none !important; }

.pgm-lock { overflow: hidden !important; }

.pgm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 14, 48, .46);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility 0s linear .28s;
  overflow-y: auto;
}
.pgm-overlay.pgm-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .28s ease;
}

.pgm-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px, 36%) 1fr;
  width: min(940px, 100%);
  margin: auto;
  border-radius: 24px;
  overflow: hidden;
  color: var(--pg-text, #14213d);
  background: var(--pg-glass, rgba(255, 255, 255, .78));
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--pg-glass-border, rgba(255, 255, 255, .55));
  box-shadow: 0 30px 80px rgba(3, 12, 45, .38), inset 0 1px 0 rgba(255, 255, 255, .35);
  transform: translateY(22px) scale(.97);
  transition: transform .34s cubic-bezier(.22, .61, .36, 1);
  font-family: 'Poppins', sans-serif;
}
.pgm-open .pgm-card { transform: none; }

/* ---------- left brand panel ---------- */
.pgm-aside {
  position: relative;
  padding: 38px 30px;
  color: #fff;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(77, 133, 255, .55) 0%, transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(0, 210, 255, .25) 0%, transparent 60%),
    linear-gradient(160deg, #04125e 0%, #0623b1 70%, #0a2cd9 100%);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.pgm-aside::after {            /* soft glass sheen */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, .12), transparent 45%);
  pointer-events: none;
}
.pgm-logo { height: 38px; width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; }
.pgm-aside h3 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 24.8px;
  line-height: 1.3;
  font-weight: 700;
  color: #fff;
  text-transform: none;
}
.pgm-aside p { margin: 0; font-size: 15.2px; line-height: 1.65; color: rgba(255, 255, 255, .86); }
.pgm-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 13px; }
.pgm-points li { display: flex; gap: 11px; align-items: flex-start; font-size: 14.7px; line-height: 1.5; color: rgba(255, 255, 255, .92); }
.pgm-points li::before {
  content: "✓";
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: 12px; font-weight: 700;
}
.pgm-contact { margin-top: auto; font-size: 13.6px; line-height: 1.7; color: rgba(255, 255, 255, .8); }
.pgm-contact a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- main panel ---------- */
.pgm-main { position: relative; padding: 38px 40px 34px; min-width: 0; }
.pgm-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(127, 140, 180, .16);
  color: var(--pg-text, #14213d);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .25s;
  z-index: 2;
}
.pgm-close:hover { background: rgba(127, 140, 180, .3); transform: rotate(90deg); }

.pgm-title {
  margin: 0 0 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 27.2px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--pg-heading, #0623b1);
  text-transform: none;
}
.pgm-sub { margin: 0 0 22px; font-size: 15.2px; color: var(--pg-muted, #56627f); line-height: 1.6; }

.pgm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 16px; }
.pgm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pgm-field.pgm-wide { grid-column: 1 / -1; }
.pgm-field label { font-size: 12.8px; font-weight: 600; letter-spacing: .01em; color: var(--pg-text, #14213d); }
.pgm-field label i { color: #e5484d; font-style: normal; margin-left: 2px; }

.pgm-field input,
.pgm-field select,
.pgm-field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15.2px;
  color: var(--pg-text, #14213d);
  background: var(--pg-input, rgba(255, 255, 255, .7));
  border: 1.5px solid var(--pg-input-border, rgba(6, 35, 177, .18));
  border-radius: 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
  height: auto;
  box-shadow: none;
}
.pgm-field textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.pgm-field select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237080a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.pgm-field input::placeholder,
.pgm-field textarea::placeholder { color: var(--pg-muted, #56627f); opacity: .7; }
.pgm-field input:focus,
.pgm-field select:focus,
.pgm-field textarea:focus {
  border-color: var(--pg-accent, #0623b1);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, .18);
  background: var(--pg-input-focus, #fff);
}
.pgm-field.pgm-invalid input,
.pgm-field.pgm-invalid select,
.pgm-field.pgm-invalid textarea { border-color: #e5484d; box-shadow: 0 0 0 4px rgba(229, 72, 77, .13); }
.pgm-err { min-height: 0; font-size: 12.2px; color: #e5484d; display: none; }
.pgm-invalid .pgm-err { display: block; }
.pgm-field select option { color: #14213d; background: #fff; }
.pgm-other { display: none; }
.pgm-other.pgm-show { display: flex; }
.pgm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.pgm-alert {
  display: none;
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14.1px;
  line-height: 1.5;
  color: #b4232a;
  background: rgba(229, 72, 77, .12);
  border: 1px solid rgba(229, 72, 77, .35);
}
.pgm-alert.pgm-show { display: block; }

.pgm-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.pgm-submit {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 190px;
  padding: 14px 28px;
  border: 0; border-radius: 14px;
  font: inherit; font-size: 15.7px; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, #0623b1 0%, #2f6bff 100%);
  box-shadow: 0 12px 26px rgba(6, 35, 177, .32);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.pgm-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(6, 35, 177, .4); filter: brightness(1.05); }
.pgm-submit:active { transform: translateY(0); }
.pgm-submit[disabled] { cursor: progress; filter: saturate(.7) brightness(.95); transform: none; }
.pgm-spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: pgmSpin .75s linear infinite; }
.pgm-submit[disabled] .pgm-spin { display: inline-block; }
@keyframes pgmSpin { to { transform: rotate(360deg); } }
.pgm-fine { margin: 0; font-size: 12.5px; color: var(--pg-muted, #56627f); line-height: 1.5; flex: 1; min-width: 180px; }

/* ---------- success state ---------- */
.pgm-success { display: none; text-align: center; padding: 28px 8px 8px; position: relative; }
.pgm-done .pgm-form { display: none; }
.pgm-done .pgm-success { display: block; }
.pgm-emoji {
  position: relative;
  width: 116px; height: 116px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  font-size: 62px; line-height: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .9), rgba(47, 107, 255, .16));
  border: 1px solid rgba(47, 107, 255, .28);
  box-shadow: 0 16px 40px rgba(6, 35, 177, .22);
  animation: pgmPop .7s cubic-bezier(.2, 1.4, .4, 1) both;
}
.pgm-done .pgm-emoji span { display: inline-block; animation: pgmWiggle 1.1s .5s ease-in-out both; }
@keyframes pgmPop { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pgmWiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-14deg) scale(1.1); } 60% { transform: rotate(10deg) scale(1.1); } }
.pgm-success h3 { margin: 0 0 8px; font-family: 'Orbitron', sans-serif; font-size: 30.4px; color: var(--pg-heading, #0623b1); text-transform: none; }
.pgm-success p { margin: 0 auto 8px; max-width: 460px; font-size: 15.7px; line-height: 1.65; color: var(--pg-text, #14213d); }
.pgm-success p.pgm-mail { color: var(--pg-muted, #56627f); font-size: 14.4px; }
.pgm-success p.pgm-mail b { color: var(--pg-text, #14213d); word-break: break-all; }
.pgm-done-btn { margin-top: 20px; }
.pgm-confetti { position: absolute; left: 50%; top: 96px; width: 0; height: 0; pointer-events: none; }
.pgm-confetti i {
  position: absolute; left: 0; top: 0;
  font-style: normal; font-size: 18px; line-height: 1;
  opacity: 0;
  animation: pgmBurst 1.4s ease-out forwards;
}
@keyframes pgmBurst {
  0% { opacity: 1; transform: translate(0, 0) scale(.4) rotate(0); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1) rotate(var(--r)); }
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .pgm-card { grid-template-columns: 1fr; border-radius: 22px; }
  .pgm-aside { padding: 24px 24px 20px; gap: 12px; }
  .pgm-aside .pgm-points, .pgm-aside .pgm-contact { display: none; }
  .pgm-aside p { display: none; }
  .pgm-aside h3 { font-size: 19.2px; }
  .pgm-main { padding: 26px 22px 24px; }
}
@media (max-width: 540px) {
  .pgm-overlay { padding: 10px; align-items: start; }
  .pgm-grid { grid-template-columns: 1fr; }
  .pgm-title { font-size: 21.6px; padding-right: 30px; }
  .pgm-submit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pgm-overlay, .pgm-card { transition: none; }
  .pgm-emoji, .pgm-emoji span, .pgm-confetti i { animation: none; }
  .pgm-confetti { display: none; }
}

/* Neutralise the site-wide heading decoration inside the popup */
.pgm-overlay h2, .pgm-overlay h3 { border: 0 !important; padding-bottom: 0; margin-top: 0; }
.pgm-overlay h2::before, .pgm-overlay h2::after,
.pgm-overlay h3::before, .pgm-overlay h3::after { content: none !important; display: none !important; }
.pgm-overlay label { margin: 0; font-weight: 600; max-width: none; }

.pgm-fine a { color: var(--pg-heading, #0623b1); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
