/* Chat widget (js/chatbot.js). Moved from the old styles.css and mapped
   onto the new palette; the widget builds its own markup. */
#tg-chat-launcher, #tg-chat-window {
  --primary: #0B6E66;
  --primary-dark: #08534D;
  --primary-light: #E3F0EE;
  --accent: #0B6E66;
  --accent-dark: #08534D;
  --dark: #1E282D;
  --dark-2: #2B373D;
  --mid: #3A474D;
  --gray: #56646B;
  --light-gray: #C9D3CF;
  --off-white: #EEF2F0;
  --white: #FFFFFF;
  --font-body: "Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(30,40,45,.10);
  --shadow-md: 0 4px 16px rgba(30,40,45,.14);
  --shadow-lg: 0 18px 50px rgba(30,40,45,.25);
  --shadow-primary: 0 8px 26px rgba(11,110,102,.30);
  --transition: all .2s ease;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.3); }
}
#tg-chat-launcher {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
}
#tg-chat-btn {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(26,86,219,.4);
  transition: var(--transition);
  position: relative;
}
#tg-chat-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(26,86,219,.5); }
#tg-chat-btn svg { color: white; width: 26px; height: 26px; }
.chat-notif-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse 2s infinite;
}
#tg-chat-window {
  display: none;
  flex-direction: column;
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  width: 380px;
  height: 560px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
  z-index: 9998;
  border: 1px solid var(--light-gray);
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
#tg-chat-window.open { display: flex; }
.chat-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.chat-avatar {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.chat-header-text h4 { color: white; font-size: .95rem; margin: 0; }
.chat-header-text p { color: rgba(255,255,255,.75); font-size: .75rem; margin: 0; }
.chat-online {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 4px;
  animation: pulse 2s infinite;
}
.chat-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.chat-close:hover { background: rgba(255,255,255,.25); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--light-gray); border-radius: 4px; }
.msg {
  display: flex;
  gap: .5rem;
  max-width: 88%;
  animation: msgIn .25s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-bubble {
  padding: .65rem .95rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  line-height: 1.55;
  max-width: 100%;
}
.msg.bot .msg-bubble {
  background: var(--off-white);
  color: var(--dark);
  border-bottom-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  color: white;
  flex-shrink: 0;
  margin-top: auto;
}
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: .5rem .75rem;
  align-items: center;
}
.typing-dot {
  width: 7px; height: 7px;
  background: var(--gray);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}
.chat-suggestions {
  padding: .5rem 1.25rem;
  display: flex;
  gap: .4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent 100%);
  mask-image: linear-gradient(to right, #000 88%, transparent 100%);
  flex-shrink: 0;
  border-top: 1px solid var(--off-white);
}
.suggestion-chip {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 100px;
  padding: .3rem .85rem;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}
.suggestion-chip:hover { background: var(--primary); color: white; }
.chat-input-area {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1rem;
  border-top: 1px solid var(--light-gray);
  flex-shrink: 0;
}
#chat-input {
  flex: 1;
  border: 1.5px solid var(--light-gray);
  border-radius: 100px;
  padding: .55rem 1rem;
  font-family: var(--font-body);
  font-size: .875rem;
  color: var(--dark);
  outline: none;
  transition: var(--transition);
}
#chat-input:focus { border-color: var(--primary); }
#chat-send {
  width: 38px; height: 38px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
#chat-send:hover { background: var(--primary-dark); transform: scale(1.08); }
#chat-send svg { color: white; width: 16px; height: 16px; }
.chat-powered {
  text-align: center;
  font-size: .7rem;
  color: var(--gray);
  padding: .4rem 0;
  border-top: 1px solid var(--off-white);
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .grid-2, .grid-3  { grid-template-columns: 1fr; }
  .why-us-grid      { grid-template-columns: 1fr; }
  .about-story      { grid-template-columns: 1fr; }
  .contact-layout   { grid-template-columns: 1fr; }
  .tab-content.active{ grid-template-columns: 1fr; }
  .form-row         { grid-template-columns: 1fr; }
  .ai-use-cases     { grid-template-columns: 1fr; }
  .ai-services-grid { grid-template-columns: 1fr; }
  .values-grid        { grid-template-columns: 1fr; }
  .testimonials-grid  { grid-template-columns: 1fr; }
  .founder-spotlight  { grid-template-columns: 1fr; text-align: center; }
  .founder-photo-wrap { width: 180px; margin: 0 auto; }
  .founder-bio .team-tags { justify-content: center; }
  .footer-grid        { grid-template-columns: 1fr; gap: 2rem; }

  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: block; }
  .navbar { position: sticky; }

  .hero         { padding: 4rem 0 3.5rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  .hero-trust       { flex-direction: column; align-items: flex-start; }
  .hero-trust-items { flex-direction: column; gap: .5rem; }

  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .process-steps { grid-template-columns: 1fr; }

  #tg-chat-window {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 5.5rem;
    height: 500px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
.chat-suggestions::-webkit-scrollbar { display: none; }
#tg-chat-window.chat-started .chat-suggestions { display: none; }
