/* Cogxim chat assistant (assets/js/chat.js). Every class is .cxc-* so nothing clashes with the site. */
.cxc-root {
  --cxc-navy: #0B468A;
  --cxc-blue: #0051A2;
  --cxc-sky: #006BA6;
  --cxc-ink: #1D1D1F;
  --cxc-graphite: #6E6E73;
  --cxc-cloud: #F5F5F7;
  --cxc-line: #D2D2D7;
  --cxc-tint: #EAF1FA;
  --cxc-err: #D93025;
  --cxc-wa: #1A8D4A;
  --cxc-ease: cubic-bezier(.2, .8, .2, 1);
  --cxc-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cxc-gap: 24px;
  --cxc-bottom: 24px;
  --cxc-size: 60px;
  font-family: var(--font, var(--cxc-font));
  color: var(--cxc-ink);
  -webkit-font-smoothing: antialiased;
}
.cxc-root *, .cxc-root *::before, .cxc-root *::after { box-sizing: border-box; }
.cxc-root svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:where(.cxc-root) button, :where(.cxc-root) input, :where(.cxc-root) textarea { font-family: inherit; color: inherit; }
.cxc-root :focus-visible { outline: 3px solid var(--cxc-sky); outline-offset: 2px; }
.cxc-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Launcher: bottom right. The back-to-top button (.totop) sits above it at bottom 104px on desktop. */
.cxc-launcher {
  position: fixed; right: var(--cxc-gap); bottom: var(--cxc-bottom); z-index: 58;
  width: var(--cxc-size); height: var(--cxc-size); padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--cxc-blue), var(--cxc-navy));
  box-shadow: 0 1px 2px rgba(11, 70, 138, .2), 0 10px 28px rgba(11, 70, 138, .32);
  opacity: 0; transform: translateY(16px) scale(.8); visibility: hidden;
  transition: opacity .45s var(--cxc-ease), transform .45s var(--cxc-ease), visibility .45s, box-shadow .2s, bottom .4s var(--cxc-ease);
  -webkit-tap-highlight-color: transparent;
}
.cxc-root.is-in .cxc-launcher { opacity: 1; transform: none; visibility: visible; }
.cxc-launcher:hover { box-shadow: 0 1px 2px rgba(11, 70, 138, .2), 0 14px 34px rgba(11, 70, 138, .42); }
.cxc-launcher:active { transform: scale(.94); }
.cxc-launcher svg { width: 28px; height: 28px; }
.cxc-launcher-icon { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity .25s, transform .35s var(--cxc-ease); }
.cxc-launcher-icon--close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.cxc-root.is-open .cxc-launcher-icon--chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.cxc-root.is-open .cxc-launcher-icon--close { opacity: 1; transform: none; }
.cxc-launcher::after {
  /* one soft pulse when it first appears */
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--cxc-blue); opacity: 0; pointer-events: none;
}
.cxc-root.is-in:not(.is-open) .cxc-launcher::after { animation: cxc-pulse 2.4s var(--cxc-ease) .6s 2; }
@keyframes cxc-pulse { 0% { opacity: .5; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.45); } }

/* Greeting nudge */
.cxc-nudge {
  position: fixed; right: var(--cxc-gap); bottom: calc(var(--cxc-bottom) + var(--cxc-size) + 14px); z-index: 58;
  display: none; align-items: flex-start; gap: 4px; max-width: 280px; padding: 6px 6px 6px 16px;
  background: #fff; border-radius: 18px 18px 6px 18px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 12px 32px rgba(11, 70, 138, .18);
  animation: cxc-rise .45s var(--cxc-ease);
}
.cxc-root.has-nudge:not(.is-open) .cxc-nudge { display: flex; }
.cxc-nudge-text { flex: 1; min-height: 44px; padding: 8px 0; border: 0; background: none; text-align: left; font-size: 15px; line-height: 1.35; cursor: pointer; }
.cxc-nudge-text strong { color: var(--cxc-navy); }
.cxc-nudge-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--cxc-graphite); cursor: pointer; display: grid; place-items: center; }
.cxc-nudge-x svg { width: 18px; height: 18px; }
.cxc-nudge-x:hover { background: var(--cxc-cloud); }
@keyframes cxc-rise { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* Panel: a 380 x 600 card on desktop, a full-screen sheet on mobile */
.cxc-panel {
  position: fixed; right: var(--cxc-gap); bottom: calc(var(--cxc-bottom) + var(--cxc-size) + 16px); z-index: 70;
  width: 380px; height: 600px; max-height: calc(100vh - var(--cxc-bottom) - var(--cxc-size) - 40px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 24px 64px rgba(11, 70, 138, .24);
  opacity: 0; transform: translateY(16px) scale(.97); transform-origin: bottom right;
  transition: opacity .22s var(--cxc-ease), transform .3s var(--cxc-ease);
}
.cxc-panel[hidden] { display: none; }
.cxc-root.is-open .cxc-panel { opacity: 1; transform: none; }

.cxc-head {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--cxc-navy), var(--cxc-blue) 70%, var(--cxc-sky));
}
.cxc-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 18px; color: var(--cxc-navy); background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}
.cxc-head-text { flex: 1; min-width: 0; }
.cxc-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: #fff; }
.cxc-sub { margin: 2px 0 0; font-size: 13px; line-height: 1.3; color: rgba(255, 255, 255, .85); display: flex; align-items: center; gap: 6px; }
.cxc-dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 2px rgba(61, 220, 132, .3); }
.cxc-icon-btn {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
  display: grid; place-items: center; transition: background .15s;
}
.cxc-icon-btn:hover { background: rgba(255, 255, 255, .16); }
.cxc-icon-btn svg { width: 20px; height: 20px; }
.cxc-root .cxc-icon-btn:focus-visible { outline-color: #fff; }

/* Conversation */
.cxc-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px;
  display: flex; flex-direction: column; gap: 10px; background: #fff; scroll-behavior: smooth;
}
.cxc-log:focus { outline: none; }
.cxc-msg { display: flex; max-width: 100%; }
.cxc-msg--user { justify-content: flex-end; }
.cxc-msg.is-new { animation: cxc-in .3s var(--cxc-ease); }
@keyframes cxc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cxc-bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45;
  overflow-wrap: anywhere; word-break: normal;
}
.cxc-msg--bot .cxc-bubble { background: var(--cxc-cloud); color: var(--cxc-ink); border-bottom-left-radius: 6px; }
.cxc-msg--user .cxc-bubble { background: var(--cxc-blue); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.cxc-msg--error .cxc-bubble { background: #FDECEA; color: #7A1C14; }
.cxc-bubble p { margin: 0; }
.cxc-bubble p + p, .cxc-bubble ul + p, .cxc-bubble ol + p, .cxc-bubble p + ul, .cxc-bubble p + ol { margin-top: 4px; }
.cxc-bubble .cxc-gap { display: block; height: 6px; }
.cxc-bubble ul, .cxc-bubble ol { margin: 2px 0; padding-left: 20px; }
.cxc-bubble ul { list-style: disc; }
.cxc-bubble ol { list-style: decimal; }
.cxc-bubble li { margin: 2px 0; }
.cxc-bubble li::marker { color: var(--cxc-blue); }
.cxc-bubble strong { font-weight: 600; }
.cxc-bubble a { color: var(--cxc-blue); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.cxc-msg--user .cxc-bubble a { color: #fff; }

.cxc-typing .cxc-bubble { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.cxc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--cxc-graphite); opacity: .35; animation: cxc-dot 1.2s infinite ease-in-out; }
.cxc-typing i:nth-child(3) { animation-delay: .15s; }
.cxc-typing i:nth-child(4) { animation-delay: .3s; }
@keyframes cxc-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* Quick replies */
.cxc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 4px; }
.cxc-chip {
  min-height: 40px; padding: 8px 14px; border: 1px solid rgba(0, 81, 162, .28); border-radius: 980px; cursor: pointer;
  background: #fff; color: var(--cxc-blue); font-size: 14px; font-weight: 500; line-height: 1.2; text-align: left;
  transition: background .15s, border-color .15s, transform .15s;
}
.cxc-chip:hover { background: var(--cxc-tint); border-color: var(--cxc-blue); }
.cxc-chip:active { transform: scale(.97); }
.cxc-chip--wa { color: var(--cxc-wa); border-color: rgba(26, 141, 74, .35); }
.cxc-chip--wa:hover { background: #E9F7EF; border-color: var(--cxc-wa); }
@media (pointer: coarse) { .cxc-chip { min-height: 44px; } }

/* Inline lead form */
.cxc-msg--card { display: block; }
.cxc-lead {
  margin: 0; padding: 16px; border-radius: 18px; background: #fff;
  box-shadow: 0 0 0 1px var(--cxc-line), 0 6px 18px rgba(11, 70, 138, .08);
}
.cxc-lead-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--cxc-navy); }
.cxc-lead-sub { margin: 2px 0 12px; font-size: 14px; line-height: 1.4; color: var(--cxc-graphite); }
.cxc-field { margin: 0 0 10px; }
.cxc-field label, .cxc-interests legend { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--cxc-ink); }
.cxc-field label span { font-weight: 400; color: var(--cxc-graphite); }
.cxc-field input {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--cxc-line); border-radius: 12px; background: #fff;
  font: inherit; font-size: 16px; color: var(--cxc-ink); transition: border-color .15s, box-shadow .15s;
}
.cxc-field input:focus { outline: none; border-color: var(--cxc-blue); box-shadow: 0 0 0 3px rgba(0, 81, 162, .18); }
.cxc-field input[aria-invalid="true"] { border-color: var(--cxc-err); box-shadow: 0 0 0 3px rgba(217, 48, 37, .14); }
.cxc-interests { margin: 4px 0 10px; padding: 0; border: 0; min-width: 0; }
.cxc-interest-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 148px; overflow-y: auto; padding: 2px; }
.cxc-interest {
  min-height: 36px; padding: 6px 12px; border: 1px solid var(--cxc-line); border-radius: 980px; background: #fff; cursor: pointer;
  font-size: 13px; line-height: 1.2; color: var(--cxc-ink); transition: background .15s, border-color .15s, color .15s;
}
.cxc-interest:hover { border-color: var(--cxc-blue); }
.cxc-interest[aria-pressed="true"] { background: var(--cxc-blue); border-color: var(--cxc-blue); color: #fff; }
.cxc-interest[aria-pressed="true"]::before { content: "\2713\00a0"; }
@media (pointer: coarse) { .cxc-interest { min-height: 44px; } }
.cxc-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cxc-lead-error { margin: 0 0 8px; font-size: 13px; color: var(--cxc-err); }
.cxc-lead-error:empty { display: none; }
.cxc-lead-submit {
  width: 100%; min-height: 46px; border: 0; border-radius: 980px; cursor: pointer;
  background: var(--cxc-blue); color: #fff !important; font-size: 15px; font-weight: 600; transition: background .15s, transform .15s;
}
.cxc-lead-submit:hover { background: var(--cxc-navy); }
.cxc-lead-submit:active { transform: scale(.98); }
.cxc-lead-submit:disabled { opacity: .7; cursor: default; }
.cxc-lead-note { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--cxc-graphite); }
.cxc-lead-note a { color: var(--cxc-blue); }

/* Footer: handoff, composer, privacy */
.cxc-foot { flex: none; padding: 8px 12px 10px; border-top: 1px solid rgba(0, 0, 0, .06); background: #fff; }
.cxc-handoff { display: flex; gap: 8px; margin: 0 0 8px; }
.cxc-handoff:empty { display: none; }
.cxc-handoff-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 980px; background: var(--cxc-cloud); color: var(--cxc-navy); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background .15s;
}
.cxc-handoff-btn:hover { background: var(--cxc-tint); text-decoration: none; }
.cxc-handoff-btn svg { width: 18px; height: 18px; }
.cxc-handoff-btn--wa { color: var(--cxc-wa); }
.cxc-handoff-btn--wa:hover { background: #E9F7EF; }
@media (pointer: coarse) { .cxc-handoff-btn { min-height: 44px; } }
.cxc-compose {
  display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 4px 4px 4px 14px;
  border: 1px solid var(--cxc-line); border-radius: 24px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.cxc-compose:focus-within { border-color: var(--cxc-blue); box-shadow: 0 0 0 3px rgba(0, 81, 162, .15); }
.cxc-input {
  flex: 1; min-width: 0; max-height: 120px; margin: 0; padding: 10px 0; border: 0; outline: none; resize: none; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--cxc-ink);
}
.cxc-input::placeholder { color: #8E8E93; }
.cxc-root .cxc-input:focus-visible { outline: none; }
.cxc-send {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  background: var(--cxc-blue); color: #fff !important; transition: background .15s, transform .15s, opacity .15s;
}
.cxc-send:hover { background: var(--cxc-navy); }
.cxc-send:active { transform: scale(.92); }
.cxc-send:disabled { opacity: .5; cursor: default; }
.cxc-send svg { width: 20px; height: 20px; stroke-width: 2.2; }
.cxc-privacy { margin: 6px 4px 0; font-size: 11.5px; line-height: 1.4; color: var(--cxc-graphite); text-align: center; }
.cxc-privacy a { color: inherit; text-decoration: underline; }

/* Hide behind the site's mobile menu */
body.no-scroll .cxc-launcher, body.no-scroll .cxc-nudge { opacity: 0 !important; visibility: hidden !important; }

/* Mobile: sit above the dock (cogxim.css shows it at <= 760px, z-index 60); the back-to-top button moves to the left there. */
@media (max-width: 760px) {
  .cxc-root { --cxc-gap: 16px; --cxc-size: 56px; --cxc-bottom: calc(var(--dock-h, 64px) + 24px + env(safe-area-inset-bottom)); }
  /* When the dock slides away over the demo form, drop down with it. */
  body.demo-visible:not(.no-scroll) .cxc-root { --cxc-bottom: calc(16px + env(safe-area-inset-bottom)); }
  /* The cookie banner sits above the dock until the visitor chooses. */
  body.has-cookie-banner .cxc-launcher, body.has-cookie-banner .cxc-nudge { opacity: 0 !important; visibility: hidden !important; }
  .cxc-nudge { max-width: calc(100vw - 32px); }

  .cxc-panel {
    inset: 0; right: 0; bottom: 0; z-index: 1000; width: auto; height: 100%; height: 100dvh; max-height: none;
    border-radius: 0; box-shadow: none; transform: translateY(24px); transform-origin: bottom center;
  }
  .cxc-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .cxc-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .cxc-bubble { max-width: 88%; }
  .cxc-root.is-open .cxc-launcher { opacity: 0; visibility: hidden; }
}
html.cxc-lock, html.cxc-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .cxc-root *, .cxc-root *::before, .cxc-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print { .cxc-root { display: none !important; } }
