/* Firebird AI Guide — floating scripted demo chat */

:root {
  --fb-chat-orange: #f37f29;
  --fb-chat-header: #1c1c1c;
  --fb-chat-z: 9000;
  --fb-chat-cx: #3b6ea8;
  --fb-chat-campaign: #d97706;
  --fb-chat-connected: #2f7d4a;
  --fb-chat-festos: #6b4ea0;
  --fb-chat-web: #0d7a96;
  --fb-chat-finder: #2a9d8f;
}

#firebird-chat-root {
  font-family: var(--fb-font, Inter, sans-serif);
  font-size: 15px;
  line-height: 1.45;
  color: #222;
}

.fb-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 80px;
  height: 80px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: #fff;
  color: #1c1c1c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  z-index: var(--fb-chat-z);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fb-chat-launcher:hover,
.fb-chat-launcher:focus {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  outline: none;
}

.fb-chat-launcher:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--fb-chat-orange);
}

.fb-chat-launcher img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.fb-chat-launcher.is-open {
  display: none;
}

.fb-chat-launcher .fb-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--fb-chat-orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 999px;
}

body[data-page="contact"] .fb-chat-launcher,
body[data-page="contact"] .fb-chat-prompt {
  bottom: 112px;
}

.fb-chat-prompt {
  position: fixed;
  right: 24px;
  bottom: 116px;
  max-width: 240px;
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 10px 32px 10px 14px;
  z-index: var(--fb-chat-z);
  font-size: 0.875rem;
  line-height: 1.35;
}

.fb-chat-prompt button {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  background: transparent;
  color: #666;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

@media (max-width: 639.98px) {
  .fb-chat-prompt {
    display: none !important;
  }
}

.fb-chat-window {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 420px;
  max-width: calc(100vw - 24px);
  height: 680px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.06);
  z-index: calc(var(--fb-chat-z) + 1);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.fb-chat-window.is-open {
  display: flex;
}

.fb-chat-header {
  background: var(--fb-chat-header);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fb-chat-header img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.fb-chat-header-text {
  flex: 1;
  min-width: 0;
}

.fb-chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

.fb-chat-demo {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  padding: 1px 6px;
}

.fb-chat-header-status {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 2px;
}

.fb-chat-header-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.fb-chat-header-actions button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
}

.fb-chat-header-actions button:focus-visible,
.fb-chat-composer button:focus-visible,
.fb-chat-action:focus-visible,
.fb-chat-card:focus-visible,
.fb-chat-secondary:focus-visible {
  outline: 2px solid var(--fb-chat-orange);
  outline-offset: 2px;
}

.fb-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: #fafafa;
  -webkit-overflow-scrolling: touch;
}

.fb-chat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.fb-chat-row.is-user {
  justify-content: flex-end;
}

.fb-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}

.fb-chat-bubble {
  max-width: 86%;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fb-chat-bubble p {
  margin: 0 0 0.5em;
}

.fb-chat-bubble p:last-child {
  margin-bottom: 0;
}

.fb-chat-row.is-user .fb-chat-bubble {
  background: #1c1c1c;
  color: #fff;
}

.fb-chat-typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
}

.fb-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: fb-chat-bounce 1s infinite ease-in-out;
}

.fb-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.fb-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes fb-chat-bounce {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.fb-chat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #888;
  text-transform: uppercase;
  margin: 4px 0 10px;
}

.fb-chat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.fb-chat-card {
  text-align: left;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--fb-chat-accent, #888);
  border-radius: 10px;
  padding: 10px 10px 10px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  min-height: 44px;
}

.fb-chat-card i {
  display: block;
  margin-bottom: 6px;
  color: var(--fb-chat-accent, #555);
}

.fb-chat-card strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 2px;
}

.fb-chat-card span {
  display: block;
  font-size: 0.72rem;
  color: #666;
  line-height: 1.3;
}

.fb-chat-card[data-vertical="cx"] { --fb-chat-accent: var(--fb-chat-cx); }
.fb-chat-card[data-vertical="activations"] { --fb-chat-accent: var(--fb-chat-campaign); }
.fb-chat-card[data-vertical="packaging"] { --fb-chat-accent: var(--fb-chat-connected); }
.fb-chat-card[data-vertical="festos"] { --fb-chat-accent: var(--fb-chat-festos); }
.fb-chat-card[data-vertical="websites"] { --fb-chat-accent: var(--fb-chat-web); }
.fb-chat-card[data-vertical="finder"] { --fb-chat-accent: var(--fb-chat-finder); }

.fb-chat-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  background: #fff;
  border: 1.5px solid #1c1c1c;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 8px;
}

.fb-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.fb-chat-action {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  line-height: 1.2;
}

.fb-chat-action.is-primary {
  background: var(--fb-chat-header);
  color: #fff;
  border-color: var(--fb-chat-header);
}

.fb-chat-action .fa-external-link-alt {
  margin-left: 4px;
  font-size: 0.7em;
}

.fb-chat-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 8px 12px 12px;
  background: #fff;
}

.fb-chat-demo-note {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-bottom: 8px;
}

.fb-chat-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.fb-chat-composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 96px;
  resize: none;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 22px;
  padding: 10px 14px;
  font: inherit;
  line-height: 1.4;
}

.fb-chat-composer textarea:focus {
  outline: none;
  border-color: var(--fb-chat-orange);
  box-shadow: 0 0 0 3px rgba(243, 127, 41, 0.2);
}

.fb-chat-composer button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--fb-chat-orange);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.fb-chat-composer button:disabled {
  opacity: 0.45;
  cursor: default;
}

.fb-chat-form {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
}

.fb-chat-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 8px 0 4px;
}

.fb-chat-form input,
.fb-chat-form textarea,
.fb-chat-form select {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.fb-chat-form .fb-chat-error {
  color: #b42318;
  font-size: 0.75rem;
  margin-top: 6px;
}

.fb-chat-form .fb-chat-submit {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--fb-chat-orange);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 639.98px) {
  body.fb-chat-open .language-switcher {
    display: none !important;
  }

  .fb-chat-window {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10000;
  }

  .fb-chat-launcher {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .fb-chat-cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fb-chat-launcher,
  .fb-chat-typing span {
    animation: none;
    transition: none;
  }
}
