/* AI Form Assist for JetFormBuilder — styles
   Designed to match the blue-accent mockup. */

.aifa-wrap {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}

/* The AI Assist pill button */
.aifa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
.aifa-btn:hover { background: #e0e7ff; }
.aifa-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.aifa-btn:disabled { opacity: .6; cursor: default; }
.aifa-btn .aifa-ico { font-size: 14px; }

/* Dropdown menu of AI actions */
.aifa-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1000;
  min-width: 230px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .14);
  padding: 8px;
}
.aifa-menu[hidden] { display: none; }

.aifa-menu-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #9ca3af;
  padding: 6px 10px 8px;
}

.aifa-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
  color: #1e3a8a;
  cursor: pointer;
}
.aifa-menu-item:hover { background: #f3f4f6; }
.aifa-menu-ico {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  color: #3b82f6;
}

/* Place button bottom-right inside textareas (like the Short Summary field) */
.aifa-textarea-holder { position: relative; }
.aifa-in-textarea {
  position: absolute;
  right: 12px;
  bottom: 12px;
  margin-top: 0;
}
.aifa-in-textarea .aifa-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

/* Spinner shown while a request is running */
.aifa-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(67, 56, 202, .3);
  border-top-color: #4338ca;
  border-radius: 50%;
  animation: aifa-spin .7s linear infinite;
  vertical-align: -2px;
  margin-right: 4px;
}
@keyframes aifa-spin { to { transform: rotate(360deg); } }

/* Inline error toast under the button */
.aifa-error {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1000;
  max-width: 260px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
}

/* Section guidance panel */
.aifa-guidance {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 22px;
}
.aifa-guidance h4 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aifa-guidance ul {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.aifa-guidance li {
  color: #2563eb;
  font-size: 14px;
  line-height: 1.5;
  margin: 4px 0;
}

/* Give single-line inputs room so the button doesn't crowd long text */
.aifa-has-button { padding-right: 8px; }

@media (max-width: 600px) {
  .aifa-menu { right: auto; left: 0; }
}
