.lead-popup {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 34px 24px;
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 260ms ease,
    visibility 0s linear 900ms;
}

.lead-popup::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 253, 249, 0.42), transparent 34%),
    rgba(21, 25, 34, 0.16);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 360ms ease;
}

.lead-popup.is-visible {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.lead-popup.is-visible::before {
  opacity: 1;
}

.lead-popup__dialog {
  position: relative;
  width: min(424px, calc(100vw - 32px));
  padding-top: 112px;
  opacity: 0;
  transform: translate3d(72vw, -2vh, 0) rotate(2deg) scale(0.94);
  transform-origin: 90% 10%;
}

.lead-popup.is-visible .lead-popup__dialog {
  animation: leadDialogFlyIn 980ms cubic-bezier(.16, .84, .2, 1) both;
}

.lead-popup__plane {
  position: absolute;
  top: -126px;
  right: 112px;
  width: 178px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 18px 28px rgba(84, 55, 27, 0.18));
  transform-origin: 72% 20%;
}

.lead-popup.is-visible .lead-popup__plane {
  animation: leadPlaneFloat 4.8s ease-in-out 1080ms infinite;
}

.lead-popup__plane img {
  width: 100%;
  height: auto;
}

.lead-popup__card {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(217, 203, 188, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(255, 253, 249, 0.98) 0%, rgba(246, 241, 234, 0.98) 100%);
  box-shadow: 0 22px 60px rgba(88, 63, 38, 0.18);
}

.lead-popup__card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.52), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(169, 121, 77, 0.12), transparent 32%);
}

.lead-popup__card::after {
  content: "";
  position: absolute;
  top: -31px;
  right: 170px;
  z-index: 1;
  width: 72px;
  height: 38px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(201, 151, 82, 0), #a9794d 34%, #7a512c 100%) 10px 0 / 2px 34px no-repeat,
    linear-gradient(180deg, rgba(201, 151, 82, 0), #a9794d 34%, #7a512c 100%) 60px 0 / 2px 34px no-repeat,
    radial-gradient(circle at 11px 34px, #f1cf95 0 3px, #8f653e 4px 6px, transparent 7px),
    radial-gradient(circle at 61px 34px, #f1cf95 0 3px, #8f653e 4px 6px, transparent 7px);
}

.lead-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(217, 203, 188, 0.9);
  border-radius: 50%;
  color: #5f6670;
  background: rgba(255, 253, 249, 0.84);
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, border-color 180ms ease;
}

.lead-popup__close:hover {
  color: #151922;
  border-color: rgba(169, 121, 77, 0.55);
  transform: translateY(-1px);
}

.lead-popup__close svg {
  width: 18px;
  height: 18px;
}

.lead-popup__content {
  position: relative;
  z-index: 1;
  padding: 26px;
}

.lead-popup__title {
  max-width: 300px;
  margin: 0;
  color: #151922;
  font-size: 25px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0;
}

.lead-popup__text {
  margin: 10px 0 18px;
  color: #3f434b;
  font-size: 14px;
  line-height: 1.55;
}

.lead-popup__grid {
  display: grid;
  gap: 12px;
}

.lead-popup__field {
  display: grid;
  gap: 7px;
}

.lead-popup__field span {
  color: #5f6670;
  font-size: 12px;
  font-weight: 700;
}

.lead-popup__field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e1d4c6;
  border-radius: 8px;
  padding: 0 14px;
  color: #151922;
  background: rgba(255, 255, 255, 0.78);
  font: 600 15px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.lead-popup__field input::placeholder {
  color: #9a9187;
  font-weight: 500;
}

.lead-popup__field input:focus {
  border-color: rgba(169, 121, 77, 0.88);
  background: #fffdf9;
  box-shadow: 0 0 0 4px rgba(169, 121, 77, 0.12);
}

.lead-popup__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.lead-popup__submit {
  display: inline-flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #b98555, #8f653e);
  box-shadow: 0 14px 28px rgba(143, 101, 62, 0.24);
  font: 800 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.lead-popup__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(143, 101, 62, 0.3);
}

.lead-popup__submit:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.lead-popup__submit svg {
  width: 17px;
  height: 17px;
}

.lead-popup__note {
  margin: 10px 0 0;
  color: #6b6257;
  font-size: 11px;
  line-height: 1.45;
}

.lead-popup__status {
  min-height: 20px;
  margin: 10px 0 0;
  color: #6b6257;
  font-size: 12px;
  line-height: 1.45;
}

.lead-popup__status.is-success {
  color: #2f6d45;
}

.lead-popup__status.is-error {
  color: #9a412f;
}

.lead-popup__status a {
  color: #8f653e;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes leadPlaneFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(-5px, -8px, 0) rotate(-1.5deg);
  }
}

@keyframes leadDialogFlyIn {
  0% {
    opacity: 0;
    transform: translate3d(76vw, -3vh, 0) rotate(2.4deg) scale(0.92);
  }
  58% {
    opacity: 1;
    transform: translate3d(-16px, 4px, 0) rotate(-0.8deg) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@media (max-width: 760px) {
  .lead-popup {
    align-items: center;
    padding: 12px;
  }

  .lead-popup__dialog {
    width: calc(100vw - 24px);
    padding-top: 92px;
    transform: translate3d(96vw, -2vh, 0) rotate(2deg) scale(0.94);
  }

  .lead-popup__plane {
    top: -94px;
    right: 82px;
    width: 132px;
  }

  .lead-popup__card::after {
    top: -25px;
    right: 126px;
    width: 62px;
    height: 32px;
    background:
      linear-gradient(180deg, rgba(201, 151, 82, 0), #a9794d 34%, #7a512c 100%) 9px 0 / 2px 28px no-repeat,
      linear-gradient(180deg, rgba(201, 151, 82, 0), #a9794d 34%, #7a512c 100%) 51px 0 / 2px 28px no-repeat,
      radial-gradient(circle at 10px 28px, #f1cf95 0 3px, #8f653e 4px 6px, transparent 7px),
      radial-gradient(circle at 52px 28px, #f1cf95 0 3px, #8f653e 4px 6px, transparent 7px);
  }

  .lead-popup__content {
    padding: 22px 18px 18px;
  }

  .lead-popup__title {
    max-width: 260px;
    font-size: 22px;
  }

  .lead-popup__text {
    max-width: 31ch;
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  .lead-popup__plane {
    right: 72px;
    width: 126px;
  }

  .lead-popup__card::after {
    right: 116px;
  }

  .lead-popup__title {
    max-width: 238px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-popup,
  .lead-popup *,
  .lead-popup::before,
  .lead-popup::after {
    animation: none !important;
    transition: none !important;
  }
}

/* AYDMAXX 2026 rebrand */
.lead-popup::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 106, 0, 0.18), transparent 34%),
    rgba(2, 3, 3, 0.7);
  backdrop-filter: blur(8px);
}

.lead-popup__plane {
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42)) saturate(1.1);
}

.lead-popup__card {
  border: 1px solid rgba(255, 106, 0, 0.28);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)),
    #101214;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
}

.lead-popup__card::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 106, 0, 0.18), transparent 32%);
}

.lead-popup__card::after {
  background:
    linear-gradient(180deg, rgba(255, 106, 0, 0), #ff6a00 34%, #f04e00 100%) 10px 0 / 2px 34px no-repeat,
    linear-gradient(180deg, rgba(255, 106, 0, 0), #ff6a00 34%, #f04e00 100%) 60px 0 / 2px 34px no-repeat,
    radial-gradient(circle at 11px 34px, #ffb05c 0 3px, #ff6a00 4px 6px, transparent 7px),
    radial-gradient(circle at 61px 34px, #ffb05c 0 3px, #ff6a00 4px 6px, transparent 7px);
}

.lead-popup__close {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.lead-popup__close:hover {
  color: #fff;
  border-color: rgba(255, 106, 0, 0.55);
}

.lead-popup__title {
  color: #fff;
}

.lead-popup__text,
.lead-popup__note {
  color: rgba(255, 255, 255, 0.62);
}

.lead-popup__field span {
  color: rgba(255, 255, 255, 0.72);
}

.lead-popup__field input {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.lead-popup__field input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.lead-popup__field input:focus {
  border-color: rgba(255, 106, 0, 0.88);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.16);
}

.lead-popup__submit {
  background: linear-gradient(135deg, #ff8a1c 0%, #ff6a00 55%, #f04e00 100%);
  box-shadow: 0 16px 34px rgba(255, 106, 0, 0.24);
}

.lead-popup__status.is-success {
  color: #57d68d;
}

.lead-popup__status.is-error {
  color: #ff866e;
}

.lead-popup:not(.is-visible) .lead-popup__dialog {
  transform: translate3d(0, -2vh, 0) rotate(2deg) scale(0.94);
}
