/* CiSA Chat widget. All selectors are prefixed to avoid clashing with the theme. */
.cisa-chat {
  --cc-brand: #0170b9;
  --cc-brand-dark: #015a94;
  --cc-wa: #1fa855;
  --cc-bg: #ffffff;
  --cc-soft: #f2f6fa;
  --cc-text: #1f2a33;
  --cc-muted: #5f6b76;
  --cc-line: #dde5ec;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--cc-text);
}
.cisa-chat *, .cisa-chat *::before, .cisa-chat *::after { box-sizing: border-box; }
.cisa-chat svg { width: 20px; height: 20px; flex: none; }

.cisa-chat-launcher {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; padding: 12px 18px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--cc-brand); color: #fff;
  font: inherit; font-weight: 600;
  box-shadow: 0 6px 20px rgba(1, 112, 185, .35);
  transition: background .15s, transform .15s;
}
.cisa-chat-launcher:hover { background: var(--cc-brand-dark); transform: translateY(-1px); }
.cisa-chat.is-open .cisa-chat-launcher { display: none; }

.cisa-chat-panel {
  display: flex; flex-direction: column;
  width: 370px; height: min(600px, calc(100vh - 40px));
  background: var(--cc-bg); border-radius: 14px; overflow: hidden;
  box-shadow: 0 16px 48px rgba(16, 37, 56, .22);
}
.cisa-chat-panel[hidden] { display: none; }

.cisa-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--cc-brand); color: #fff;
}
.cisa-chat-head strong { display: block; font-size: 16px; }
.cisa-chat-head small { display: block; opacity: .85; font-size: 12px; }
.cisa-chat-close {
  border: 0; background: transparent; color: #fff; cursor: pointer;
  font-size: 26px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.cisa-chat-close:hover { background: rgba(255, 255, 255, .15); }

.cisa-chat-log {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--cc-soft);
}
.cisa-chat-msg { max-width: 88%; padding: 10px 13px; border-radius: 12px; word-wrap: break-word; }
.cisa-chat-msg p { margin: 0 0 6px; }
.cisa-chat-msg p:last-child { margin-bottom: 0; }
.cisa-chat-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.cisa-chat-msg a { color: var(--cc-brand); font-weight: 600; }
.cisa-chat-bot { align-self: flex-start; background: var(--cc-bg); border: 1px solid var(--cc-line); border-bottom-left-radius: 4px; }
.cisa-chat-user { align-self: flex-end; background: var(--cc-brand); color: #fff; border-bottom-right-radius: 4px; }

.cisa-chat-wa {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--cc-wa); color: #fff !important; text-decoration: none; font-weight: 600;
}
.cisa-chat-wa:hover { filter: brightness(.95); }

.cisa-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cisa-chat-chips button {
  border: 1px solid var(--cc-brand); background: var(--cc-bg); color: var(--cc-brand);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
}
.cisa-chat-chips button:hover { background: var(--cc-brand); color: #fff; }

.cisa-chat-typing { display: flex; gap: 4px; padding: 14px; }
.cisa-chat-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cc-muted);
  animation: cisa-chat-dot 1.2s infinite ease-in-out;
}
.cisa-chat-typing i:nth-child(2) { animation-delay: .15s; }
.cisa-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cisa-chat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.cisa-chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--cc-line); }
.cisa-chat-form textarea {
  flex: 1; resize: none; max-height: 120px; padding: 9px 12px;
  border: 1px solid var(--cc-line); border-radius: 10px; font: inherit; color: var(--cc-text); background: #fff;
}
.cisa-chat-form textarea:focus { outline: 2px solid var(--cc-brand); outline-offset: -1px; border-color: transparent; }
.cisa-chat-form button {
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: var(--cc-brand); color: #fff; cursor: pointer;
}
.cisa-chat-form button:disabled { opacity: .5; cursor: wait; }

.cisa-chat-foot { padding: 8px 14px 10px; font-size: 11.5px; color: var(--cc-muted); text-align: center; }
.cisa-chat-foot span { display: block; margin-top: 4px; }
.cisa-chat-wa-mini { display: inline-flex; align-items: center; gap: 4px; color: var(--cc-wa); font-weight: 600; text-decoration: none; font-size: 13px; }
.cisa-chat-wa-mini svg { width: 16px; height: 16px; }

.cisa-chat button:focus-visible, .cisa-chat a:focus-visible { outline: 2px solid var(--cc-brand); outline-offset: 2px; }

@media (max-width: 480px) {
  .cisa-chat { right: 12px; bottom: 12px; }
  .cisa-chat.is-open { inset: 0; }
  .cisa-chat.is-open .cisa-chat-panel { width: 100%; height: 100%; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cisa-chat-typing i { animation: none; }
  .cisa-chat-launcher { transition: none; }
}
