/* Arx Certa — website virtual assistant widget
   Same structure/UX as the MH Solicitors widget; Arx Certa dark-navy / blue-teal brand.
   Self-contained: does not depend on the site's CSS variables. */
.arx-chatbot {
  --arx-bg: #0f172a;            /* navy-900 panel */
  --arx-elevated: #1e293b;      /* navy-800 assistant bubble / header */
  --arx-accent: #3b82f6;        /* blue-500 */
  --arx-accent-hover: #60a5fa;  /* blue-400 */
  --arx-teal: #06b6d4;          /* teal-500 */
  --arx-text: rgba(255, 255, 255, 0.95);
  --arx-text-muted: rgba(255, 255, 255, 0.6);
  --arx-border: rgba(255, 255, 255, 0.1);
  --arx-border-accent: rgba(59, 130, 246, 0.32);
  --arx-gradient: linear-gradient(135deg, #3b82f6, #06b6d4);
  --arx-shadow: 0 20px 45px rgba(2, 6, 23, 0.55);
  --arx-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  font-family: var(--arx-font);
}

.arx-chatbot__launcher {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--arx-gradient);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.arx-chatbot__launcher:hover,
.arx-chatbot__launcher:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 16px 38px rgba(59, 130, 246, 0.6);
}

.arx-chatbot__launcher:focus-visible,
.arx-chatbot__close:focus-visible,
.arx-chatbot__send:focus-visible,
.arx-chatbot__input:focus-visible {
  outline: 2px solid var(--arx-accent-hover);
  outline-offset: 2px;
}

.arx-chatbot__launcher svg {
  width: 26px;
  height: 26px;
}

.arx-chatbot__panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: min(384px, calc(100vw - 32px));
  max-height: calc(100dvh - 28px);
  height: min(564px, calc(100dvh - 28px));
  background: var(--arx-bg);
  border-radius: 18px;
  border: 1px solid var(--arx-border);
  box-shadow: var(--arx-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.arx-chatbot__panel.is-open {
  display: flex;
}

.arx-chatbot__header {
  background: linear-gradient(120deg, #0b1220 0%, #14233f 100%);
  color: var(--arx-text);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--arx-border-accent);
}

.arx-chatbot__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.arx-chatbot__avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--arx-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 34px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.arx-chatbot__title-wrap {
  min-width: 0;
}

.arx-chatbot__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.arx-chatbot__subtitle {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--arx-accent-hover);
}

.arx-chatbot__close {
  border: 1px solid var(--arx-border-accent);
  background: rgba(255, 255, 255, 0.06);
  color: var(--arx-text);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

.arx-chatbot__close:hover {
  background: rgba(59, 130, 246, 0.2);
}

.arx-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.arx-chatbot__bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  line-height: 1.48;
  font-size: 0.94rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.arx-chatbot__bubble--assistant {
  align-self: flex-start;
  background: var(--arx-elevated);
  color: var(--arx-text);
  border: 1px solid var(--arx-border);
  border-top-left-radius: 6px;
}

.arx-chatbot__bubble--user {
  align-self: flex-end;
  background: var(--arx-accent);
  color: #ffffff;
  border-top-right-radius: 6px;
}

.arx-chatbot__typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 14px;
  border-top-left-radius: 6px;
  background: var(--arx-elevated);
  border: 1px solid var(--arx-border);
}

.arx-chatbot__typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--arx-accent-hover);
  opacity: 0.5;
  animation: arxChatTyping 1.2s infinite ease-in-out;
}

.arx-chatbot__typing-dot:nth-child(2) { animation-delay: 0.15s; }
.arx-chatbot__typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes arxChatTyping {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.arx-chatbot__composer {
  border-top: 1px solid var(--arx-border);
  background: #0b1220;
  padding: 10px 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.arx-chatbot__input {
  flex: 1;
  resize: none;
  border: 1px solid var(--arx-border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.4;
  min-height: 44px;
  max-height: 108px;
  background: #0f172a;
  color: var(--arx-text);
}

.arx-chatbot__input::placeholder { color: var(--arx-text-muted); }

.arx-chatbot__input:focus {
  border-color: var(--arx-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.arx-chatbot__send {
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--arx-gradient);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 44px;
  transition: filter 0.2s ease;
}

.arx-chatbot__send:hover:not(:disabled) { filter: brightness(1.08); }
.arx-chatbot__send:disabled { cursor: not-allowed; opacity: 0.5; }
.arx-chatbot__send svg { width: 20px; height: 20px; }

.arx-chatbot__disclaimer {
  margin: 0;
  font-size: 0.71rem;
  color: var(--arx-text-muted);
  text-align: center;
  padding: 0 12px 11px;
  background: #0b1220;
}

/* Quick-reply / suggestion chips */
.arx-chatbot__chips {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin-top: -2px;
}

.arx-chatbot__chip {
  border: 1px solid var(--arx-border-accent);
  background: rgba(59, 130, 246, 0.12);
  color: var(--arx-accent-hover);
  font: inherit;
  font-size: 0.83rem;
  line-height: 1.2;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.arx-chatbot__chip:hover {
  background: rgba(59, 130, 246, 0.24);
  transform: translateY(-1px);
}

.arx-chatbot__chip:focus-visible {
  outline: 2px solid var(--arx-accent-hover);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .arx-chatbot { right: 16px; bottom: 16px; }
  .arx-chatbot__panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 80px;
    top: 10px;
    height: auto;
    max-height: none;
    border-radius: 16px;
  }
  .arx-chatbot__messages { padding: 14px; }
  .arx-chatbot__launcher { width: 52px; height: 52px; }
  .arx-chatbot__launcher svg { width: 24px; height: 24px; }
}

/* Cookie-consent coexistence ------------------------------------------------
   The cookie banner (css/cookie-banner.css) is a full-width fixed bar at the
   bottom of the viewport (z-index 9999) shown until the visitor accepts or
   rejects. cookie-banner.js (and the inline <head> snippet for returning
   visitors) add `arxcerta-cookie-known` to <html> once a choice exists, which
   hides the banner. We gate the launcher on that same signal so the chat
   circle never sits underneath the consent bar on a first visit; it appears
   the moment the visitor actions the banner. */
html:not(.arxcerta-cookie-known) .arx-chatbot {
  display: none;
}
