/* ═══ FAQ Chatbot Widget (landing /home) ═══ */

.faq-chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  font-family:
    'DM Sans',
    system-ui,
    -apple-system,
    sans-serif;
}

/* ── Launcher button ── */
.faq-chatbot-launcher {
  width: 58px;
  height: 58px;
  border: 1px solid var(--border-b, rgba(37, 99, 235, 0.18));
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--blue, #2563eb),
    var(--blue-d, #1d4ed8)
  );
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.faq-chatbot-launcher:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.faq-chatbot-launcher svg {
  width: 26px;
  height: 26px;
}

.faq-chatbot-launcher .icon-close,
.faq-chatbot.open .faq-chatbot-launcher .icon-chat {
  display: none;
}

.faq-chatbot.open .faq-chatbot-launcher .icon-close {
  display: block;
}

/* ── Panel ── */
.faq-chatbot-panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 372px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: var(--r, 16px);
  background: var(--navy-2, #111829);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.faq-chatbot.open .faq-chatbot-panel {
  display: flex;
  animation: faq-chatbot-in 0.22s ease-out;
}

@keyframes faq-chatbot-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Header ── */
.faq-chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(
    135deg,
    var(--navy-3, #18213a),
    var(--navy-4, #1c2540)
  );
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.07));
}

.faq-chatbot-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--blue-p, rgba(37, 99, 235, 0.1));
  border: 1px solid var(--border-b, rgba(37, 99, 235, 0.18));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-l, #60a5fa);
}

.faq-chatbot-avatar svg {
  width: 20px;
  height: 20px;
}

.faq-chatbot-header-info {
  min-width: 0;
}

.faq-chatbot-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.faq-chatbot-status {
  color: var(--text-m, #9db1ca);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.faq-chatbot-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green, #10b981);
}

/* ── Messages area ── */
.faq-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-5, #222e50) transparent;
}

.faq-chatbot-msg {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.faq-chatbot-msg.bot {
  align-self: flex-start;
  background: var(--navy-3, #18213a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: 14px 14px 14px 4px;
  color: var(--text, #d0c8bc);
}

.faq-chatbot-msg.bot strong {
  color: #fff;
}

.faq-chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(
    135deg,
    var(--blue, #2563eb),
    var(--blue-d, #1d4ed8)
  );
  border-radius: 14px 14px 4px 14px;
  color: #fff;
}

/* Typing indicator */
.faq-chatbot-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 13px 16px;
  background: var(--navy-3, #18213a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: 14px 14px 14px 4px;
}

.faq-chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-d, #7288a6);
  animation: faq-chatbot-blink 1.2s infinite;
}

.faq-chatbot-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.faq-chatbot-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes faq-chatbot-blink {
  0%,
  60%,
  100% {
    opacity: 0.3;
  }

  30% {
    opacity: 1;
  }
}

/* ── Suggestion chips ── */
.faq-chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  max-width: 95%;
}

.faq-chatbot-chip {
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--blue-l, #60a5fa);
  background: var(--blue-p, rgba(37, 99, 235, 0.1));
  border: 1px solid var(--border-b, rgba(37, 99, 235, 0.18));
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
  text-align: left;
}

.faq-chatbot-chip:hover {
  background: var(--blue-b, rgba(37, 99, 235, 0.2));
  transform: translateY(-1px);
}

/* Agent handoff button (mailto) */
.faq-chatbot-chip.agent {
  color: var(--gold-l, #e8b55a);
  background: var(--gold-p, rgba(201, 147, 58, 0.1));
  border-color: var(--gold-b, rgba(201, 147, 58, 0.22));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.faq-chatbot-chip.agent:hover {
  background: rgba(201, 147, 58, 0.2);
}

.faq-chatbot-chip.agent svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Input area ── */
.faq-chatbot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  background: var(--navy-3, #18213a);
}

.faq-chatbot-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-family: inherit;
  color: #fff;
  background: var(--navy, #0b0e1a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: var(--r-s, 12px);
  outline: none;
  transition: border-color 0.15s;
}

.faq-chatbot-input::placeholder {
  color: var(--text-d, #7288a6);
}

.faq-chatbot-input:focus {
  border-color: var(--blue, #2563eb);
}

.faq-chatbot-send {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--r-s, 12px);
  background: linear-gradient(
    135deg,
    var(--blue, #2563eb),
    var(--blue-d, #1d4ed8)
  );
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.faq-chatbot-send:hover {
  transform: scale(1.06);
}

.faq-chatbot-send svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .faq-chatbot {
    bottom: 16px;
    right: 16px;
  }

  .faq-chatbot-panel {
    height: 480px;
  }
}
