/* ============================================================
   BOOK GOLDSENSE — shared floating launcher + demo popup
   Injected site-wide via book-goldsense.html (data-include) and
   driven by book-goldsense.js. Self-contained: the modal rules are
   lifted verbatim from partner.css's .pform-success / .field shell,
   but ID-scoped to #gsDemo / #gsDemoSuccess so they can never leak
   onto a page that carries its own .pform form (partner.html).
   Token refs keep a literal fallback for the pages that don't load
   styles.css (BPMI, blog, board-members, management-team, objectives).
   ============================================================ */

/* ---------- sticky launcher ----------
   Pinned bottom-right on every page. z-index 190 keeps it under the
   modal overlay (.pform-success is 200) but above the navbars (50-60),
   matching the choice rammudra.css / elanzia.css already made. */
.bg-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 190;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border: none; border-radius: 999px; cursor: pointer;
  font: 600 15px/1 var(--sans, system-ui, -apple-system, "Segoe UI", Arial, sans-serif);
  color: #1a1408; white-space: nowrap;
  background: var(--gold-grad, linear-gradient(100deg, #b9903f 0%, #e8cf8f 45%, #b9903f 100%));
  box-shadow: 0 10px 28px rgba(20, 16, 8, .28), 0 0 0 6px rgba(185, 144, 63, .16);
  transition: transform .35s var(--spring, cubic-bezier(.2,.9,.3,1.3)), box-shadow .35s ease;
  animation: bg-fab-pulse 2.6s ease-in-out infinite;
}
.bg-fab:hover { transform: translateY(-3px) scale(1.04); }
.bg-fab__icon { font-size: 18px; }

/* the champagne halo breathes outward; paused for reduced-motion users below */
@keyframes bg-fab-pulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(20,16,8,.28), 0 0 0 6px rgba(185,144,63,.16); }
  50%      { box-shadow: 0 10px 28px rgba(20,16,8,.28), 0 0 0 12px rgba(185,144,63,0); }
}

/* ---------- modal shell (scoped copy of partner.css .pform-success) ---------- */
#gsDemo,
#gsDemoSuccess {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(13,15,26,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
#gsDemo.is-open,
#gsDemoSuccess.is-open { opacity: 1; visibility: visible; }

#gsDemo .pform-success-card,
#gsDemoSuccess .pform-success-card {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  display: flex; flex-direction: column;
  transform: translateY(14px) scale(.97);
  transition: transform .3s cubic-bezier(.22,1.1,.36,1);
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
}
#gsDemo.is-open .pform-success-card,
#gsDemoSuccess.is-open .pform-success-card { transform: none; }

/* success dialog keeps the centred layout */
#gsDemoSuccess .pform-success-card {
  max-width: 420px;
  padding: 44px 32px 32px;
  align-items: center;
  gap: 14px;
  text-align: center;
}
/* the demo form widens the card and switches to a left-aligned column
   (partner.css's .gs-demo-card override, inlined here) */
#gsDemo .pform-success-card {
  max-width: 560px;
  padding: 44px 32px 32px;
  align-items: stretch;
  gap: 28px;
  text-align: left;
  max-height: 90vh;
  overflow-y: auto;
}
#gsDemo .gs-demo-form { display: flex; flex-direction: column; gap: 28px; }

#gsDemo .pform-success-close,
#gsDemoSuccess .pform-success-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  border: 0; background: transparent;
  color: #8a8a97; font-size: 20px; line-height: 1; cursor: pointer;
}
#gsDemo .pform-success-close:hover,
#gsDemoSuccess .pform-success-close:hover { color: #0d0f1a; }

#gsDemoSuccess .pform-success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #eab338, #b9903f);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 4px;
}
#gsDemoSuccess .pform-success-title { font-size: 28px; color: #0D0F1A; margin: 0; }
#gsDemoSuccess .pform-success-title em { font-family: var(--serif, "Instrument Serif", Georgia, serif); font-style: italic; font-weight: 400; }
#gsDemoSuccess .pform-success-sub { font-size: 15px; line-height: 22px; color: #606070; margin: 0; }

/* ---------- form head ---------- */
#gsDemo .pform-head { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
#gsDemo .pform-title { font-size: 24px; font-weight: 400; color: #0D0F1A; margin: 0; }
#gsDemo .pform-title em { font-family: var(--serif, "Instrument Serif", Georgia, serif); font-style: italic; font-size: 28px; line-height: 39px; }
#gsDemo .pform-title .gold { color: #CFB38D; }

/* ---------- groups + legends ---------- */
#gsDemo .pform-group { display: flex; flex-direction: column; gap: 16px; }
#gsDemo .pform-group.grow { flex: 1 1 auto; }
#gsDemo .pform-legend { font-size: 12px; text-transform: uppercase; color: #606070; line-height: 18px; display: flex; align-items: center; gap: 8px; }
#gsDemo .pform-legend i { color: var(--gold-500, #b9903f); font-size: 13px; }

/* ---------- fields ---------- */
#gsDemo .field { display: flex; flex-direction: column; gap: 4px; }
#gsDemo .field.grow { flex: 1 1 auto; }
#gsDemo .field > span { font-size: 12px; text-transform: uppercase; color: #0D0F1A; line-height: 18px; }
#gsDemo .field > span b { color: #E7000B; font-weight: 400; }
#gsDemo .field input,
#gsDemo .field select,
#gsDemo .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 2px;
  border: 1px solid #C8C8D2; background: rgba(255,255,255,.4);
  font-family: var(--sans, system-ui, -apple-system, "Segoe UI", Arial, sans-serif);
  font-size: 12px; font-weight: 500; color: #0D0F1A; line-height: 18px;
}
#gsDemo .field textarea { resize: vertical; min-height: 96px; font-weight: 400; }
#gsDemo .field input::placeholder,
#gsDemo .field textarea::placeholder { color: #AEAEBA; font-weight: 400; }
#gsDemo .field input:focus,
#gsDemo .field select:focus,
#gsDemo .field textarea:focus { outline: none; border-color: #8b7a4f; }
#gsDemo .field-phone { display: flex; align-items: center; border: 1px solid #C8C8D2; border-radius: 2px; padding-left: 14px; gap: 10px; background: rgba(255,255,255,.4); }
#gsDemo .field-phone .cc { font-size: 12px; font-weight: 500; color: #0D0F1A; white-space: nowrap; }
#gsDemo .field-phone input { border: none; padding-left: 0; background: transparent; }

/* ---------- consent + footer ---------- */
#gsDemo .check { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: #606070; line-height: 20px; cursor: pointer; }
#gsDemo .check input { width: 18px; height: 18px; margin-top: 1px; accent-color: #0D0F1A; flex: none; }
#gsDemo .check.consent { font-size: 12px; line-height: 16px; }
#gsDemo .pform-foot { display: flex; flex-direction: column; align-items: center; gap: 20px; }

/* ---------- submit / done buttons ----------
   Styled from scratch here rather than leaning on a global .btn — BPMI.html
   has no .btn rule, so the popup has to stand on its own everywhere. */
#gsDemo .pform-submit,
#gsDemoSuccess .pform-success-ok {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 512px;
  height: 48px; padding: 0 24px;
  border: none; border-radius: 4px; cursor: pointer;
  background: #000; color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase;
  transition: opacity .2s, transform .2s;
}
#gsDemoSuccess .pform-success-ok { margin-top: 10px; }
#gsDemo .pform-submit:hover,
#gsDemoSuccess .pform-success-ok:hover { opacity: .85; transform: translateY(-1px); }
#gsDemo .pform-submit[disabled] { opacity: .6; cursor: default; transform: none; }

/* ---------- reCAPTCHA legal line ---------- */
#gsDemo .recaptcha-legal { margin: 0; font-size: 11px; line-height: 1.5; color: #8a8a8a; text-align: center; }
#gsDemo .recaptcha-legal a { color: inherit; text-decoration: underline; }

/* tuck the launcher into the corner as an icon-only bubble on phones */
@media (max-width: 640px) {
  .bg-fab { right: 16px; bottom: 16px; padding: 15px; }
  .bg-fab__label { display: none; }
  .bg-fab__icon { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-fab { animation: none; }
}
