/**
 * AI Chatbot — stili isolati dal tema.
 * Tutte le regole sono sotto .aic-chat per limitare l’impatto e resistere agli override comuni.
 */

.aic-chat,
.aic-chat *,
.aic-chat *::before,
.aic-chat *::after {
  box-sizing: border-box !important;
}

.aic-chat {
  --aic-bg: #ffffff;
  --aic-bg-soft: #fbfbfb;
  --aic-bg-header: linear-gradient(180deg, #fafafa, #f5f5f5);
  --aic-text: #111111;
  --aic-border: rgba(0, 0, 0, 0.12);
  --aic-user-bg: #111111;
  --aic-user-text: #ffffff;
  --aic-radius: 14px;
  --aic-radius-bubble: 14px;
  --aic-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  max-width: 720px;
  margin: 24px auto !important;
  padding: 0 !important;
  border: 1px solid var(--aic-border) !important;
  border-radius: var(--aic-radius) !important;
  overflow: hidden;
  background: var(--aic-bg) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06) !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: var(--aic-text) !important;
  isolation: isolate;
  contain: content;
  position: relative;
  z-index: 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Reset solo per eventuali altri form annidati: non applicare al footer composer */
.aic-chat form:not(.aic-chat__composer) {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Header */
.aic-chat__header {
  padding: 14px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: var(--aic-bg-header) !important;
}

.aic-chat__title {
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--aic-text) !important;
  border: none !important;
  background: transparent !important;
}

/* Area messaggi */
.aic-chat__messages {
  height: 420px;
  overflow: auto;
  padding: 16px !important;
  margin: 0 !important;
  background: var(--aic-bg-soft) !important;
  border: none !important;
}

/* Bubbles layout */
.aic-chat .aic-bubble {
  display: flex !important;
  margin: 10px 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  list-style: none !important;
}

.aic-bubble--user {
  justify-content: flex-end;
}

.aic-bubble--assistant {
  justify-content: flex-start;
}

/* Contenuto bubble — forza stile rispetto ai temi */
.aic-chat .aic-bubble__text {
  max-width: 82%;
  padding: 10px 12px !important;
  margin: 0 !important;
  border-radius: var(--aic-radius-bubble) !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  background: #ffffff !important;
  color: var(--aic-text) !important;
  white-space: normal !important;
  word-break: break-word;
  box-shadow: none !important;
  text-align: left !important;
}

.aic-chat .aic-bubble--user .aic-bubble__text {
  background: var(--aic-user-bg) !important;
  color: var(--aic-user-text) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  border-bottom-right-radius: 6px !important;
}

.aic-chat .aic-bubble--assistant .aic-bubble__text {
  background: #ffffff !important;
  color: var(--aic-text) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
  border-bottom-left-radius: 6px !important;
}

.aic-chat .aic-error {
  color: #b00020 !important;
  background: #ffffff !important;
}

/* Footer / composer — specificità alta (form + classe) così non perde contro reset tema */
.aic-chat form.aic-chat__composer,
.aic-chat .aic-chat__composer {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 12px !important;
  margin: 0 !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-bottom: none !important;
  border-left: none !important;
  border-right: none !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

/* Input — reset tema (button/input globali) */
.aic-chat input.aic-chat__input,
.aic-chat input[type="text"].aic-chat__input,
.aic-chat input[type="search"].aic-chat__input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  background: #ffffff !important;
  color: var(--aic-text) !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: normal !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  transition: border-color 0.15s ease !important;
}

.aic-chat input.aic-chat__input:focus,
.aic-chat input[type="text"].aic-chat__input:focus {
  border-color: rgba(0, 0, 0, 0.45) !important;
  outline: none !important;
  box-shadow: none !important;
}

.aic-chat input.aic-chat__input::placeholder {
  color: rgba(0, 0, 0, 0.45) !important;
  opacity: 1 !important;
}

/* Pulsante invio */
.aic-chat button.aic-chat__send,
.aic-chat button[type="submit"].aic-chat__send {
  flex: 0 0 auto !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: #111111 !important;
  color: #ffffff !important;
  cursor: pointer !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-decoration: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.aic-chat button.aic-chat__send:hover,
.aic-chat button[type="submit"].aic-chat__send:hover,
.aic-chat button.aic-chat__send:focus {
  opacity: 0.92 !important;
  background: #111111 !important;
  color: #ffffff !important;
  outline: none !important;
}

.aic-loader {
  opacity: 0.75 !important;
}

/* Markdown dentro le bubble — scope stretto */
.aic-chat .aic-md {
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
}

.aic-chat .aic-md h1,
.aic-chat .aic-md h2,
.aic-chat .aic-md h3 {
  margin: 10px 0 6px !important;
  padding: 0 !important;
  line-height: 1.2 !important;
  font-family: var(--aic-font) !important;
  font-weight: 700 !important;
  color: inherit !important;
  border: none !important;
  background: transparent !important;
}

.aic-chat .aic-md h1 {
  font-size: 18px !important;
}
.aic-chat .aic-md h2 {
  font-size: 16px !important;
}
.aic-chat .aic-md h3 {
  font-size: 15px !important;
}

.aic-chat .aic-md p {
  margin: 8px 0 !important;
  padding: 0 !important;
  font-size: inherit !important;
  color: inherit !important;
}

.aic-chat .aic-md ul,
.aic-chat .aic-md ol {
  margin: 8px 0 8px 18px !important;
  padding: 0 !important;
  list-style-position: outside !important;
}

.aic-chat .aic-md li {
  margin: 4px 0 !important;
  padding: 0 !important;
}

.aic-chat .aic-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
  font-size: 13px !important;
  padding: 2px 6px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: rgba(0, 0, 0, 0.04) !important;
  color: inherit !important;
}

.aic-chat .aic-md pre {
  margin: 10px 0 !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  background: rgba(0, 0, 0, 0.04) !important;
  overflow: auto !important;
}

.aic-chat .aic-md pre code {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  display: block !important;
  white-space: pre !important;
}

.aic-chat .aic-md a {
  color: inherit !important;
  text-decoration: underline !important;
  font-weight: inherit !important;
}

.aic-chat__contact-btn,
.aic-chat a.aic-chat__contact-btn {
  height: 42px !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: #111111 !important;
  color: #ffffff !important;
  cursor: pointer !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
}

.aic-chat__contact-btn:hover,
.aic-chat a.aic-chat__contact-btn:hover {
  opacity: 0.92 !important;
  color: #ffffff !important;
}

.aic-contact-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.aic-contact-text {
  margin: 0 !important;
}

/**
 * Contrasto con regole tipo:
 * .ed-post-content :is(p, span, a, div, img) { padding: 0 !important; margin: 0 !important; }
 * Ripristiniamo padding/margini espliciti con specificità maggiore.
 */
.ed-post-content .aic-chat {
  margin: 24px auto !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat .aic-chat__header {
  padding: 14px 16px !important;
  margin: 0 !important;
}

.ed-post-content .aic-chat .aic-chat__messages {
  padding: 16px !important;
  margin: 0 !important;
}

.ed-post-content .aic-chat form.aic-chat__composer,
.ed-post-content .aic-chat .aic-chat__composer {
  padding: 12px !important;
  margin: 0 !important;
}

.ed-post-content .aic-chat .aic-bubble {
  margin: 10px 0 !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat .aic-bubble__text {
  padding: 10px 12px !important;
  margin: 0 !important;
}

.ed-post-content .aic-chat .aic-md p {
  margin: 8px 0 !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat .aic-md h1,
.ed-post-content .aic-chat .aic-md h2,
.ed-post-content .aic-chat .aic-md h3 {
  margin: 10px 0 6px !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat .aic-md ul,
.ed-post-content .aic-chat .aic-md ol {
  margin: 8px 0 8px 18px !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat .aic-md li {
  margin: 4px 0 !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat .aic-md a {
  padding: 0 !important;
  margin: 0 !important;
}

.ed-post-content .aic-chat input.aic-chat__input,
.ed-post-content .aic-chat input[type="text"].aic-chat__input {
  padding: 0 12px !important;
  margin: 0 !important;
}

.ed-post-content .aic-chat button.aic-chat__send,
.ed-post-content .aic-chat button[type="submit"].aic-chat__send {
  padding: 0 14px !important;
  margin: 0 !important;
}

.ed-post-content .aic-chat .aic-md img {
  margin: 8px 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  height: auto !important;
}

/* Quick questions */
.aic-chat .aic-quick-questions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.aic-chat button.aic-quick-question,
.aic-chat .aic-quick-question {
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(0, 0, 0, 0.14) !important;
  background: #ffffff !important;
  color: var(--aic-text) !important;
  cursor: pointer !important;
  font-family: var(--aic-font) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  text-align: left !important;
  text-transform: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.aic-chat button.aic-quick-question:hover,
.aic-chat button.aic-quick-question:focus {
  border-color: rgba(0, 0, 0, 0.34) !important;
  background: #f7f7f7 !important;
  color: var(--aic-text) !important;
  outline: none !important;
}

.aic-chat .aic-chat__composer--disabled {
  opacity: 0.72 !important;
}

.aic-chat input.aic-chat__input:disabled,
.aic-chat button.aic-chat__send:disabled {
  cursor: not-allowed !important;
  opacity: 0.65 !important;
}

/* Limit modal */
.aic-chat .aic-limit-modal {
  position: absolute !important;
  inset: 0 !important;
  z-index: 20 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 18px !important;
  margin: 0 !important;
}

.aic-chat .aic-limit-modal__backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.42) !important;
  margin: 0 !important;
  padding: 0 !important;
}

.aic-chat .aic-limit-modal__panel {
  position: relative !important;
  z-index: 1 !important;
  width: min(100%, 420px) !important;
  margin: 0 !important;
  padding: 20px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: #ffffff !important;
  color: var(--aic-text) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18) !important;
  font-family: var(--aic-font) !important;
}

.aic-chat .aic-limit-modal__close {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--aic-text) !important;
  cursor: pointer !important;
  font-size: 24px !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.aic-chat .aic-limit-modal__title {
  margin: 0 28px 8px 0 !important;
  padding: 0 !important;
  color: var(--aic-text) !important;
  font-family: var(--aic-font) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

.aic-chat .aic-limit-modal__text {
  margin: 0 0 16px !important;
  padding: 0 !important;
  color: var(--aic-text) !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
}

.aic-chat .aic-limit-modal__actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  justify-content: flex-end !important;
  margin: 0 !important;
  padding: 0 !important;
}

.aic-chat .aic-limit-modal__primary,
.aic-chat a.aic-limit-modal__primary,
.aic-chat .aic-limit-modal__secondary {
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  text-transform: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
}

.aic-chat .aic-limit-modal__primary,
.aic-chat a.aic-limit-modal__primary {
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: #111111 !important;
  color: #ffffff !important;
}

.aic-chat .aic-limit-modal__secondary {
  border: 1px solid rgba(0, 0, 0, 0.14) !important;
  background: #ffffff !important;
  color: var(--aic-text) !important;
}

.ed-post-content .aic-chat .aic-quick-questions {
  margin: 10px 0 0 !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat button.aic-quick-question {
  padding: 8px 10px !important;
  margin: 0 !important;
}


/* Direct form limit modal */
.aic-chat .aic-limit-modal--form-direct {
  padding: 24px !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.42) !important;
}

.aic-chat .aic-limit-modal__panel--form-direct {
  width: min(100%, 560px) !important;
  height: auto !important;
  max-height: calc(100% - 48px) !important;
  max-width: 560px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: auto !important;
}

.aic-chat .aic-limit-modal__form-header {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 22px 48px 14px 22px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: #ffffff !important;
}

.aic-chat .aic-limit-modal__panel--form-direct .aic-limit-modal__title {
  margin: 0 0 8px 0 !important;
}

.aic-chat .aic-limit-modal__panel--form-direct .aic-limit-modal__text {
  margin: 0 !important;
}

.aic-chat .aic-limit-modal__form-content {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #ffffff !important;
  overflow: visible !important;
}

.aic-chat .aic-limit-modal__form-content > * {
  margin-top: 0 !important;
}

.ed-post-content .aic-chat .aic-limit-modal--form-direct {
  margin: 0 !important;
  padding: 24px !important;
}

.ed-post-content .aic-chat .aic-limit-modal__panel--form-direct,
.ed-post-content .aic-chat .aic-limit-modal__form-content {
  margin: 0 !important;
  padding: 0 !important;
}

.ed-post-content .aic-chat .aic-limit-modal__form-header {
  margin: 0 !important;
  padding: 22px 48px 14px 22px !important;
}

@media (max-width: 700px) {
  .aic-chat .aic-limit-modal--form-direct {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: #ffffff !important;
  }

  .aic-chat .aic-limit-modal__panel--form-direct {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    justify-content: center !important;
    overflow: auto !important;
  }

  .aic-chat .aic-limit-modal__form-header {
    flex: 0 0 auto !important;
    padding: 20px 48px 12px 20px !important;
    border-bottom: 0 !important;
  }

  .aic-chat .aic-limit-modal__form-content {
    flex: 0 0 auto !important;
    overflow: visible !important;
  }

  .ed-post-content .aic-chat .aic-limit-modal--form-direct {
    padding: 0 !important;
  }

  .ed-post-content .aic-chat .aic-limit-modal__form-header {
    padding: 20px 48px 12px 20px !important;
  }
}

/* Elementor form rendered inside the Form limit modal.
 * Scoped to the chatbot modal only, so it does not affect Elementor forms elsewhere.
 */
.aic-chat .aic-limit-modal__form-content .elementor,
.aic-chat .aic-limit-modal__form-content .elementor-section,
.aic-chat .aic-limit-modal__form-content .elementor-container,
.aic-chat .aic-limit-modal__form-content .e-con,
.aic-chat .aic-limit-modal__form-content .e-con-inner,
.aic-chat .aic-limit-modal__form-content .elementor-widget-wrap,
.aic-chat .aic-limit-modal__form-content .elementor-widget,
.aic-chat .aic-limit-modal__form-content .elementor-widget-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-widget-form,
.aic-chat .aic-limit-modal__form-content form.elementor-form {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--aic-font) !important;
  color: var(--aic-text) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-form-fields-wrapper {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 22px !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-group,
.aic-chat .aic-limit-modal__form-content .elementor-column,
.aic-chat .aic-limit-modal__form-content .e-form__buttons {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-col-100 {
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-col-50 {
  flex: 1 1 calc(50% - 6px) !important;
  width: auto !important;
  max-width: calc(50% - 6px) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-label {
  display: block !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
  font-family: var(--aic-font) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: var(--aic-text) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-screen-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-textual,
.aic-chat .aic-limit-modal__form-content input.elementor-field,
.aic-chat .aic-limit-modal__form-content textarea.elementor-field,
.aic-chat .aic-limit-modal__form-content select.elementor-field {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid var(--aic-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  outline: none !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  color: var(--aic-text) !important;
  appearance: none;
}

.aic-chat .aic-limit-modal__form-content textarea.elementor-field {
  min-height: 110px !important;
  resize: vertical !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-textual::placeholder,
.aic-chat .aic-limit-modal__form-content input.elementor-field::placeholder,
.aic-chat .aic-limit-modal__form-content textarea.elementor-field::placeholder {
  color: rgba(17, 17, 17, 0.55) !important;
  opacity: 1 !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-textual:focus,
.aic-chat .aic-limit-modal__form-content input.elementor-field:focus,
.aic-chat .aic-limit-modal__form-content textarea.elementor-field:focus,
.aic-chat .aic-limit-modal__form-content select.elementor-field:focus {
  border-color: rgba(0, 0, 0, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-type-acceptance .elementor-field-subgroup,
.aic-chat .aic-limit-modal__form-content .elementor-field-type-checkbox .elementor-field-subgroup,
.aic-chat .aic-limit-modal__form-content .elementor-field-type-radio .elementor-field-subgroup {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option {
  display: flex !important;
  align-items: flex-start !important;
  gap: 9px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--aic-font) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  color: rgba(17, 17, 17, 0.72) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="checkbox"],
.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="radio"] {
  flex: 0 0 auto !important;
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 1px 0 0 0 !important;
  padding: 0 !important;
  border: 1px solid var(--aic-border) !important;
  border-radius: 4px !important;
  background: #ffffff !important;
  accent-color: var(--aic-user-bg);
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="radio"] {
  border-radius: 50% !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option label {
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--aic-font) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  color: rgba(17, 17, 17, 0.72) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option a {
  color: var(--aic-text) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

.aic-chat .aic-limit-modal__form-content .e-form__buttons,
.aic-chat .aic-limit-modal__form-content .elementor-field-type-submit {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-button,
.aic-chat .aic-limit-modal__form-content button.elementor-button,
.aic-chat .aic-limit-modal__form-content input[type="submit"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 11px 16px !important;
  border: 1px solid var(--aic-user-bg) !important;
  border-radius: 12px !important;
  background: var(--aic-user-bg) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: var(--aic-user-text) !important;
  text-align: center !important;
  text-decoration: none !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-button:hover,
.aic-chat .aic-limit-modal__form-content button.elementor-button:hover,
.aic-chat .aic-limit-modal__form-content input[type="submit"]:hover,
.aic-chat .aic-limit-modal__form-content .elementor-button:focus,
.aic-chat .aic-limit-modal__form-content button.elementor-button:focus,
.aic-chat .aic-limit-modal__form-content input[type="submit"]:focus {
  filter: brightness(0.92) !important;
  color: var(--aic-user-text) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-button-content-wrapper,
.aic-chat .aic-limit-modal__form-content .elementor-button-text {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-message,
.aic-chat .aic-limit-modal__form-content .elementor-form .elementor-message {
  box-sizing: border-box !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 12px 0 0 0 !important;
  padding: 11px 12px !important;
  border-radius: 12px !important;
  font-family: var(--aic-font) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-message-success {
  border: 1px solid rgba(0, 120, 60, 0.22) !important;
  background: rgba(0, 120, 60, 0.08) !important;
  color: #075f34 !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-message-danger,
.aic-chat .aic-limit-modal__form-content .elementor-error {
  border: 1px solid rgba(176, 0, 32, 0.2) !important;
  background: rgba(176, 0, 32, 0.06) !important;
  color: #b00020 !important;
}

@media (max-width: 520px) {
  .aic-chat .aic-limit-modal__form-header {
    padding: 18px 44px 12px 18px !important;
  }

  .aic-chat .aic-limit-modal__form-content .elementor-form-fields-wrapper {
    gap: 10px !important;
    padding: 18px !important;
  }

  .aic-chat .aic-limit-modal__form-content .elementor-col-50 {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* Stable Elementor form states inside the chatbot Form modal. */
.aic-chat .aic-limit-modal__form-content .elementor-message,
.aic-chat .aic-limit-modal__form-content .elementor-form .elementor-message {
  box-sizing: border-box !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 12px 0 0 0 !important;
  padding: 11px 12px !important;
  border-radius: 12px !important;
  font-family: var(--aic-font) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-message::before,
.aic-chat .aic-limit-modal__form-content .elementor-form .elementor-message::before {
  margin-right: 6px !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-button:disabled,
.aic-chat .aic-limit-modal__form-content button.elementor-button:disabled,
.aic-chat .aic-limit-modal__form-content input[type="submit"]:disabled,
.aic-chat .aic-limit-modal__form-content .elementor-button.elementor-disabled,
.aic-chat .aic-limit-modal__form-content button.elementor-button.elementor-disabled {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 11px 16px !important;
  border: 1px solid rgba(17, 17, 17, 0.38) !important;
  border-radius: 12px !important;
  background: rgba(17, 17, 17, 0.42) !important;
  box-shadow: none !important;
  cursor: wait !important;
  font-family: var(--aic-font) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  color: #ffffff !important;
  text-align: center !important;
  text-decoration: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-button:disabled *,
.aic-chat .aic-limit-modal__form-content button.elementor-button:disabled *,
.aic-chat .aic-limit-modal__form-content .elementor-button.elementor-disabled *,
.aic-chat .aic-limit-modal__form-content button.elementor-button.elementor-disabled * {
  color: inherit !important;
}

/* Visible checkbox/radio states for Elementor forms inside the chatbot Form modal. */
.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="checkbox"],
.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="radio"] {
  position: relative !important;
  display: inline-grid !important;
  place-items: center !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-color: #ffffff !important;
  cursor: pointer !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="checkbox"]:checked,
.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="radio"]:checked {
  border-color: var(--aic-user-bg) !important;
  background-color: var(--aic-user-bg) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="checkbox"]:checked::after {
  content: "" !important;
  width: 8px !important;
  height: 4px !important;
  margin-top: -1px !important;
  border-left: 2px solid #ffffff !important;
  border-bottom: 2px solid #ffffff !important;
  transform: rotate(-45deg) !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="radio"]:checked::after {
  content: "" !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="checkbox"]:focus-visible,
.aic-chat .aic-limit-modal__form-content .elementor-field-option input[type="radio"]:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08) !important;
}


/* Final responsive refinements — Elementor success message and mobile quick questions. */
.aic-chat .aic-limit-modal__form-content .elementor-message,
.aic-chat .aic-limit-modal__form-content .elementor-form .elementor-message {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-height: 44px !important;
  padding: 12px 14px !important;
}

.aic-chat .aic-limit-modal__form-content .elementor-message::before,
.aic-chat .aic-limit-modal__form-content .elementor-form .elementor-message::before {
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.aic-chat .aic-quick-questions,
.aic-chat .aic-quick-questions * {
  min-width: 0 !important;
}

.aic-chat button.aic-quick-question,
.aic-chat .aic-quick-question {
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

@media (max-width: 700px) {
  .aic-chat .aic-bubble__text {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .aic-chat .aic-quick-questions {
    width: 100% !important;
    max-width: 100% !important;
  }

  .aic-chat button.aic-quick-question,
  .aic-chat .aic-quick-question {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
}
