.mr-lead-popup {
  --mrlp-bg: #ffffff;
  --mrlp-text: #111111;
  --mrlp-muted: rgba(17, 17, 17, .68);
  --mrlp-line: rgba(17, 17, 17, .14);
  --mrlp-line-focus: rgba(17, 17, 17, .62);
  --mrlp-focus: rgba(17, 17, 17, .08);
  --mrlp-primary: #111111;
  --mrlp-primary-hover: #2a2a2a;

  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: inherit;
}

.mr-lead-popup.is-active {
  display: flex;
}

.mr-lead-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(3px);
}

.mr-lead-popup__dialog {
  position: relative;
  width: min(100%, 560px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  background: var(--mrlp-bg);
  border: 1px solid rgba(17, 17, 17, .08);
  border-radius: 24px;
  box-shadow: 0 24px 76px rgba(0, 0, 0, .24);
  outline: none;
  animation: mrlpFadeUp .2s ease both;
}

.mr-lead-popup__content {
  position: relative;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 17, 17, .28) transparent;
  padding: 30px;
  color: var(--mrlp-text);
  background: var(--mrlp-bg);
  box-sizing: border-box;
}

.mr-lead-popup__content::-webkit-scrollbar {
  width: 7px;
}

.mr-lead-popup__content::-webkit-scrollbar-track {
  background: transparent;
}

.mr-lead-popup__content::-webkit-scrollbar-thumb {
  background: rgba(17, 17, 17, .28);
  border-radius: 999px;
  border: 2px solid #ffffff;
  background-clip: padding-box;
}

.mr-lead-popup__content::-webkit-scrollbar-thumb:hover {
  background: rgba(17, 17, 17, .42);
  border: 2px solid #ffffff;
  background-clip: padding-box;
}

.mr-lead-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: block;
  border: 1px solid rgba(17, 17, 17, .12);
  border-radius: 50%;
  background: #ffffff;
  color: var(--mrlp-text);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  box-shadow: none;
  padding: 0;
  transform: none;
  transition: background .2s ease, border-color .2s ease;
}

.mr-lead-popup__close::before,
.mr-lead-popup__close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.mr-lead-popup__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.mr-lead-popup__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.mr-lead-popup__close:hover {
  background: #f7f7f7;
  border-color: rgba(17, 17, 17, .22);
  transform: none;
}

.mr-lead-popup__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .10);
}

.mr-lead-popup__head {
  margin: 0 48px 20px 0;
}

.mr-lead-popup__title {
  margin: 0 0 10px;
  font-family: 'Rubik';
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--mrlp-text);
}

.mr-lead-popup__text {
  margin: 0;
  max-width: 460px;
  font-size: 17px;
  line-height: 1.48;
  font-weight: 400;
  color: var(--mrlp-muted);
}

.mr-lead-popup .wpcf7,
.mr-lead-popup .wpcf7 form,
.mr-lead-popup .wpcf7 p {
  margin: 0;
}

.mr-lead-form {
  margin: 0;
}

.mr-lead-form__row {
  margin: 0 0 12px;
}

.mr-lead-form__input,
.mr-lead-form__textarea,
.mr-lead-form input[type='text'],
.mr-lead-form input[type='tel'],
.mr-lead-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--mrlp-line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--mrlp-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  padding: 14px 16px;
  outline: none;
  box-shadow: none;
  appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.mr-lead-form__input,
.mr-lead-form input[type='text'],
.mr-lead-form input[type='tel'] {
  min-height: 56px;
}

.mr-lead-form__input::placeholder,
.mr-lead-form__textarea::placeholder,
.mr-lead-form input[type='text']::placeholder,
.mr-lead-form input[type='tel']::placeholder,
.mr-lead-form textarea::placeholder {
  color: rgba(17, 17, 17, .42);
  opacity: 1;
}

.mr-lead-form__textarea,
.mr-lead-form textarea {
  min-height: 102px;
  max-height: 150px;
  resize: vertical;
}

.mr-lead-form__input:focus,
.mr-lead-form__textarea:focus,
.mr-lead-form input[type='text']:focus,
.mr-lead-form input[type='tel']:focus,
.mr-lead-form textarea:focus {
  border-color: var(--mrlp-line-focus);
  box-shadow: 0 0 0 4px var(--mrlp-focus);
  background: #ffffff;
}

.mr-lead-form__submit {
  margin: 14px 0 0;
}

.mr-lead-form input[type='submit'].mr-lead-form__button,
.mr-lead-form .mr-lead-form__button {
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 0px 24px;
  background: var(--mr-grad);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
  appearance: none;
  transition: background .2s ease, color .2s ease, transform .2s ease, opacity .2s ease;
}

.mr-lead-form input[type='submit'].mr-lead-form__button:hover,
.mr-lead-form .mr-lead-form__button:hover {
  box-shadow:0 18px 34px rgba(62,130,211,.34);
  transform:translateY(-2px);
  opacity: 1;
}

.mr-lead-form input[type='submit'].mr-lead-form__button:focus,
.mr-lead-form .mr-lead-form__button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .10);
}

.mr-lead-popup__privacy {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(17, 17, 17, .56);
}

.mr-lead-popup .mr-lead-form__submit {
  position: relative;
}

.mr-lead-popup .wpcf7-spinner {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mr-lead-popup .wpcf7-form.submitting .wpcf7-spinner {
  opacity: 1;
  visibility: visible;
}

.mr-lead-popup .wpcf7-form.submitting .mr-lead-form__button {
  opacity: .86;
  pointer-events: none;
}

.mr-lead-popup .wpcf7-not-valid-tip {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.35;
}

.mr-lead-popup .wpcf7 form.init .wpcf7-response-output {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mr-lead-popup .wpcf7 form.invalid .wpcf7-response-output,
.mr-lead-popup .wpcf7 form.unaccepted .wpcf7-response-output,
.mr-lead-popup .wpcf7 form.payment-required .wpcf7-response-output,
.mr-lead-popup .wpcf7 form.sent .wpcf7-response-output,
.mr-lead-popup .wpcf7-response-output {
  margin: 12px 0 0 !important;
  padding: 10px 12px !important;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}

body.mr-lead-popup-open {
  overflow: hidden;
}

@keyframes mrlpFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 575px) {
  .mr-lead-popup {
    padding: 10px;
  }

  .mr-lead-popup__dialog {
    width: min(100%, 520px);
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }

  .mr-lead-popup__content {
    max-height: calc(100dvh - 20px);
    padding: 22px;
  }

  .mr-lead-popup__close {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
  }

  .mr-lead-popup__head {
    margin-right: 42px;
    margin-bottom: 16px;
  }

  .mr-lead-popup__title {
    font-size: 25px;
  }

  .mr-lead-popup__text {
    font-size: 14.5px;
    line-height: 1.45;
  }

  .mr-lead-form__row {
    margin-bottom: 10px;
  }

  .mr-lead-form__input,
  .mr-lead-form__textarea,
  .mr-lead-form input[type='text'],
  .mr-lead-form input[type='tel'],
  .mr-lead-form textarea {
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .mr-lead-form__input,
  .mr-lead-form input[type='text'],
  .mr-lead-form input[type='tel'] {
    min-height: 52px;
  }

  .mr-lead-form__textarea,
  .mr-lead-form textarea {
    min-height: 86px;
  }
}

/* Success state after Contact Form 7 submission */
.mr-lead-popup__success {
  display: none;
  text-align: center;
  padding: 22px 0 4px;
  color: var(--mrlp-text);
}

.mr-lead-popup.is-success .mr-lead-popup__main {
  display: none;
}

.mr-lead-popup.is-success .mr-lead-popup__success {
  display: block;
}

.mr-lead-popup__success-icon {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--mr-grad, #111111);
  box-shadow: 0 18px 34px rgba(62,130,211,.22);
}

.mr-lead-popup__success-icon::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 18px;
  width: 26px;
  height: 15px;
  border-left: 4px solid #ffffff;
  border-bottom: 4px solid #ffffff;
  transform: rotate(-45deg);
  border-radius: 1px;
}

.mr-lead-popup__success-title {
  margin: 0 0 10px;
  font-family: 'Rubik';
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.025em;
}

.mr-lead-popup__success-text {
  max-width: 430px;
  margin: 0 auto 22px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--mrlp-muted);
}

.mr-lead-popup__success-button {
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 0 24px;
  background: var(--mr-grad, #111111);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
  appearance: none;
  transition: background .2s ease, color .2s ease, transform .2s ease, opacity .2s ease;
}

.mr-lead-popup__success-button:hover {
  box-shadow: 0 18px 34px rgba(62,130,211,.34);
  transform: translateY(-2px);
  opacity: 1;
}

.mr-lead-popup__success-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(17, 17, 17, .10);
}
