.fv-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.fv-form-overlay[hidden] {
  display: none;
}

.fv-form-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 18, 0.68);
  backdrop-filter: blur(10px);
}

.fv-form-overlay__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.9rem;
  width: min(100%, 68rem);
  max-height: min(90vh, 60rem);
  padding: 0;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--color-border) 88%, transparent);
  border-radius: 2rem;
  background: color-mix(in srgb, var(--color-surface) 96%, var(--color-bg));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.fv-form-overlay__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid color-mix(in srgb, var(--color-border) 86%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface-soft) 92%, transparent);
  color: var(--color-text);
  cursor: pointer;
}

.fv-form-overlay__close span {
  line-height: 1;
  font-size: 1.5rem;
}

.fv-form-overlay__header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 2vw, 1.35rem) clamp(1.1rem, 2vw, 1.6rem) 0;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-surface) 98%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-surface) 94%, var(--color-bg)) 72%,
      rgba(0, 0, 0, 0) 100%
    );
}

.fv-form-overlay__eyebrow {
  margin: 0;
  color: var(--color-accent);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.fv-form-overlay__body {
  min-width: 0;
  padding: 0 clamp(1.1rem, 2vw, 1.6rem) clamp(1.1rem, 2vw, 1.6rem);
}

.fv-form-overlay__panel {
  display: none;
}

.fv-form-overlay__panel.is-active {
  display: block;
}

.fv-form-overlay__panel .formavis-form,
.fv-form-overlay__panel .formavis-contact-layout,
.fv-form-overlay__panel .formavis-contact-form-wrapper {
  max-width: 100%;
}

.fv-form-overlay__booking-frame {
  display: block;
  width: 100%;
  min-height: min(72vh, 52rem);
  border: 0;
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--color-surface) 96%, var(--color-bg));
}

body.fv-form-overlay-enabled .fv-homepage__form-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-business__form-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-protect__form-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-smart-home__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-itsec__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-netzwerk__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-integration__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-saw__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-netzwerk-demo__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-demo__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-leistungen__inquiry-shell.fv-form-overlay-source,
body.fv-form-overlay-enabled .fv-smart-building__inquiry-shell.fv-form-overlay-source {
  display: none !important;
}

body.fv-form-overlay-enabled .fv-homepage__closing-grid:has(.fv-homepage__form-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-business__closing-grid:has(.fv-business__form-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-protect__closing-grid:has(.fv-protect__form-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-smart-home__closing-grid:has(.fv-smart-home__inquiry-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-itsec__closing-grid:has(.fv-itsec__inquiry-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-netzwerk__closing-grid:has(.fv-netzwerk__inquiry-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-integration__closing-grid:has(.fv-integration__inquiry-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-leistungen__closing-grid:has(.fv-leistungen__inquiry-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-smart-building__closing-grid:has(.fv-smart-building__inquiry-shell.fv-form-overlay-source),
body.fv-form-overlay-enabled .fv-smart-home-vorschau__closing-grid:has(.fv-demo__inquiry-shell.fv-form-overlay-source) {
  grid-template-columns: 1fr !important;
}

body.fv-overlay-embed-page {
  background: transparent;
}

body.fv-overlay-embed-page #wpadminbar,
body.fv-overlay-embed-page #masthead,
body.fv-overlay-embed-page #colophon,
body.fv-overlay-embed-page .site-above-footer-wrap,
body.fv-overlay-embed-page .site-below-footer-wrap,
body.fv-overlay-embed-page .ast-mobile-header-wrap,
body.fv-overlay-embed-page .ast-desktop-header-content,
body.fv-overlay-embed-page .fv-header-floating-stack,
body.fv-overlay-embed-page .fv-pre-chat {
  display: none !important;
}

body.fv-overlay-embed-page .site-content,
body.fv-overlay-embed-page .content-area,
body.fv-overlay-embed-page .entry-content,
body.fv-overlay-embed-page .ast-container {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

body.fv-overlay-embed-page .entry-header,
body.fv-overlay-embed-page .post-navigation,
body.fv-overlay-embed-page .comments-area {
  display: none !important;
}

body.fv-overlay-embed-page .ast-article-single,
body.fv-overlay-embed-page .ast-article-post,
body.fv-overlay-embed-page .site .entry-content > .wp-block-group,
body.fv-overlay-embed-page .site .entry-content > .wp-block-columns,
body.fv-overlay-embed-page .site .entry-content > .wp-block-cover {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.fv-overlay-embed-page--booking .site-content {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

@media (max-width: 768px) {
  .fv-form-overlay {
    padding: 0.7rem;
  }

  .fv-form-overlay__dialog {
    max-height: min(92vh, 60rem);
    border-radius: 1.4rem;
  }

  .fv-form-overlay__header {
    padding: 0.95rem 0.95rem 0;
  }

  .fv-form-overlay__body {
    padding: 0 0.95rem 0.95rem;
  }

  .fv-form-overlay__booking-frame {
    min-height: min(76vh, 48rem);
    border-radius: 1.1rem;
  }
}
