/* AroaCMS online chat widget */
.aroa-chat { position: fixed; right: 22px; bottom: 22px; z-index: 2600; font-family: var(--font-family, inherit); }
/* Embedded mode: the launcher lives inside the site's existing contact bubble,
   so this wrapper only holds the panel and sits just above that bubble. */
.aroa-chat--embedded { bottom: 92px; z-index: 960; }
.aroa-chat__launcher {
  position: relative; width: 58px; height: 58px; border: 0; border-radius: 50%;
  background: var(--color-primary, #2563eb); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .28); transition: transform .18s, box-shadow .18s;
}
.aroa-chat__launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(15, 23, 42, .34); }
.aroa-chat__launcher-close { display: none; }
.aroa-chat.is-open .aroa-chat__launcher-open { display: none; }
.aroa-chat.is-open .aroa-chat__launcher-close { display: inline-flex; }
.aroa-chat__dot {
  position: absolute; top: 6px; inset-inline-end: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: #22c55e; border: 2px solid #fff;
}
.aroa-chat.is-open .aroa-chat__dot { display: none; }
.aroa-chat__panel {
  position: absolute; bottom: 72px; inset-inline-start: 0; width: 340px; max-width: calc(100vw - 36px);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 60px rgba(15, 23, 42, .3); display: flex; flex-direction: column;
  animation: chat-pop .2s cubic-bezier(.2, .9, .3, 1.1) both;
}
.aroa-chat__panel[hidden] { display: none; }
.aroa-chat--embedded .aroa-chat__panel { position: relative; bottom: auto; right: auto; inset-inline-start: auto; }
@keyframes chat-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.aroa-chat__head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: var(--color-primary, #2563eb); color: #fff;
}
.aroa-chat__head strong { display: block; font-size: .95rem; }
.aroa-chat__head small { display: block; font-size: .72rem; opacity: .85; }
.aroa-chat__avatar {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .18);
  display: inline-flex; align-items: center; justify-content: center; object-fit: cover; flex: 0 0 auto;
}
.aroa-chat__close { margin-inline-start: auto; background: rgba(255, 255, 255, .16); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.aroa-chat__body { padding: 14px; max-height: 330px; overflow-y: auto; background: #f8fafc; }
.aroa-chat__welcome { font-size: .85rem; line-height: 1.9; color: #475569; background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.aroa-chat__form { display: flex; flex-direction: column; gap: 8px; }
.aroa-chat__form input, .aroa-chat__form textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 10px;
  font-family: inherit; font-size: .86rem; background: #fff; resize: none;
}
.aroa-chat__form input:focus, .aroa-chat__form textarea:focus { outline: 2px solid color-mix(in srgb, var(--color-primary, #2563eb) 30%, #fff); border-color: var(--color-primary, #2563eb); }
.aroa-chat__error { margin: 4px 0 0; color: #b91c1c; font-size: .78rem; }
.aroa-chat__thread { display: flex; flex-direction: column; gap: 8px; }
.aroa-chat__msg { display: flex; flex-direction: column; max-width: 85%; }
.aroa-chat__msg-body { padding: 9px 12px; border-radius: 14px; font-size: .85rem; line-height: 1.8; }
.aroa-chat__msg--visitor { align-self: flex-end; align-items: flex-end; }
.aroa-chat__msg--visitor .aroa-chat__msg-body { background: var(--color-primary, #2563eb); color: #fff; border-end-end-radius: 4px; }
.aroa-chat__msg--admin .aroa-chat__msg-body, .aroa-chat__msg--ai .aroa-chat__msg-body { background: #fff; color: #0f172a; border: 1px solid #e2e8f0; border-end-start-radius: 4px; }
.aroa-chat__msg-time { font-size: .68rem; color: #94a3b8; margin-top: 3px; }
.aroa-chat__composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e2e8f0; background: #fff; }
.aroa-chat__composer input { flex: 1; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 999px; font-family: inherit; font-size: .85rem; }
.aroa-chat__composer button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--color-primary, #2563eb); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 480px) {
  .aroa-chat { right: 12px; bottom: 12px; }
  .aroa-chat--embedded { bottom: 84px; }
  .aroa-chat__panel { width: calc(100vw - 24px); bottom: 68px; }
  .aroa-chat--embedded .aroa-chat__panel { bottom: auto; }
}
