/* Case Study / Blog engagement popup */
.cs-popup {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.cs-popup.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cs-popup[hidden]:not(.is-visible) {
  display: none !important;
}

.cs-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}

.cs-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 29.375rem);
  min-height: 33.4375rem;
  max-height: calc(100vh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1.25rem;
  border-radius: 1.25rem;
  background: #f5f5f5;
  box-shadow: 0 1.125rem 3.125rem rgba(0, 0, 0, 0.12);
  outline: none;
  transform: translateY(0.75rem) scale(0.98);
  transition: transform 0.22s ease;
}

.cs-popup.is-visible .cs-popup__dialog {
  transform: translateY(0) scale(1);
}

button.cs-popup__close,
.cs-popup__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #979797 !important;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
}

.cs-popup__close svg {
  width: 0.7515rem;
  height: 0.7515rem;
  display: block;
  pointer-events: none;
}

.cs-popup__close:focus-visible {
  outline: 0.125rem solid #957ffb;
  outline-offset: 0.25rem;
}

.cs-popup__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cs-popup__eyebrow {
  margin: 2.5rem 0 0;
  color: #957ffb;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3125rem;
}

.cs-popup__title {
  margin: 0.1875rem 0 0;
  color: #0c0908;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 2.8125rem;
}

.cs-popup__text {
  width: min(80.2128%, 23.5625rem);
  margin: 0.625rem 0 0;
  color: #979797;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.125rem;
}

.cs-popup--blog .cs-popup__title {
  width: 19.3125rem;
  max-width: calc(100% - 2.5rem);
}

.cs-popup--blog .cs-popup__text {
  font-size: 0.6875rem;
  line-height: 1.0625rem;
}

.cs-popup--blog .cs-popup__form {
  margin-top: 1.375rem;
}

.cs-popup__form {
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
  width: calc(100% - 4.3125rem);
  margin-top: 1.25rem;
}

.cs-popup__field-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.cs-popup__field {
  display: flex;
  align-items: center;
  width: 100%;
  height: 3.125rem;
  padding: 0.5625rem 0.625rem;
  border-radius: 0.75rem;
  background: #fff;
  margin: 0;
  margin-top: 0;
  transition: box-shadow 0.2s ease;
}

.cs-popup__field-icon {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  line-height: 0;
}

.cs-popup__field-icon svg {
  display: block;
  width: 2rem;
  height: 2rem;
}

.cs-popup__field input {
  flex: 1;
  min-width: 0;
  height: 2rem;
  padding: 0 0.625rem;
  border: 0;
  background: transparent;
  color: #5c5c5c;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3125rem;
  outline: 0;
}

.cs-popup__field input::placeholder {
  color: #5c5c5c;
  opacity: 1;
}

.cs-popup__field:focus-within {
  box-shadow: 0 0 0 0.125rem rgba(149, 127, 251, 0.35);
}

.cs-popup__field.is-invalid {
  box-shadow: 0 0 0 0.125rem rgba(220, 53, 69, 0.45);
}

.cs-popup__error {
  margin: 0;
  padding: 0 0.25rem;
  color: #dc3545;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 0.875rem;
  text-align: left;
}

.cs-popup__error:empty {
  display: none;
}

button.cs-popup__cta,
.cs-popup__cta[type="submit"],
.cs-popup__cta {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  box-sizing: border-box;
  width: 100%;
  height: 3.125rem;
  margin: 0 !important;
  padding: 0.625rem 1.25rem !important;
  border: 0 !important;
  border-radius: 5.25rem !important;
  background: linear-gradient(180deg, #957ffb 0%, #bbacfe 100%) !important;
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3125rem;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button.cs-popup__cta svg,
.cs-popup__cta svg {
  width: 1.1429rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.cs-popup__cta:focus-visible,
.cs-popup__later:focus-visible {
  outline: 0.125rem solid #0c0908;
  outline-offset: 0.1875rem;
}

button.cs-popup__cta:disabled,
.cs-popup__cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.cs-popup__cta.is-loading:disabled,
.cs-popup__cta.is-loading:disabled {
  cursor: wait;
  opacity: 0.75;
}

.cs-popup__status {
  min-height: 1rem;
  margin: 0;
  color: #23B166;
  font-size: 0.6875rem;
  line-height: 1rem;
  text-align: center;
}

.cs-popup__later {
  margin-top: 1.1875rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0c0908;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  cursor: pointer;
}

/* Do not set overflow:hidden / transform on html|body — that breaks
   position:sticky blog TOC + sidebars (they snap out of the viewport). */
/* html.cs-popup-open {
  overscroll-behavior: none;
} */

@media screen and (max-width: 767px) {
  html.cs-popup-open {
    overscroll-behavior: none;
  }
  .cs-popup {
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cs-popup__dialog {
    width: 100%;
    max-width: 29.375rem;
    min-height: 0;
    max-height: calc(100vh - 1.5rem);
    margin: 0;
    padding-bottom: 1rem;
  }

  .cs-popup.is-visible .cs-popup__dialog,
  .cs-popup__dialog {
    transform: none;
  }

  button.cs-popup__close,
  .cs-popup__close {
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
  }

  .cs-popup__eyebrow {
    margin-top: 1.75rem;
  }

  .cs-popup__title,
  .cs-popup--blog .cs-popup__title {
    width: auto;
    max-width: calc(100% - 2.75rem);
    font-size: clamp(1.375rem, 6.5vw, 1.75rem);
    line-height: 1.35;
  }

  .cs-popup__text {
    width: calc(100% - 2.5rem);
  }

  .cs-popup__form,
  .cs-popup--blog .cs-popup__form {
    width: calc(100% - 2.5rem);
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .cs-popup__field {
    height: 2.875rem;
  }

  button.cs-popup__cta,
  .cs-popup__cta[type="submit"],
  .cs-popup__cta {
    height: 2.875rem;
    font-size: 0.8125rem;
    padding: 0.5rem 1rem !important;
  }

  button.cs-popup__later,
  .cs-popup__later {
    margin-top: 0.875rem !important;
    margin-bottom: 0.25rem !important;
  }
}
