/* Monday WorkForms integration for contact and gated brochure forms. */
.aiflow-form-shell:has(iframe[data-monday-form="contact"]),
.home2-form-frame:has(iframe[data-monday-form="contact"]) {
  width: min(100%, 900px) !important;
  max-width: 900px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.contact-form-wrapper:has(.aiflow-form-shell:has(iframe[data-monday-form="contact"])) {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

iframe[data-monday-form="contact"] {
  display: block !important;
  width: 100% !important;
  max-width: 900px !important;
  height: 1240px !important;
  min-height: 1240px !important;
  margin: 0 auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #102844 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.aiflow-form-shell:has(iframe[data-monday-form="contact"]) iframe[data-monday-form="contact"] {
  max-width: none !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* Keep an even, narrow Monday canvas around the white card on larger screens. */
@media (min-width: 769px) {
  body:is(
    .kontakt-oss-page,
    .about-page,
    .product-page,
    .velix-4in1-page,
    .velix-max-page,
    .velix-titan-page,
    .butikk-roboter-norge,
    .flyplassroboter-norge,
    .hotell-roboter-norge,
    .helse-og-omsorgsroboter-norge,
    .lager-industri-roboter-norge,
    .restaurant-roboter-norge
  ) .aiflow-form-shell:has(iframe[data-monday-form="contact"]),
  body:is(
    .kontakt-oss-page,
    .about-page,
    .product-page,
    .velix-4in1-page,
    .velix-max-page,
    .velix-titan-page,
    .butikk-roboter-norge,
    .flyplassroboter-norge,
    .hotell-roboter-norge,
    .helse-og-omsorgsroboter-norge,
    .lager-industri-roboter-norge,
    .restaurant-roboter-norge
  ) iframe[data-monday-form="contact"] {
    width: min(100%, 680px) !important;
    max-width: 680px !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  body:is(
    .kontakt-oss-page,
    .about-page,
    .product-page,
    .velix-4in1-page,
    .velix-max-page,
    .velix-titan-page,
    .butikk-roboter-norge,
    .flyplassroboter-norge,
    .hotell-roboter-norge,
    .helse-og-omsorgsroboter-norge,
    .lager-industri-roboter-norge,
    .restaurant-roboter-norge
  ) iframe[data-monday-form="contact"] {
    height: 1118px !important;
    min-height: 1118px !important;
    margin-top: -44px !important;
    clip-path: inset(44px 0 0 0);
  }
}

.brochure-gate-modal__body iframe[data-monday-form="brochure"] {
  display: block;
  width: var(--brochure-frame-width, 100%);
  height: var(--brochure-frame-height, calc(100% + 86px));
  min-height: 0;
  margin-top: -86px;
  border: 0;
  background: #f4f7fb;
  transform: scale(var(--brochure-frame-scale, 1));
  transform-origin: top left;
}

/*
 * The Monday form scrolls inside its cross-origin iframe. Keep the modal shell
 * fixed to the viewport so the form is the only scrollable area.
 */
html:has(body.brochure-gate-open) {
  overflow: hidden !important;
}

.brochure-gate-modal__dialog {
  position: relative;
  height: min(900px, calc(100vh - 32px));
  height: min(900px, calc(100dvh - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
}

.brochure-gate-modal__header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  align-items: center !important;
  min-height: 60px;
  padding: 10px 14px 10px 20px !important;
  background: #f4f7fb !important;
}

.brochure-gate-modal__header h2 {
  font-size: 20px !important;
  line-height: 1.25 !important;
}

.brochure-gate-modal__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden !important;
  overscroll-behavior: contain;
}

.brochure-gate-modal__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #1e3a5f;
  font-size: 16px;
  font-weight: 700;
  background: #f4f7fb;
}

.brochure-gate-modal__loading[hidden] {
  display: none !important;
}

.brochure-gate-modal__spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #cfe8e7;
  border-top-color: #00a8a0;
  border-radius: 50%;
  animation: brochure-gate-spin 0.8s linear infinite;
}

@keyframes brochure-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

.brochure-gate-modal__success {
  padding: 96px 28px 60px;
  text-align: center;
  color: #17324d;
  background: #f4f7fb;
}

.brochure-gate-modal__success[hidden] {
  display: none !important;
}

.brochure-gate-modal__success i {
  margin-bottom: 18px;
  color: #00a8a0;
  font-size: 46px;
}

.brochure-gate-modal__success h3 {
  margin: 0 0 10px;
  color: #1e3a5f;
  font-size: 24px;
}

.brochure-gate-modal__success p {
  margin: 0 auto 24px;
  max-width: 420px;
  color: #526174;
  line-height: 1.55;
}

.brochure-gate-modal__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
}

@media (max-width: 768px) {
  iframe[data-monday-form="contact"] {
    height: calc(100vh - 24px) !important;
    height: calc(100dvh - 24px) !important;
    min-height: 600px !important;
    max-height: 820px !important;
    overflow: auto !important;
  }

  .brochure-gate-modal {
    padding: 0 !important;
  }

  .brochure-gate-modal__dialog {
    width: 100% !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0 !important;
  }

  .brochure-gate-modal__header {
    min-height: 60px;
    padding: 8px 10px 8px 16px !important;
  }

  .brochure-gate-modal__header h2 {
    font-size: 18px !important;
  }

  .brochure-gate-modal__body iframe[data-monday-form="brochure"] {
    width: var(--brochure-frame-width, 100%);
    height: var(--brochure-frame-height, calc(100% + 86px));
    min-height: 0;
  }
}

/* Native, server-confirmed brochure form. Enabled only when lead-api-config.js is configured. */
.native-brochure-modal__dialog {
  width: min(100%, 650px) !important;
  height: auto !important;
  max-height: calc(100dvh - 32px) !important;
}

.native-brochure-modal__body {
  overflow-y: auto !important;
  padding: 68px 24px 18px;
  background: #fff !important;
}

.native-brochure-form {
  display: grid;
  gap: 13px;
}

.native-brochure-form__field {
  display: grid;
  gap: 4px;
}

.native-brochure-form label {
  color: #102844;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.native-brochure-form label span {
  color: #c62828;
}

.native-brochure-form small {
  margin-top: -4px;
  color: #26384d;
  font-size: 14px;
  font-weight: 600;
}

.native-brochure-form input[type="text"],
.native-brochure-form input[type="email"],
.native-brochure-form input[type="tel"],
.native-brochure-form input:not([type]) {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid #aebbc9;
  border-radius: 6px;
  background: #fff;
  color: #102844;
  font: inherit;
}

.native-brochure-form input:focus-visible {
  border-color: #1f3f67;
  outline: 3px solid rgba(31, 63, 103, .18);
  outline-offset: 1px;
}

.native-brochure-form__phone {
  display: grid;
  grid-template-columns: 66px 1fr;
}

.native-brochure-form__phone > span {
  display: grid;
  place-items: center;
  border: 1px solid #aebbc9;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background: #f3f6f9;
  color: #102844;
  font-weight: 700;
}

.native-brochure-form__phone input {
  border-radius: 0 6px 6px 0 !important;
}

.native-brochure-form__privacy {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f3f6f9;
}

.native-brochure-form__privacy input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #1f3f67;
}

.native-brochure-form__privacy label {
  font-size: 15px;
  font-weight: 600;
}

.native-brochure-form__honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.native-brochure-form__turnstile {
  min-height: 65px;
}

.native-brochure-form__message {
  margin: 0;
  padding: 11px 13px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.native-brochure-form__message.is-error {
  border: 1px solid #e8b4b4;
  background: #fff1f1;
  color: #8a1c1c;
}

.native-brochure-form__submit {
  justify-self: end;
  min-height: 44px;
  background: #1f3f67;
}

.native-brochure-form__submit:disabled {
  cursor: wait;
  opacity: .72;
}

@media (max-width: 768px) {
  .native-brochure-modal__dialog {
    min-height: 100dvh;
  }

  .native-brochure-modal__body {
    padding: 66px 16px 18px;
  }

  .native-brochure-form {
    gap: 12px;
  }

  .native-brochure-form__submit {
    width: 100%;
  }
}
