/* NEXUS Tech Solutions – FAQ chatbot v1 (matches css/style.css colours and fonts) */
.nxc {
  --nxc-ink: #0b1630;
  --nxc-ink-2: #334155;
  --nxc-muted: #64748b;
  --nxc-line: #e2e8f0;
  --nxc-bg-alt: #f4f7fb;
  --nxc-dark: #0a1530;
  --nxc-dark-2: #13244a;
  --nxc-cyan: #a8c3f0;
  --nxc-cyan-d: #2a55b0;
  --nxc-grad: linear-gradient(135deg, #3d6fd6 0%, #253966 100%);
  --nxc-wa: #128c7e;
  --nxc-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-family: var(--nxc-font);
  line-height: 1.5;
  color: var(--nxc-ink);
}
.nxc *, .nxc *::before, .nxc *::after { box-sizing: border-box; }
.nxc svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Floating bubble */
.nxc-bubble {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: 60px; height: 60px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: var(--nxc-grad);
  box-shadow: 0 10px 30px rgba(61, 111, 214, .35), 0 2px 6px rgba(15, 23, 42, .2);
  transition: transform .2s, box-shadow .2s;
}
.nxc-bubble:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(61, 111, 214, .45), 0 2px 6px rgba(15, 23, 42, .2); }
.nxc-bubble:focus-visible { outline: 3px solid #3d6fd6; outline-offset: 3px; }
.nxc-bubble svg { width: 28px; height: 28px; }
.nxc-bubble .nxc-bubble-x { display: none; }
.nxc-open .nxc-bubble > svg { display: none; }
.nxc-open .nxc-bubble .nxc-bubble-x { display: grid; }

/* Keep the site's "back to top" button above the bubble */
body.nxc-on .to-top { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); right: 23px; }

/* Panel */
.nxc-panel {
  position: fixed; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); z-index: 61;
  width: 380px; max-width: calc(100vw - 32px);
  height: 640px; max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--nxc-line); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
  animation: nxc-in .18s ease-out;
}
.nxc-panel[hidden] { display: none; }
@keyframes nxc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.nxc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--nxc-dark); color: #e2e8f0; }
.nxc-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--nxc-grad); color: #fff; font-weight: 800; letter-spacing: .04em; box-shadow: inset 0 0 0 2px rgba(168, 195, 240, .5); }
.nxc-titles { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.nxc-title { font-size: 1rem; font-weight: 800; color: #fff; letter-spacing: .01em; }
.nxc-sub { font-size: .75rem; color: var(--nxc-cyan); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nxc-wa, .nxc-close { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 0; cursor: pointer; background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nxc-wa { background: var(--nxc-wa); }
.nxc-wa:hover { filter: brightness(1.1); }
.nxc-close:hover { background: rgba(255, 255, 255, .16); }
.nxc-wa:focus-visible, .nxc-close:focus-visible { outline: 2px solid var(--nxc-cyan); outline-offset: 2px; }

.nxc-log { position: relative; flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--nxc-bg-alt); overscroll-behavior: contain; }
.nxc-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; word-wrap: break-word; overflow-wrap: anywhere; }
.nxc-bot { align-self: flex-start; background: #fff; color: var(--nxc-ink); border: 1px solid var(--nxc-line); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.nxc-user { align-self: flex-end; background: var(--nxc-grad); color: #fff; border-bottom-right-radius: 4px; }
.nxc-bot a { color: var(--nxc-cyan-d); font-weight: 600; }
.nxc-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.nxc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--nxc-muted); opacity: .4; animation: nxc-dot 1s infinite; }
.nxc-typing span:nth-child(2) { animation-delay: .15s; }
.nxc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes nxc-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.nxc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 10px; background: var(--nxc-bg-alt); border-top: 1px solid var(--nxc-line); }
.nxc-chips:empty { display: none; }
.nxc-chip {
  font: inherit; font-size: .8rem; font-weight: 600; line-height: 1.3; text-align: left;
  padding: 7px 11px; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: #fff; color: var(--nxc-cyan-d); border: 1px solid #c9d8f3;
  display: inline-flex; align-items: center; gap: 6px;
}
.nxc-chip:hover { background: #eef3fc; border-color: var(--nxc-cyan-d); }
.nxc-chip:focus-visible { outline: 2px solid #3d6fd6; outline-offset: 2px; }
.nxc-chip-human { background: var(--nxc-dark); color: #fff; border-color: var(--nxc-dark); }
.nxc-chip-human:hover { background: var(--nxc-dark-2); border-color: var(--nxc-dark-2); }
.nxc-chip-wa { background: var(--nxc-wa); color: #fff; border-color: var(--nxc-wa); }
.nxc-chip-wa:hover { background: #0f7a6e; border-color: #0f7a6e; }
.nxc-chip-wa svg { width: 16px; height: 16px; }

.nxc-form { position: relative; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--nxc-line); }
.nxc-input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; /* 16px = no zoom on iOS */
  padding: 10px 14px; border: 1px solid var(--nxc-line); border-radius: 999px; background: var(--nxc-bg-alt); color: var(--nxc-ink);
}
.nxc-input:focus { outline: none; border-color: #3d6fd6; box-shadow: 0 0 0 3px rgba(61, 111, 214, .18); background: #fff; }
.nxc-send { width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: #fff; background: var(--nxc-grad); }
.nxc-send svg { width: 20px; height: 20px; }
.nxc-send:focus-visible { outline: 3px solid #3d6fd6; outline-offset: 2px; }
/* honeypot – hidden from people, visible to naive bots */
.nxc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Phones: full-screen chat */
@media (max-width: 520px) {
  .nxc-panel { inset: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .nxc-open .nxc-bubble { display: none; }
  html.nxc-panel-open, html.nxc-panel-open body { overflow: hidden; }
  .nxc-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .nxc-panel, .nxc-typing span { animation: none; } .nxc-bubble { transition: none; } }
@media print { .nxc { display: none !important; } }
