/* Greeting that pops up next to the TCI AI chatbot button on the home page */

.tci-chat-welcome {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 99997;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(320px, calc(100vw - 48px));
  padding: 14px 40px 14px 14px;
  background: #fff;
  border: 1px solid rgba(0, 138, 210, 0.18);
  border-radius: 14px;
  box-shadow:
    0 10px 30px rgba(1, 22, 64, 0.18),
    0 2px 6px rgba(1, 22, 64, 0.08);
  font-family: 'Open Sans', sans-serif;
  transform-origin: bottom right;
  animation: tci-chat-welcome-in 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

/* Speech-bubble tail pointing down at the chat button */
.tci-chat-welcome::after {
  content: '';
  position: absolute;
  right: 26px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid rgba(0, 138, 210, 0.18);
  border-bottom: 1px solid rgba(0, 138, 210, 0.18);
  transform: rotate(45deg);
}

.tci-chat-welcome--leaving {
  animation: tci-chat-welcome-out 0.35s ease both;
}

@keyframes tci-chat-welcome-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tci-chat-welcome-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

.tci-chat-welcome__logo-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f7fc;
  border: 2px solid #008ad2;
}

.tci-chat-welcome__logo {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.tci-chat-welcome__body {
  min-width: 0;
}

.tci-chat-welcome__title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #011640;
  white-space: nowrap;
}

.tci-chat-welcome__text {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #58595b;
}

.tci-chat-welcome__close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2d353d;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.tci-chat-welcome__close:hover {
  opacity: 1;
}

@media (max-width: 480px) {
  .tci-chat-welcome {
    right: 16px;
    bottom: 90px;
    gap: 10px;
    padding: 10px 30px 10px 10px;
  }

  .tci-chat-welcome::after {
    right: 22px;
  }

  .tci-chat-welcome__logo-wrap {
    width: 38px;
    height: 38px;
  }

  .tci-chat-welcome__logo {
    width: 22px;
    height: 22px;
  }

  .tci-chat-welcome__title {
    font-size: 13.5px;
    white-space: normal;
  }

  .tci-chat-welcome__text {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tci-chat-welcome,
  .tci-chat-welcome--leaving {
    animation-duration: 0.01s;
  }
}
