/* Randatech Smart Assistant — public marketing chatbot */
.fcb {
  --fcb-blue: #2b459a;
  --fcb-dark: #1e3270;
  --fcb-orange: #f07128;
  --fcb-ink: #0f172a;
  --fcb-muted: #64748b;
  --fcb-bg: #f8fafc;
  --fcb-card: #ffffff;
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 1150;
  font-family: Inter, system-ui, sans-serif;
}

.fcb__launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.25rem;
  padding: 0.7rem 1rem 0.7rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--fcb-blue), var(--fcb-dark));
  color: #fff;
  box-shadow: 0 14px 36px rgba(30, 50, 112, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fcb__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(30, 50, 112, 0.42);
}

.fcb__launcher-label {
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.fcb__launcher-pulse {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(240, 113, 40, 0.45);
  animation: fcb-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes fcb-pulse {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.18); }
}

.fcb__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100dvh - 6.5rem));
  display: flex;
  flex-direction: column;
  background: var(--fcb-card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(43, 69, 154, 0.08);
}

.fcb__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--fcb-blue), #16275e 70%);
  color: #fff;
}

.fcb__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.fcb__brand strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.2;
}

.fcb__brand small {
  display: block;
  opacity: 0.85;
  font-size: 0.72rem;
  margin-top: 0.12rem;
}

.fcb__avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.fcb__head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.fcb__brand-copy {
  min-width: 0;
}

.fcb__icon-btn {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.fcb__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background:
    radial-gradient(circle at top right, rgba(240, 113, 40, 0.08), transparent 40%),
    var(--fcb-bg);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.fcb__msg {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}

.fcb__msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

.fcb__msg--assistant {
  align-self: flex-start;
  align-items: flex-start;
}

.fcb__bubble {
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--fcb-ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  white-space: normal;
  word-break: break-word;
}

.fcb__msg--user .fcb__bubble {
  background: linear-gradient(135deg, var(--fcb-blue), var(--fcb-dark));
  color: #fff;
  border-bottom-right-radius: 5px;
}

.fcb__msg--assistant .fcb__bubble {
  border-bottom-left-radius: 5px;
}

.fcb__bubble a {
  color: var(--fcb-orange);
  text-decoration: underline;
}

.fcb__msg--user .fcb__bubble a {
  color: #ffe9d9;
}

.fcb__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.fcb__action {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--fcb-blue);
  background: #fff;
  border: 1px solid rgba(43, 69, 154, 0.18);
}

.fcb__action--support {
  background: rgba(240, 113, 40, 0.12);
  border-color: rgba(240, 113, 40, 0.35);
  color: #b45309;
}

.fcb__quick {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0 0.85rem 0.55rem;
  background: var(--fcb-bg);
}

.fcb__chip {
  border: 1px solid rgba(43, 69, 154, 0.14);
  background: #fff;
  color: var(--fcb-ink);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 550;
  cursor: pointer;
  line-height: 1.25;
}

.fcb__chip:hover {
  border-color: var(--fcb-orange);
  color: var(--fcb-blue);
}

.fcb__form {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

.fcb__input {
  flex: 1;
  resize: none;
  min-height: 2.5rem;
  max-height: 6rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  color: var(--fcb-ink);
  background: var(--fcb-bg);
}

.fcb__input:focus {
  outline: 2px solid rgba(240, 113, 40, 0.35);
  border-color: var(--fcb-orange);
}

.fcb__send {
  width: 2.55rem;
  height: 2.55rem;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--fcb-blue);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.fcb__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fcb__foot {
  padding: 0.45rem 0.85rem 0.65rem;
  font-size: 0.7rem;
  color: var(--fcb-muted);
  background: #fff;
  text-align: center;
}

.fcb__foot a {
  color: var(--fcb-blue);
  font-weight: 600;
  text-decoration: none;
}

.fcb__typing {
  display: inline-flex;
  gap: 0.28rem;
  padding: 0.55rem 0.7rem;
  background: #fff;
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.fcb__typing span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--fcb-muted);
  animation: fcb-dot 1s ease-in-out infinite;
}

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

@keyframes fcb-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.fcb-enter { transition: opacity 0.18s ease, transform 0.18s ease; }
.fcb-enter-from { opacity: 0; transform: translateY(10px) scale(0.98); }
.fcb-enter-to { opacity: 1; transform: translateY(0) scale(1); }
.fcb-leave { transition: opacity 0.14s ease, transform 0.14s ease; }
.fcb-leave-from { opacity: 1; transform: translateY(0) scale(1); }
.fcb-leave-to { opacity: 0; transform: translateY(8px) scale(0.98); }

/* Keep scroll-top clear of the chatbot launcher */
.rt-site-layout .rt-scroll-top {
  right: 1.15rem;
  bottom: 5.4rem;
}

@media (max-width: 640px) {
  .fcb {
    right: 0.75rem;
    bottom: 0.75rem;
    left: auto;
  }

  .fcb__panel {
    position: fixed;
    inset: auto 0.5rem 4.6rem 0.5rem;
    width: auto;
    height: min(72dvh, 560px);
    right: 0.5rem;
    bottom: 4.6rem;
  }

  .fcb__launcher-label {
    display: none;
  }

  .fcb__launcher {
    width: 3.35rem;
    height: 3.35rem;
    padding: 0;
    justify-content: center;
  }

  .rt-site-layout .rt-scroll-top {
    bottom: 5.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fcb__launcher-pulse,
  .fcb__typing span {
    animation: none;
  }
}
