/* v632 — Build Form with AI layout-only treatment.
   Presentation only: existing IDs, handlers, iframe workflow and close behavior are unchanged. */

.df-ai-builder-backdrop {
  background: rgba(36, 48, 68, 0.40);
  backdrop-filter: blur(2px);
}

.df-ai-builder-dialog {
  width: min(1190px, calc(100vw - 48px));
  height: min(770px, calc(100vh - 48px));
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.20);
  grid-template-rows: 86px minmax(0, 1fr);
}

.df-ai-builder-header {
  position: relative;
  min-height: 86px;
  padding: 20px 64px 14px 84px;
  gap: 14px;
  border-bottom: 1px solid #e8eaf0;
  background: #ffffff;
}

.df-ai-builder-header::before {
  content: "✦";
  position: absolute;
  left: 22px;
  top: 20px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0eeff;
  color: #5b50f6;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.df-ai-builder-header > div:first-child {
  min-width: 0;
}

.df-ai-builder-eyebrow {
  display: none;
}

.df-ai-builder-header h2 {
  margin: 0;
  color: #25324a;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}

.df-ai-builder-header > div:first-child::after {
  content: "Drop a document. AI reconstructs the visible source block-by-block, verifies fidelity, then maps each verified source node to Form Studio.";
  display: block;
  max-width: 780px;
  margin-top: 6px;
  color: #718096;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

.df-ai-builder-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7b8798;
  font-size: 18px;
  font-weight: 400;
  line-height: 32px;
  transition:
    background-color 160ms ease-out,
    color 160ms ease-out,
    box-shadow 160ms ease-out,
    transform 160ms ease-out;
}

.df-ai-builder-close:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  color: #475569;
}

.df-ai-builder-close:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 80ms;
}

.df-ai-builder-close:focus {
  outline: none;
}

.df-ai-builder-close:focus-visible {
  box-shadow: 0 0 0 3px rgba(91, 80, 246, 0.18);
}

.df-ai-builder-frame-wrap,
.df-ai-builder-frame {
  background: #ffffff;
}

@media (max-width: 820px) {
  .df-ai-builder-dialog {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    grid-template-rows: 92px minmax(0, 1fr);
  }

  .df-ai-builder-header {
    min-height: 92px;
    padding-right: 50px;
  }

  .df-ai-builder-header > div:first-child::after {
    max-width: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .df-ai-builder-close {
    transition: none;
  }

  .df-ai-builder-close:hover,
  .df-ai-builder-close:active {
    transform: none;
  }
}
