/* Lead-capture popup — public site overlay */

.ins-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  font-family: Assistant, system-ui, sans-serif;
}

@media (min-width: 640px) {
  .ins-popup {
    align-items: center;
  }
}

.ins-popup[hidden] {
  display: none !important;
}

.ins-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.ins-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(28rem, 100%);
  max-height: min(36rem, calc(100dvh - 1.5rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1.35rem 1.25rem 1.5rem;
  border-radius: 1.35rem 1.35rem 0.85rem 0.85rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  color: #0f172a;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  animation: ins-popup-in 0.28s ease-out;
}

@media (min-width: 640px) {
  .ins-popup__dialog {
    border-radius: 1.35rem;
    padding: 1.6rem 1.5rem 1.65rem;
  }
}

@keyframes ins-popup-in {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ins-popup__close,
.ins-popup__submit {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ins-popup__close {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #fff;
  color: #334155;
  font-size: 1.65rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.ins-popup__close:hover,
.ins-popup__close:focus-visible {
  background: #f8fafc;
  color: #0f172a;
}

.ins-popup__close:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.ins-popup__brand {
  margin: 0 0 0.45rem;
  padding-inline-end: 3rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0284c7;
}

.ins-popup__title {
  margin: 0;
  padding-inline-end: 3rem;
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
}

.ins-popup__copy {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
  color: #475569;
}

.ins-popup__form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.15rem;
}

.ins-popup__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.ins-popup__optional {
  font-weight: 600;
  color: #64748b;
}

.ins-popup__field input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  background: #f8fafc;
  color: #0f172a;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.ins-popup__field input:focus {
  outline: none;
  border-color: #0ea5e9;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.ins-popup__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ins-popup__error {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #b45309;
}

.ins-popup__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: linear-gradient(145deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.28);
}

.ins-popup__submit:hover {
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.38);
}

.ins-popup__submit:focus-visible {
  outline: 2px solid #fb923c;
  outline-offset: 3px;
}

.ins-popup__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.ins-popup__success {
  margin: 1.15rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.ins-popup.is-success .ins-popup__form {
  display: none;
}

.ins-popup.is-success .ins-popup__copy {
  display: none;
}

body.ins-popup-open {
  overflow: hidden;
}

html.ins-a11y-grayscale .ins-popup,
html.ins-a11y-contrast .ins-popup {
  filter: none;
}
