/* Переиспользуемый чат-бот лендинга */

.landing-chat {
  width: min(100%, 720px);
  margin-inline: auto;
}

.landing-chat__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.landing-chat__messages {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  padding: 4px 2px 8px;
  scroll-behavior: smooth;
  text-align: left;
}

.landing-chat--active .landing-chat__messages {
  display: flex;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.landing-chat__bubble {
  max-width: min(88%, 520px);
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  transform: translateY(8px);
  animation: landingChatBubbleIn 0.35s ease forwards;
}

.landing-chat__bubble.is-entering {
  animation: landingChatBubbleIn 0.35s ease forwards;
}

.landing-chat__bubble--user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  border-bottom-right-radius: 6px;
}

.landing-chat__bubble--assistant {
  align-self: flex-start;
  color: var(--text-primary);
  background: var(--glass-fill);
  border: 0;
  border-bottom-left-radius: 6px;
}

.landing-chat__bubble strong {
  font-weight: 500;
  color: #fff;
}

.landing-chat__bubble--assistant strong {
  color: var(--text-primary);
}

.landing-chat__suggestions {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: min(96%, 600px);
  margin: -2px 0 4px 6px;
  opacity: 1;
}

.landing-chat__suggestions.is-entering {
  animation: landingChatBubbleIn 0.3s ease forwards;
}

.landing-chat__suggestion {
  padding: 7px 11px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 245, 247, 0.82);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.landing-chat__suggestion:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.landing-chat__suggestion:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.landing-chat__link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.landing-chat__link:hover {
  color: #b29aff;
}

.landing-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding-inline: 18px;
  opacity: 1;
  transform: none;
  animation: none;
}

.landing-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(245, 245, 247, 0.55);
  animation: landingChatTyping 1s ease-in-out infinite;
}

.landing-chat__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.landing-chat__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.landing-chat__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.landing-chat__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.landing-chat__input::placeholder {
  color: rgba(245, 245, 247, 0.42);
}

.landing-chat__send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.landing-chat__send:hover:not(:disabled) {
  transform: translateY(-1px);
}

.landing-chat__send:disabled {
  opacity: 0.55;
  cursor: default;
}

.landing-chat__auth {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.landing-chat__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.35s ease, max-height 0.45s ease, margin 0.45s ease;
}

.landing-chat--active .landing-chat__chips {
  opacity: 0.85;
}

.landing-chat__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 245, 247, 0.88);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.landing-chat__chip:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.landing-chat__chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.landing-chat__chip-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

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

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

@media (max-width: 640px) {
  .landing-chat__form {
    padding-left: 14px;
  }

  .landing-chat__bubble {
    max-width: 92%;
    font-size: 14px;
  }

  .landing-chat__chip {
    font-size: 13px;
    padding: 9px 12px;
    border-radius: 9px;
  }

  .landing-chat__suggestions {
    gap: 6px;
    margin-left: 2px;
  }

  .landing-chat__suggestion {
    font-size: 11px;
    padding: 7px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-chat__bubble,
  .landing-chat__typing {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .landing-chat__chips,
  .landing-hero__subtitle {
    animation: none !important;
    transition: none !important;
  }
}
