/* The Web M Technology website assistant (assets/js/webmbot.js), built from Nexron's Nexbot.
   WebM's palette: blue #015fc9, navy #16243d, cyan #0ce0ff. Everything is prefixed nb- so it never
   touches the site's own styles. */

.nb,
.nb * {
  box-sizing: border-box;
}

.nb {
  --nb-blue: #015fc9;
  --nb-navy: #16243d;
  --nb-cyan: #0ce0ff;
  --nb-ink: #16243d;
  --nb-muted: #5b6474;
  --nb-line: #e3eaf3;
  --nb-bg: #f6f9fd;
  --nb-gradient: linear-gradient(135deg, #1e7bf0 0%, #015fc9 55%, #16243d 100%);
  font-family: inherit;
}

/* ── Launcher: takes the old chat button's place under the WhatsApp button ── */
.nb-launcher {
  position: relative;
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  padding: 0;
  border: 0;
  border-radius: 50% !important;
  background: var(--nb-gradient) !important;
  color: #ffffff;
  box-shadow: 0 10px 24px -8px rgba(1, 95, 201, 0.6), 0 4px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
}

.nb-launcher:hover {
  transform: scale(1.08);
}

.nb-launcher:focus-visible,
.nb-icon-btn:focus-visible,
.nb-reply:focus-visible,
.nb-send:focus-visible,
.nb-input:focus-visible,
.nb-teaser-text:focus-visible {
  outline: 3px solid rgba(1, 95, 201, 0.45);
  outline-offset: 2px;
}

.nb-launcher-face {
  display: block;
  width: 49px;
  height: 49px;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ffffff, #d6e8fd);
}

.nb-launcher::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: nb-ring 5s ease-out infinite;
  pointer-events: none;
}

.nb-launcher[data-open]::after {
  animation: none;
}

.nb-launcher .nb-x {
  display: none;
}

.nb-launcher[data-open] .nb-launcher-face {
  display: none;
}

.nb-launcher[data-open] .nb-x {
  display: block;
}

.nb-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ef4444;
}

.nb-dock {
  position: fixed;
  right: 30px;
  bottom: 30px;
  /* Above the sticky header (991), below the phone menu drawer (999). */
  z-index: 995;
}

.scroll-to-top {
  bottom: 100px !important;
  right: 35px !important;
}

/* ── Teaser ── */
.nb-teaser {
  position: fixed;
  right: 30px;
  bottom: 100px;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: min(290px, calc(100vw - 40px));
  padding: 12px 10px 12px 14px;
  border: 1px solid var(--nb-line);
  border-radius: 16px 16px 4px 16px;
  background: #fff;
  box-shadow: 0 18px 40px -16px rgba(31, 20, 38, 0.35);
  animation: nb-rise 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nb-teaser-text {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  color: var(--nb-ink);
  cursor: pointer;
}

.nb-teaser-close {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50% !important;
  background: transparent;
  color: var(--nb-muted);
  cursor: pointer;
}

/* ── Panel ── */
.nb-backdrop {
  display: none;
}

.nb-panel {
  position: fixed;
  right: 30px;
  bottom: 100px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  width: 380px;
  height: min(620px, calc(100vh - 130px));
  overflow: hidden;
  border: 1px solid var(--nb-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 70px -24px rgba(31, 20, 38, 0.45);
  animation: nb-rise 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nb-panel[hidden] {
  display: none;
}

.nb-header {
  position: static !important;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 14px 16px;
  background: var(--nb-gradient) !important;
  box-shadow: none !important;
  color: #ffffff;
}

.nb-avatar {
  position: relative;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #fff, #d6e8fd);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.nb-online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border: 2px solid #015fc9;
  border-radius: 50%;
  background: #22c55e;
}

.nb-title {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.nb-title strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.nb-title span {
  font-size: 12px;
  opacity: 0.8;
}

.nb-icon-btn {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50% !important;
  background: transparent;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s;
}

.nb-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.nb-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Conversation ── */
.nb-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 12px;
  background: var(--nb-bg);
}

.nb-day {
  align-self: center;
  margin: 0 0 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eaf1fa;
  font-size: 11px;
  font-weight: 600;
  color: var(--nb-muted);
}

.nb-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.nb-row[data-from='user'] {
  justify-content: flex-end;
}

.nb-mark {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--nb-line);
  border-radius: 50%;
  background: #e8f1fd;
}

.nb-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px 16px 16px 4px;
  font-size: 14px;
  line-height: 1.5;
  animation: nb-pop 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nb-bubble p {
  margin: 0;
  overflow-wrap: anywhere;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.nb-bubble[data-from='bot'] {
  border: 1px solid var(--nb-line);
  background: #fff;
  color: var(--nb-ink);
}

.nb-bubble[data-from='user'] {
  border-radius: 16px 16px 4px 16px;
  background: var(--nb-blue);
  color: #ffffff;
  font-weight: 500;
}

.nb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--nb-blue);
  text-decoration: none;
}

.nb-link:hover {
  text-decoration: underline;
}

.nb-typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}

.nb-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aab6c6;
  animation: nb-blink-dot 1.2s infinite ease-in-out;
}

.nb-typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.nb-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

.nb-replies {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
  padding-left: 36px;
}

.nb-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1.5px solid #b9d4f5;
  border-radius: 999px !important;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  color: var(--nb-blue);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.nb-reply:hover {
  border-color: var(--nb-blue);
  background: var(--nb-blue);
  color: #ffffff;
}

.nb-reply svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: currentColor;
}

/* ── Composer ── */
.nb-composer {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--nb-line);
  background: #fff;
}

.nb-input-row {
  display: flex;
  gap: 8px;
}

.nb-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #d3deeb;
  border-radius: 999px !important;
  background: var(--nb-bg);
  font: inherit;
  font-size: 16px;
  color: var(--nb-ink);
  box-shadow: none;
}

.nb-input::placeholder {
  color: #8a94a6;
}

.nb-send {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50% !important;
  background: var(--nb-blue);
  color: #ffffff;
  cursor: pointer;
}

.nb-send:disabled {
  opacity: 0.4;
  cursor: default;
}

.nb-send svg {
  width: 17px;
  height: 17px;
}

.nb-error {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: #b91c1c;
}

.nb-privacy {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  color: var(--nb-muted);
}

/* ── Mascot (an original cartoon support agent) ── */
.nb-avatar-svg {
  display: block;
  overflow: visible;
}

.nb-skin { fill: #f3c7a1; }
.nb-skin-shade { fill: #e2ad84; }
.nb-skin-line { fill: none; stroke: #d39a70; stroke-width: 0.8; stroke-linecap: round; }
.nb-hair { fill: #2d211b; }
.nb-brow { fill: none; stroke: #2d211b; stroke-width: 1.4; stroke-linecap: round; }
.nb-eye { fill: #1f2430; }
.nb-glint { fill: #fff; }
.nb-blush { fill: #f08a8a; opacity: 0.35; }
.nb-smile { fill: none; stroke: #8a3b33; stroke-width: 1.6; stroke-linecap: round; }
.nb-mouth { fill: #8a3b33; opacity: 0; transform-box: fill-box; transform-origin: center; }
.nb-shirt, .nb-sleeve { fill: #16243d; }
.nb-collar { fill: #fff; }
.nb-band, .nb-boom { fill: none; stroke: #262b36; stroke-width: 2.2; stroke-linecap: round; }
.nb-cup { fill: #0ce0ff; stroke: #262b36; stroke-width: 1.2; }
.nb-mic { fill: #262b36; }

.nb-eyes { transform-box: fill-box; transform-origin: center; animation: nb-blink 4.6s infinite; }
.nb-body { animation: nb-breathe 3.4s ease-in-out infinite; }
.nb-head { transform-box: view-box; transform-origin: 32px 44px; animation: nb-tilt 6.8s ease-in-out infinite; }
.nb-hand { opacity: 0; transform: translateY(16px); transition: opacity 0.24s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1); }
.nb-avatar-svg[data-wave] .nb-hand { opacity: 1; transform: none; }
.nb-avatar-svg[data-wave] .nb-palm { transform-box: view-box; transform-origin: 52px 52px; animation: nb-wave 5s ease-in-out infinite; }
.nb-avatar-svg[data-talking] .nb-smile { opacity: 0; }
.nb-avatar-svg[data-talking] .nb-mouth { opacity: 1; animation: nb-talk 0.42s ease-in-out infinite alternate; }

@keyframes nb-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes nb-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.8px); } }
@keyframes nb-tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 60% { transform: rotate(2deg); } }
@keyframes nb-wave { 0%, 40%, 100% { transform: rotate(0); } 6%, 18%, 30% { transform: rotate(-16deg); } 12%, 24%, 36% { transform: rotate(14deg); } }
@keyframes nb-talk { from { transform: scaleY(0.35); } to { transform: scaleY(1.1); } }
@keyframes nb-ring { 0%, 60% { box-shadow: 0 0 0 0 rgba(1, 95, 201, 0.5); } 85%, 100% { box-shadow: 0 0 0 14px rgba(1, 95, 201, 0); } }
@keyframes nb-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes nb-pop { from { opacity: 0; transform: translateY(4px); } }
@keyframes nb-blink-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@keyframes nb-fade { from { opacity: 0; } }

/* Phones: a floating card over a light dim (the site stays in view), sitting on the keyboard. */
@media (max-width: 768px) {
  .nb-launcher {
    width: 48px;
    height: 48px;
  }

  .nb-launcher-face {
    width: 43px;
    height: 43px;
  }

  .nb-launcher[data-open] {
    visibility: hidden;
  }

  .nb-dock {
    right: 20px;
    bottom: 20px;
  }

  .scroll-to-top {
    bottom: 80px !important;
    right: 24px !important;
  }

  .nb-teaser {
    right: 20px;
    bottom: 80px;
  }

  .nb-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: block;
    background: rgba(10, 20, 40, 0.4);
    touch-action: none;
    animation: nb-fade 0.2s ease both;
  }

  .nb-backdrop[hidden] {
    display: none;
  }

  .nb-panel {
    right: 10px;
    bottom: calc(var(--nb-keyboard, 0px) + 10px);
    left: 10px;
    width: auto;
    height: min(600px, calc(var(--nb-viewport, 100vh) - 96px));
    border-radius: 18px;
    transition: height 0.16s ease, bottom 0.16s ease;
  }

  .nb-panel[data-keyboard] {
    bottom: calc(var(--nb-keyboard, 0px) + 8px);
    height: calc(var(--nb-viewport, 100vh) - 24px);
  }

  .nb-panel[data-keyboard] .nb-privacy {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb-panel,
  .nb-teaser,
  .nb-bubble,
  .nb-typing i,
  .nb-launcher::after,
  .nb-eyes,
  .nb-body,
  .nb-head,
  .nb-avatar-svg[data-wave] .nb-palm,
  .nb-avatar-svg[data-talking] .nb-mouth,
  .nb-backdrop {
    animation: none;
  }

  .nb-panel,
  .nb-hand {
    transition: none;
  }
}
