.consultation-popup[hidden] {
  display: none !important;
}

.consultation-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  place-items: safe center;
  align-content: center;
  align-content: safe center;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  --consultation-popup-block-inset: max(
    16px,
    env(safe-area-inset-top),
    env(safe-area-inset-bottom)
  );
  padding:
    var(--consultation-popup-block-inset)
    max(16px, env(safe-area-inset-right))
    var(--consultation-popup-block-inset)
    max(16px, env(safe-area-inset-left));
  font-family: "Poppins", sans-serif;
  opacity: 0;
  transition: opacity 180ms ease;
  overscroll-behavior: contain;
}

.consultation-popup.is-open {
  opacity: 1;
}

.consultation-popup__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.consultation-popup__scale {
  position: relative;
  width: 644px;
  height: 679.7px;
  flex: 0 0 auto;
  margin-bottom: 41px;
}

.consultation-popup__stage {
  position: absolute;
  inset: 0 auto auto 0;
  width: 920px;
  height: 971px;
  isolation: isolate;
  transform: scale(0.7);
  transform-origin: top left;
}

.consultation-popup__sheet {
  position: absolute;
  display: block;
  width: 804.453px;
  border-radius: 31.424px;
  pointer-events: none;
  transform-origin: center center;
}

.consultation-popup__sheet--left-back {
  z-index: 0;
  top: 57.279px;
  left: 27.807px;
  height: 874.03px;
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(-3.76deg);
}

.consultation-popup__sheet--left-front {
  z-index: 1;
  top: 25.853px;
  left: 44.224px;
  height: 919.303px;
  background: #e3e3e3;
  transform: rotate(-1.78deg);
}

.consultation-popup__sheet--right-back {
  z-index: 0;
  top: 57.279px;
  left: 87.847px;
  height: 874.03px;
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(3.76deg);
}

.consultation-popup__sheet--right-front {
  z-index: 1;
  top: 25.853px;
  left: 71.434px;
  height: 919.303px;
  background: #e3e3e3;
  transform: rotate(1.78deg);
}

.consultation-popup__panel {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 58.14px;
  width: 804.453px;
  min-height: 971px;
  padding: 0;
  overflow: hidden;
  border-radius: 31.424px;
  background: linear-gradient(180deg, #f2edfe 0%, #ffeafa 100%);
  color: #3e3050;
  box-shadow: 0 20px 70px rgba(20, 14, 31, 0.16);
}

.consultation-popup__header {
  position: relative;
  height: 251.392px;
  overflow: hidden;
  border-radius: 31.424px 31.424px 0 0;
  background: linear-gradient(137.283deg, #e9a5fc 0%, #898bf8 100%);
  color: #fff;
}

.consultation-popup__close {
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 19.593px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.consultation-popup__close img {
  display: block;
  width: 24px;
  height: 24px;
}

.consultation-popup__close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.75);
  outline-offset: 4px;
  border-radius: 50%;
}

.consultation-popup__eyebrow {
  position: absolute;
  top: 31.42px;
  left: 31.42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9.15px;
  margin: 0;
  padding: 10.065px 30.195px 9.15px;
  border: 0.915px solid #e9d5ff;
  border-radius: 128.099px;
  background: #f5e8ff;
  color: #3e3050;
  font-size: 16.47px;
  font-weight: 300;
  line-height: normal;
  letter-spacing: -0.3294px;
  text-transform: uppercase;
  white-space: nowrap;
}

.consultation-popup__eyebrow img {
  display: block;
  width: 6.285px;
  height: 6.285px;
}

.consultation-popup__header h2 {
  position: absolute;
  top: 116.506px;
  left: 31.42px;
  width: 624.906px;
  margin: 0;
  color: #fff;
  font-family: "Playfair Display", serif;
  font-size: 52.124px;
  font-weight: 700;
  line-height: 65.527px;
  letter-spacing: -1.0425px;
}

.consultation-popup__description {
  position: absolute;
  top: 188.64px;
  left: 31.42px;
  width: 624.906px;
  margin: 0;
  color: #fff;
  font-size: 21.003px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: -0.4201px;
}

.consultation-popup__accent-bar {
  position: absolute;
  top: 210.54px;
  right: 50.284px;
  width: 37.709px;
  height: 9.427px;
  border-radius: 157.12px;
  background: #fff;
}

.consultation-popup__accent-dot {
  position: absolute;
  top: 210.54px;
  right: 31.216px;
  display: block;
  width: 9.427px;
  height: 9.427px;
}

.consultation-popup__form {
  padding: 31.428px 40.852px 25px;
}

.consultation-popup__fields {
  display: grid;
  gap: 30.868px;
}

.consultation-popup__field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20.439px;
}

.consultation-popup__fields input,
.consultation-popup__fields textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 1.531px solid #ddd6fe;
  border-radius: 15.712px;
  outline: 0;
  background: #ddd6fe;
  color: #3e3050;
  font-family: "Poppins", sans-serif;
  font-size: 18.854px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: -0.3771px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.consultation-popup__fields input {
  height: 68.112px;
  padding: 0 23.56px;
}

.consultation-popup__fields > input {
  height: 69.133px;
}

.consultation-popup__fields textarea {
  height: 158.691px;
  min-height: 158.691px;
  margin-top: 0.559px;
  padding: 18.85px 23.56px;
  resize: vertical;
}

.consultation-popup__fields input::placeholder,
.consultation-popup__fields textarea::placeholder {
  color: #3e3050;
  opacity: 1;
}

.consultation-popup__fields input:focus,
.consultation-popup__fields textarea:focus {
  border-color: #a855f7;
  background: #e5dffe;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.14);
}

.consultation-popup__proof {
  display: flex;
  align-items: center;
  width: 100%;
  height: 86.416px;
  margin-top: 31.419px;
  padding: 18.86px 23.56px;
  border: 1.571px solid #ddd6fe;
  border-radius: 15.712px;
  background: #e9e4ff;
}

.consultation-popup__avatars {
  display: flex;
  align-items: center;
  flex: 0 0 120px;
  margin-right: 15.7px;
}

.consultation-popup__avatars img {
  display: block;
  width: 120px;
  height: 48px;
  object-fit: contain;
}

.consultation-popup__proof-copy {
  min-width: 0;
}

.consultation-popup__stars {
  display: block;
  width: 70.709px;
  height: 13.321px;
  margin-bottom: 7px;
}

.consultation-popup__proof-copy p {
  margin: 0;
  color: #3e3050;
  font-size: 15.712px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: -0.3142px;
  white-space: nowrap;
}

.consultation-popup__proof-copy strong {
  font-weight: 500;
}

.consultation-popup__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 401px;
  max-width: 100%;
  min-width: 0;
  margin: 31.424px auto 0;
  padding: 18.722px 31.204px;
  border: 0;
  border-radius: 49.926px;
  background: #a855f7;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 19.97px;
  font-weight: 500;
  line-height: 29.955px;
  letter-spacing: -0.3994px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.consultation-popup__submit:hover {
  background: #9543e4;
  box-shadow: 0 12px 26px rgba(95, 49, 145, 0.22);
  transform: translateY(-2px);
}

.consultation-popup__submit:focus-visible {
  outline: 3px solid rgba(62, 48, 80, 0.35);
  outline-offset: 4px;
}

.consultation-popup__submit:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
}

.consultation-popup__privacy {
  width: 571.916px;
  max-width: 100%;
  margin: 31.424px auto 0;
  color: #3e3050;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: -0.2514px;
  text-align: center;
}

body.has-consultation-popup {
  overflow: hidden;
}

/* Only the popup canvas scales on smaller viewports; its Figma layout stays intact. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .consultation-popup__scale {
    width: 588.8px;
    height: 621.44px;
  }

  .consultation-popup__stage {
    transform: scale(0.64);
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .consultation-popup__scale {
    width: 588.8px;
    height: 621.44px;
  }

  .consultation-popup__stage {
    transform: scale(0.64);
  }
}

@media (min-width: 620px) and (max-width: 767.98px) {
  .consultation-popup__scale {
    width: 515.2px;
    height: 543.76px;
  }

  .consultation-popup__stage {
    transform: scale(0.56);
  }
}

@media (min-width: 480px) and (max-width: 619.98px) {
  .consultation-popup__scale {
    width: 414px;
    height: 436.95px;
  }

  .consultation-popup__stage {
    transform: scale(0.45);
  }

}

@media (min-width: 390px) and (max-width: 479.98px) {
  .consultation-popup__scale {
    width: 349.6px;
    height: 368.98px;
  }

  .consultation-popup__stage {
    transform: scale(0.38);
  }
}

@media (min-width: 360px) and (max-width: 389.98px) {
  .consultation-popup__scale {
    width: 303.6px;
    height: 320.43px;
  }

  .consultation-popup__stage {
    transform: scale(0.33);
  }
}

@media (max-width: 359.98px) {
  .consultation-popup__scale {
    width: 266.8px;
    height: 281.59px;
  }

  .consultation-popup__stage {
    transform: scale(0.29);
  }
}

@media (min-width: 620px) and (max-height: 899.98px) {
  .consultation-popup__scale {
    width: 552px;
    height: 582.6px;
  }

  .consultation-popup__stage {
    transform: scale(0.6);
  }
}

@media (min-width: 620px) and (max-height: 749.98px) {
  .consultation-popup__scale {
    width: 496.8px;
    height: 524.34px;
  }

  .consultation-popup__stage {
    transform: scale(0.54);
  }
}

@media (prefers-reduced-motion: reduce) {
  .consultation-popup,
  .consultation-popup__scale,
  .consultation-popup__submit {
    transition: none;
  }
}
