/* BEM Premium · one self-contained visual layer for the existing BEM Forms modal. */
.bem-lead-modal[hidden] { display: none !important; }
html.bem-lead-modal-open,
body.bem-lead-modal-open { overflow: hidden !important; }

.bem-lead-modal {
  --bem-modal-ink: #182410;
  --bem-modal-green: #516139;
  --bem-modal-olive: #87854c;
  --bem-modal-paper: #f9faf5;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 16px;
  isolation: isolate;
  font-family: Manrope, sans-serif;
  color: var(--bem-modal-ink);
}
.bem-lead-modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  border-radius: 0;
  background: rgba(15, 26, 13, .57);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.bem-lead-modal__panel {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(100%, 530px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdc8b4 transparent;
  padding: 36px 34px 27px;
  border: 1px solid rgba(184, 196, 173, .7);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(135, 133, 76, .085), transparent 56%),
    radial-gradient(ellipse at -12% 100%, rgba(145, 170, 153, .07), transparent 58%),
    var(--bem-modal-paper);
  box-shadow: 0 24px 70px rgba(21, 39, 17, .16), 0 7px 24px rgba(21, 39, 17, .06);
  color: var(--bem-modal-ink);
  outline: none;
  animation: bem-modal-enter .3s cubic-bezier(.2, .7, .2, 1) both;
}
.bem-lead-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #d4ddcd;
  border-radius: 50%;
  background: rgba(255, 255, 255, .78);
  box-shadow: none;
  color: var(--bem-modal-ink);
  font: 300 25px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.bem-lead-modal__close:hover { background: #fff; border-color: #aebca4; transform: rotate(90deg); }
.bem-lead-modal .bem-lead-modal__panel .bem-lead-modal__title {
  max-width: none;
  margin: 5px 27px 11px;
  color: #182410;
  font-family: Manrope, sans-serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -.025em;
  text-wrap: balance;
  text-align: center;
}
.bem-lead-modal__description {
  max-width: none;
  margin: 0 0 23px;
  color: #596a4e;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  text-align: center;
}

/* BEM Forms: only the form INSIDE this modal is restyled. */
.bem-lead-modal .bem-lead-form {
  display: grid;
  gap: 0;
  margin: 0;
}
.bem-lead-modal .bem-lead-form > label:not(.bem-lead-form__consent) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.bem-lead-modal .bem-lead-form > input:not([type="hidden"]) {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 49px;
  margin: 0 0 13px;
  padding: 12px 15px;
  appearance: none;
  border: 1px solid #cbd5c2;
  border-radius: 13px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 1px 3px rgba(24, 36, 16, .025);
  color: var(--bem-modal-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.bem-lead-modal .bem-lead-form > input:not([type="hidden"])::placeholder { color: #899383; opacity: 1; }
.bem-lead-modal .bem-lead-form > input:not([type="hidden"]):hover { border-color: #a9b99c; background: #fff; }
/* One olive focus ring (including keyboard focus); overrides external purple theme rings. */
.bem-lead-modal .bem-lead-form > input:not([type="hidden"]):focus,
.bem-lead-modal .bem-lead-form > input:not([type="hidden"]):focus-visible {
  border-color: var(--bem-modal-olive);
  border-style: solid;
  outline: 2px solid rgba(135, 133, 76, .55);
  outline-offset: 0;
  box-shadow: none !important;
  background: #fff;
}
.bem-lead-modal .bem-lead-form > input:not([type="hidden"]):is(:invalid:not(:placeholder-shown), [aria-invalid="true"]) {
  border-color: #a66853;
}
.bem-lead-modal .bem-lead-form > input:not([type="hidden"]):is(:invalid:not(:placeholder-shown), [aria-invalid="true"]):focus {
  outline-color: rgba(166, 104, 83, .38);
}
.bem-lead-modal .bem-lead-form__consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin: 1px 0 0;
  color: #5a6952;
  font-size: 11px;
  line-height: 1.55;
  cursor: pointer;
}
.bem-lead-modal .bem-lead-form__consent input {
  position: static;
  display: block;
  visibility: visible;
  opacity: 1;
  appearance: auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--bem-modal-green);
}
.bem-lead-modal .bem-lead-form__consent a { color: #3a5030; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.bem-lead-modal .bem-lead-form__submit {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 49px;
  margin: 16px 0 0;
  padding: 12px 17px 12px 20px;
  border: 1px solid var(--bem-modal-ink);
  border-radius: 13px;
  background: var(--bem-modal-ink);
  box-shadow: 0 5px 16px rgba(24, 36, 16, .11);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.bem-lead-modal .bem-lead-form__submit > span[aria-hidden="true"] {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}
.bem-lead-modal .bem-lead-form__submit:hover { background: #354b2a; border-color: #354b2a; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(24, 36, 16, .12); }
.bem-lead-modal .bem-lead-form__submit:disabled { opacity: .65; cursor: progress; transform: none; }
.bem-lead-modal .bem-lead-form__status { margin: 6px 0 0; color: #354b2a; font-size: 12px; line-height: 1.5; }
.bem-lead-modal .bem-lead-form__status:empty { display: none; }
/* Keep a visible focus indicator on all interactive elements. */
.bem-lead-modal :is(button, a, input[type="checkbox"]):focus-visible {
  outline: 2px solid var(--bem-modal-olive);
  outline-offset: 3px;
}

/* Secondary contact actions, with global links rendered by the existing PHP. */
.bem-lead-modal__social { margin-top: 16px; text-align: center; }
.bem-lead-modal__social-caption { margin: 0 0 9px; color: #65715c; font-family: Manrope, sans-serif; font-size: 13px; font-weight: 400; line-height: 1.4; text-align: center; }
.bem-lead-modal__social-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bem-lead-modal__social-link {
  box-sizing: border-box;
  display: inline-flex;
  width: 100%;
  min-width: 0;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 8px;
  border: 1px solid #d3dec9;
  border-radius: 11px;
  background: rgba(255, 255, 255, .75);
  box-shadow: none;
  color: #35482d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.bem-lead-modal__social-link:hover { background: #fff; border-color: #a5b79b; transform: translateY(-1px); }
.bem-lead-modal__social-link svg { flex: 0 0 16px; width: 16px; height: 16px; fill: currentColor; }
.bem-lead-modal__max-icon { display: grid; place-items: center; flex: 0 0 17px; width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 6px; font-size: 11px; font-weight: 800; line-height: 1; }

@keyframes bem-modal-enter { from { opacity: 0; transform: translateY(12px) scale(.988); } to { opacity: 1; transform: none; } }
@keyframes bem-modal-exit { to { opacity: 0; transform: translateY(9px) scale(.99); } }
@keyframes bem-modal-backdrop-exit { to { opacity: 0; } }
.bem-lead-modal.is-closing .bem-lead-modal__panel { animation: bem-modal-exit .2s ease-in both; }
.bem-lead-modal.is-closing .bem-lead-modal__backdrop { animation: bem-modal-backdrop-exit .2s ease-in both; }

@media (max-width: 600px) {
  .bem-lead-modal { padding: 10px; }
  .bem-lead-modal__panel { width: 100%; max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); padding: 30px 22px 22px; border-radius: 22px; }
  .bem-lead-modal__close { top: 12px; right: 12px; width: 36px; height: 36px; }
  .bem-lead-modal .bem-lead-modal__panel .bem-lead-modal__title { margin-left: 15px; margin-right: 15px; font-size: 27px; }
  .bem-lead-modal__description { margin-bottom: 17px; }
  .bem-lead-modal__social { margin-top: 15px; }
  .bem-lead-modal__social-links { gap: 7px; }
  .bem-lead-modal__social-link { padding: 8px 4px; font-size: 11px; gap: 4px; }
}
@media (max-height: 640px) {
  .bem-lead-modal { padding: 7px; }
  .bem-lead-modal__panel { max-height: calc(100vh - 14px); max-height: calc(100dvh - 14px); padding-top: 19px; padding-bottom: 18px; }
  .bem-lead-modal__description { margin-bottom: 13px; }
  .bem-lead-modal .bem-lead-form > input:not([type="hidden"]) { min-height: 45px; margin-bottom: 9px; }
  .bem-lead-modal__social { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .bem-lead-modal__panel, .bem-lead-modal.is-closing .bem-lead-modal__panel, .bem-lead-modal.is-closing .bem-lead-modal__backdrop { animation: none; }
  .bem-lead-modal :is(button, input, a) { transition: none; }
}
