:root {
  --lead-orange: var(--gw-orange, #f26422);
  --lead-orange-dark: var(--gw-orange-dark, #d84d0d);
  --lead-ink: var(--gw-text, #171717);
  --lead-muted: var(--gw-muted, #5c5c5c);
}

body.lead-modal-open {
  overflow: hidden;
}

.lead-modal[hidden] {
  display: none !important;
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: "Montserrat", Arial, sans-serif;
}

.lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.72);
  backdrop-filter: blur(9px);
  animation: lead-modal-fade 220ms ease both;
}

.lead-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(370px, 1.14fr);
  width: min(800px, 100%);
  max-height: min(540px, calc(100dvh - 40px));
  overflow: hidden;
  color: var(--lead-ink);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
  animation: lead-modal-enter 260ms cubic-bezier(.2, .8, .2, 1) both;
}

.lead-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: #4b4b4b;
  background: #f2f2f2;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.lead-modal__close:hover {
  color: #fff;
  background: var(--lead-orange);
}

.lead-modal__close:focus-visible,
.lead-modal__submit:focus-visible,
.lead-modal__contact:focus-visible,
.lead-modal__field input:focus-visible,
.lead-modal__field textarea:focus-visible {
  outline: 3px solid rgba(242, 100, 34, 0.35);
  outline-offset: 3px;
}

.lead-modal__trust {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px 26px 24px;
  overflow: hidden;
  color: #fff;
  background: var(--lead-orange);
}

.lead-modal__response {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  min-height: 34px;
  padding: 0 13px;
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
}

.lead-modal__trust-title {
  position: relative;
  z-index: 1;
  max-width: 320px;
  margin: 0 0 20px;
  font-size: clamp(24px, 2.5vw, 29px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.lead-modal__benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
}

.lead-modal__benefits li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.lead-modal__check {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: -1px;
  color: var(--lead-orange-dark);
  background: #fff;
  border-radius: 50%;
}

.lead-modal__content {
  min-width: 0;
  padding: 32px 36px 26px;
  overflow-y: auto;
}

.lead-modal__eyebrow {
  margin: 0 52px 7px 0;
  color: var(--lead-orange);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.lead-modal__title {
  max-width: 570px;
  margin: 0 52px 8px 0;
  font-size: clamp(28px, 3vw, 35px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.lead-modal__intro {
  max-width: 560px;
  margin: 0 0 15px;
  color: var(--lead-muted);
  font-size: 13px;
  line-height: 1.55;
}

.lead-modal__form {
  display: grid;
  gap: 8px;
}

.lead-modal__field {
  display: grid;
  gap: 5px;
}

.lead-modal__field label {
  color: #3f3f3f;
  font-size: 12px;
  font-weight: 750;
}

.lead-modal__field input,
.lead-modal__field textarea {
  width: 100%;
  min-height: 48px;
  padding: 13px 15px;
  color: var(--lead-ink);
  font: inherit;
  font-size: 16px;
  background: #f4f4f4;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.lead-modal__field textarea {
  min-height: 76px;
  resize: vertical;
}

.lead-modal__field input::placeholder,
.lead-modal__field textarea::placeholder {
  color: #858585;
}

.lead-modal__field input:focus,
.lead-modal__field textarea:focus {
  background: #fff;
  border-color: var(--lead-orange);
  box-shadow: 0 0 0 4px rgba(242, 100, 34, 0.1);
  outline: none;
}

.lead-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  margin-top: 3px;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  background: var(--lead-orange);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(242, 100, 34, 0.22);
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.lead-modal__submit:hover {
  background: var(--lead-orange-dark);
  box-shadow: 0 14px 30px rgba(216, 77, 13, 0.28);
}

.lead-modal__submit:disabled {
  opacity: 0.68;
  cursor: wait;
}

.lead-modal__consent {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #777;
  font-size: 11px;
  line-height: 1.45;
  cursor: pointer;
}

.lead-modal__consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--lead-orange);
  cursor: pointer;
}

.lead-modal__consent a {
  color: var(--lead-orange-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead-modal__status {
  min-height: 14px;
  margin: 0;
  color: #23713d;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
}

.lead-modal__status:empty {
  display: none;
}

.lead-modal__status.is-error {
  color: #b42318;
}

.lead-modal__dialog.is-success .lead-modal__content > :not(.lead-modal__success) {
  display: none;
}

.lead-modal__dialog.is-success .lead-modal__content {
  display: grid;
  align-content: center;
}

.lead-modal__success {
  display: grid;
  justify-items: start;
  width: 100%;
  outline: none;
  animation: lead-success-enter 420ms cubic-bezier(.2, .8, .2, 1) both;
}

.lead-modal__success-kicker {
  margin: 0 0 8px;
  color: var(--lead-orange);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.lead-modal__success h3 {
  max-width: 390px;
  margin: 0 0 12px;
  color: var(--lead-ink);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.03;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.lead-modal__success > p:not(.lead-modal__success-kicker) {
  max-width: 440px;
  margin: 0 0 22px;
  color: var(--lead-muted);
  font-size: 13px;
  line-height: 1.6;
}

.lead-modal__success-close {
  width: 100%;
  min-height: 50px;
  padding: 0 24px;
  color: #fff;
  background: var(--lead-orange);
  border: 0;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.lead-modal__success-close:hover {
  background: var(--lead-orange-dark);
}

.lead-modal__success-close:active {
  transform: translateY(1px);
}

.lead-modal__success-close:focus-visible {
  outline: 3px solid rgba(242, 100, 34, .35);
  outline-offset: 3px;
}

@keyframes lead-success-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.lead-modal__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 8px;
  color: #999;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.lead-modal__divider::before,
.lead-modal__divider::after {
  content: "";
  width: 100%;
  height: 1px;
  background: #e8e8e8;
}

.lead-modal__contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lead-modal__contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 13px;
  cursor: pointer;
  transition: filter 180ms ease, box-shadow 180ms ease;
}

.lead-modal__contact:hover {
  filter: brightness(0.94);
  box-shadow: 0 8px 20px rgba(23, 23, 23, 0.12);
}

.lead-modal__contact img {
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Telegram and MAX source PNGs contain about 18px of transparent padding on
   every side. Compensate for it so their visible glyphs match the SVG icon. */
.lead-modal__contact--telegram img,
.lead-modal__contact--max img {
  transform: scale(1.5);
}

.lead-modal__contact--telegram {
  background: #202020;
}

.lead-modal__contact--max {
  background: #202020;
}

.lead-modal__contact--whatsapp {
  color: #fff;
  background: #202020;
  box-shadow: none;
}

.lead-modal__contact--whatsapp img {
  width: 21px;
  height: 21px;
  filter: brightness(0) invert(1);
}

@keyframes lead-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lead-modal-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .lead-modal {
    align-items: end;
    padding: 16px;
  }

  .lead-modal__dialog {
    display: block;
    width: 100%;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    border-radius: 22px;
  }

  .lead-modal__trust {
    padding: 24px 24px 22px;
  }

  .lead-modal__response {
    margin-bottom: 14px;
  }

  .lead-modal__trust-title {
    max-width: calc(100% - 58px);
    margin-bottom: 0;
    font-size: 26px;
  }

  .lead-modal__benefits {
    display: none;
  }

  .lead-modal__content {
    padding: 26px 24px 24px;
    overflow: visible;
  }
}

@media (max-width: 520px) {
  .lead-modal {
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  .lead-modal__dialog {
    max-height: calc(100dvh - 10px - max(10px, env(safe-area-inset-bottom)));
    border-radius: 20px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .lead-modal__close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.92);
  }

  .lead-modal__trust {
    padding: 16px 18px 15px;
  }

  .lead-modal__response {
    min-height: 32px;
    padding: 0 12px;
    margin-bottom: 10px;
    font-size: 11px;
  }

  .lead-modal__trust-title {
    max-width: calc(100% - 50px);
    margin-bottom: 0;
    font-size: 21px;
  }

  .lead-modal__content {
    padding: 18px;
  }

  .lead-modal__eyebrow {
    margin-right: 50px;
    font-size: 9px;
  }

  .lead-modal__title {
    margin-right: 50px;
    font-size: 27px;
  }

  .lead-modal__intro {
    margin-bottom: 12px;
    font-size: 12px;
  }

  .lead-modal__field input {
    min-height: 46px;
    font-size: 16px;
  }

  .lead-modal__contact {
    min-height: 44px;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* Keep the direct-contact actions fully inside the rounded panel when a
   mobile browser leaves little vertical space (for example, with its toolbar
   expanded). The trust panel is supporting content, so it yields first. */
@media (max-width: 900px) and (max-height: 680px) {
  .lead-modal__trust {
    display: none;
  }

  .lead-modal__content {
    padding-top: 18px;
  }
}

@media (max-width: 520px) and (max-height: 560px) {
  .lead-modal__content {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .lead-modal__title {
    font-size: 24px;
  }

  .lead-modal__intro {
    margin-bottom: 8px;
  }

  .lead-modal__form {
    gap: 6px;
  }

  .lead-modal__divider {
    margin: 6px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-modal__backdrop,
  .lead-modal__dialog {
    animation: none;
  }

  .lead-modal__close,
  .lead-modal__submit,
  .lead-modal__contact,
  .lead-modal__field input,
  .lead-modal__field textarea {
    transition: none;
  }
}
