/* Lightweight site popup system — keep payload small */
.cms-popup-host {
  position: relative;
  z-index: 10000;
}

.cms-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10001;
}

.cms-popup[hidden],
.cms-popup-host[hidden] {
  display: none !important;
}

.cms-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cms-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 36rem);
  max-height: min(90vh, 40rem);
  background: #fff;
  color: #111;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  padding: 1.25rem 1.25rem 1.5rem;
}

.cms-popup__dialog--scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.cms-popup__close {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-end: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.cms-popup__close:hover,
.cms-popup__close:focus-visible {
  color: #000;
}

.cms-popup__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  padding-inline-end: 2rem;
}

.cms-popup__image {
  margin-block-end: 0.85rem;
}

.cms-popup__image img {
  display: block;
  width: 100%;
  max-height: 14rem;
  object-fit: cover;
  border-radius: 6px;
}

.cms-popup__text {
  margin: 0 0 1rem;
  white-space: pre-wrap;
  line-height: 1.7;
}

.cms-popup__content {
  margin-block-end: 1rem;
}

.cms-popup__content :first-child {
  margin-block-start: 0;
}

.cms-popup__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.55rem 1.1rem;
  margin-block-end: 0.85rem;
  border: 0;
  border-radius: 6px;
  background: #111;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.cms-popup__cta:hover,
.cms-popup__cta:focus-visible {
  background: #333;
  color: #fff;
}

.cms-popup__form .public-form-embed > h2 {
  font-size: 1.1rem;
}

.cms-popup__form .public-form-errors,
.cms-popup__form .public-form-field-error {
  color: #b91c1c;
}

.cms-popup__form .public-form {
  margin-block-start: 0.5rem;
  padding: 1rem;
}

.cms-popup__form .public-form-empty {
  margin: 0;
  color: #666;
}

body.cms-popup-open {
  overflow: hidden;
}

.cms-popup-site-form .fs-sm {
  margin-block: 0 1rem;
}

.cms-popup-site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-block-start: 1.25rem;
}

@media (max-width: 640px) {
  .cms-popup {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .cms-popup__dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
    padding: 1rem;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .cms-popup__dialog {
    width: min(100%, 28rem);
  }
}
