/* =============================================================
   TiCi Technologies — chat assistant widget
   Matches the site palette: navy #0b0820 / #14112b, purple #a680f1 / #7c4dff, lime #c8f560
   ============================================================= */
.tc-chat {
  --tc-chat-bg: #110e26;
  --tc-chat-panel: #14112b;
  --tc-chat-line: rgba(255, 255, 255, 0.1);
  --tc-chat-text: #ecebf5;
  --tc-chat-muted: rgba(255, 255, 255, 0.6);
  --tc-chat-accent: #a680f1;
  --tc-chat-accent-2: #7c4dff;
  --tc-chat-lime: #c8f560;
  font-family: inherit;
}

.tc-chat__launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--tc-chat-accent);
  background: linear-gradient(135deg, var(--tc-chat-accent-2), var(--tc-chat-accent));
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(124, 77, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}
.tc-chat__launcher:hover { transform: translateY(-2px) scale(1.04); }
.tc-chat__launcher:focus-visible { outline: 3px solid var(--tc-chat-lime); outline-offset: 3px; }
.tc-chat__icon-close { display: none; }
.tc-chat.is-open .tc-chat__icon-open { display: none; }
.tc-chat.is-open .tc-chat__icon-close { display: inline; }

/* WhatsApp float sits above the chat launcher */
.tc-wa-float { bottom: 92px !important; }

.tc-chat__teaser {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 999;
  max-width: 250px;
  padding: 12px 30px 12px 14px;
  border-radius: 14px 14px 4px 14px;
  background: #fff;
  color: #1c1f26;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.tc-chat__teaser-close {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}

.tc-chat__panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 1000;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: min(580px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: var(--tc-chat-bg);
  border: 1px solid rgba(166, 128, 241, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  color: var(--tc-chat-text);
}
.tc-chat__panel[hidden] { display: none; }

.tc-chat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  background: linear-gradient(135deg, #2a1b63, #14112b);
  border-bottom: 1px solid var(--tc-chat-line);
}
.tc-chat__avatar {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 245, 96, 0.14);
  color: var(--tc-chat-lime);
  font-size: 17px;
}
.tc-chat__title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tc-chat__title strong { color: #fff; font-size: 15px; font-weight: 600; }
.tc-chat__title span { color: var(--tc-chat-muted); font-size: 11.5px; }
.tc-chat__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
  margin-right: 3px;
}
.tc-chat__close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.tc-chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}
.tc-chat__msg { display: flex; }
.tc-chat__msg--user { justify-content: flex-end; }
.tc-chat__bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.tc-chat__msg--bot .tc-chat__bubble {
  background: var(--tc-chat-panel);
  border: 1px solid var(--tc-chat-line);
  border-bottom-left-radius: 4px;
}
.tc-chat__msg--user .tc-chat__bubble {
  background: linear-gradient(135deg, var(--tc-chat-accent-2), var(--tc-chat-accent));
  color: #fff;
  border-bottom-right-radius: 4px;
}

.tc-chat__links { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.tc-chat__links a,
.tc-chat__contact a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(166, 128, 241, 0.12);
  border: 1px solid rgba(166, 128, 241, 0.3);
  color: #d9ccff;
  font-size: 13px;
  text-decoration: none;
}
.tc-chat__links a:hover,
.tc-chat__contact a:hover { background: rgba(166, 128, 241, 0.22); color: #fff; }
.tc-chat__contact { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.tc-chat__contact .fa-whatsapp { color: #25d366; }

.tc-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 10px;
}
.tc-chat__quick:empty { display: none; }
.tc-chat__chip {
  border: 1px solid rgba(200, 245, 96, 0.45);
  background: transparent;
  color: var(--tc-chat-lime);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.tc-chat__chip:hover,
.tc-chat__chip:focus-visible { background: rgba(200, 245, 96, 0.12); outline: none; }

.tc-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--tc-chat-line);
  background: var(--tc-chat-panel);
}
.tc-chat__form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 14px;
  outline: none;
}
.tc-chat__form input:focus { border-color: var(--tc-chat-accent); }
.tc-chat__form input::placeholder { color: rgba(255, 255, 255, 0.35); }
.tc-chat__form button {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 10px;
  border: 0;
  background: linear-gradient(135deg, var(--tc-chat-accent-2), var(--tc-chat-accent));
  color: #fff;
  cursor: pointer;
}

/* typing dots */
.tc-chat__typing .tc-chat__bubble { display: flex; gap: 4px; padding: 13px 14px; }
.tc-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tc-chat-muted);
  animation: tcChatDot 1s infinite ease-in-out;
}
.tc-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.tc-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tcChatDot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- phones & tablets: sit above the quick-contact bar ---------- */
@media (max-width: 991px) {
  .tc-chat__launcher {
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    font-size: 21px;
  }
  .tc-chat__teaser { right: 14px; bottom: calc(138px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 575px) {
  .tc-chat__panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tc-chat.is-open .tc-chat__launcher { display: none; }
  .tc-chat__form input { font-size: 16px; } /* no iOS zoom */
}

@media (prefers-reduced-motion: reduce) {
  .tc-chat__launcher, .tc-chat__chip { transition: none; }
  .tc-chat__typing span { animation: none; opacity: 0.7; }
}
