/* ── Trust AI Chat Widget ── */

/* ── Fixed bottom-right FAB group (scroll-top + chat) ── */
.tw-fab-group {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 90000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tw-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(5, 0, 255, 0.13);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(5, 0, 255, 0.10);
  color: #1d2b62;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tw-fab-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(5, 0, 255, 0.16);
  background: #fff;
}
.tw-fab-btn:active {
  transform: translateY(0) scale(0.94);
}

/* Scroll-top: hidden until user scrolls */
.tw-fab-btn--top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.22s, visibility 0.22s, transform 0.22s ease, box-shadow 0.18s;
}
.tw-fab-btn--top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.tw-fab-btn--top.is-visible:hover {
  transform: translateY(-2px);
}
.tw-fab-btn--top.is-visible:active {
  transform: scale(0.94);
}

@keyframes twchat-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(1.25); }
}

/* ── Chat panel (offset left of FAB column: scroll-top + chat) ── */
.tw-chat-panel {
  --tw-chat-fab-w: 52px;
  --tw-chat-fab-gap: 16px;
  --tw-chat-edge: 24px;
  position: fixed;
  bottom: 96px;
  right: calc(var(--tw-chat-edge) + var(--tw-chat-fab-w) + var(--tw-chat-fab-gap));
  z-index: 89999;
  width: 380px;
  max-width: calc(100vw - var(--tw-chat-edge) * 2 - var(--tw-chat-fab-w) - var(--tw-chat-fab-gap));
  height: 540px;
  max-height: calc(100svh - 100px);
  border-radius: 24px;
  background: #fff;
  box-shadow:
    0 24px 80px rgba(5, 0, 255, 0.16),
    0 0 0 1px rgba(5, 0, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  transition:
    opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.25s;
}
.tw-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

/* Panel header */
.tw-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
  background: linear-gradient(135deg, #0500ff 0%, #0094ff 100%);
  flex-shrink: 0;
}
.tw-chat-head-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tw-chat-head-info { flex: 1; min-width: 0; }
.tw-chat-head-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.tw-chat-head-status {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.tw-chat-head-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #48e6c4;
  display: inline-block;
  animation: twchat-pulse 2s infinite;
}
.tw-chat-head-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.tw-chat-head-close:hover { background: rgba(255,255,255,0.28); }

/* Quick chips */
.tw-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid #f1f5f9;
}
.tw-chat-chip {
  white-space: nowrap;
  padding: 8px 16px;
  min-height: 36px;
  border-radius: 999px;
  border: 1.5px solid rgba(5, 0, 255, 0.22);
  background: rgba(5, 0, 255, 0.05);
  color: #0500ff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  font-family: inherit;
  line-height: 1;
  display: flex;
  align-items: center;
}
.tw-chat-chip:hover,
.tw-chat-chip:focus-visible {
  background: rgba(5, 0, 255, 0.12);
  border-color: rgba(5, 0, 255, 0.45);
  outline: none;
}
.tw-chat-chip:active {
  transform: scale(0.96);
  background: rgba(5, 0, 255, 0.18);
}

/* Messages area */
.tw-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.tw-chat-messages::-webkit-scrollbar { width: 4px; }
.tw-chat-messages::-webkit-scrollbar-track { background: transparent; }
.tw-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(5,0,255,0.15);
  border-radius: 4px;
}

/* Message bubble */
.tw-chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
}
.tw-chat-msg--bot { flex-direction: row; }
.tw-chat-msg--user { flex-direction: row-reverse; }

.tw-chat-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0500ff, #0094ff);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tw-chat-msg--user .tw-chat-msg-avatar {
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.tw-chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.tw-chat-msg--bot .tw-chat-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
}
.tw-chat-msg--user .tw-chat-bubble {
  background: #0500ff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.tw-chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.tw-chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: twchat-typing 1.4s infinite;
}
.tw-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.tw-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes twchat-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* Input area */
.tw-chat-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fff;
}
.tw-chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 96px;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 14px;
  color: #0f172a;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
  line-height: 1.4;
  overflow-y: auto;
}
.tw-chat-input:focus { border-color: rgba(5,0,255,0.4); background: #fff; }
.tw-chat-input::placeholder { color: #94a3b8; }

.tw-chat-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: #0500ff;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tw-chat-send:hover { opacity: 0.85; transform: scale(1.07); }
.tw-chat-send:active { transform: scale(0.93); }
.tw-chat-send:disabled { opacity: 0.35; cursor: default; transform: none; }

/* ── Mobile: panel slides up from bottom, FAB group above nav ── */
@media (max-width: 640px) {
  /* On mobile the bottom nav is ~64px tall, push group above it */
  .tw-fab-group {
    bottom: 80px;
    right: 16px;
    gap: 8px;
  }
  /* Hide chat FAB on mobile — the bottom nav already has a chat button */
  .tw-fab-btn--chat {
    display: none;
  }
  .tw-fab-btn {
    width: 48px;
    height: 48px;
  }
  .tw-chat-panel {
    right: 0; left: 0; bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 80svh;
    max-height: 80svh;
    border-radius: 20px 20px 0 0;
    transform-origin: bottom center;
  }
  .tw-chat-chips {
    padding: 10px 12px 12px;
    gap: 7px;
  }
  .tw-chat-chip {
    font-size: 12.5px;
    padding: 9px 15px;
    min-height: 38px;
  }
  .tw-chat-input {
    font-size: 16px;
    min-height: 44px;
  }
  .tw-chat-send {
    width: 44px; height: 44px;
  }
  .tw-chat-footer {
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* Hero hero-image.png — appended last so size + float aren’t overridden */
@keyframes tw-hero-float-y {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -18px, 0); }
}
.LandingPage_page__Py6p3 .HeroSection_media__aqBSh > .tw-hero-float-wrap {
  position: relative;
  display: block;
  width: 50%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  animation: tw-hero-float-y 3.2s ease-in-out infinite;
  will-change: transform;
}
.LandingPage_page__Py6p3 .HeroSection_media__aqBSh > .tw-hero-float-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  .LandingPage_page__Py6p3 .HeroSection_media__aqBSh > .tw-hero-float-wrap {
    animation: none;
  }
}
