/* демо-чат с Марией: панель в пурпурных тонах, заготовленные ответы */

.chat-section {
  padding-top: 6px;
}

.chat-demo {
  position: relative;
  max-width: 620px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(26, 19, 29, .97), rgba(13, 10, 15, .99));
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55), inset 0 0 60px rgba(110, 74, 145, .08);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(110, 74, 145, .22), rgba(110, 74, 145, .07));
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-family: 'Pirata One', 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  color: #f6ebff;
  background: radial-gradient(circle at 32% 26%, #cba9e8, #7a53a6 55%, #3a254d);
  box-shadow: 0 0 0 1px rgba(200, 170, 230, .4), 0 0 18px rgba(150, 100, 200, .35);
}

.chat-who {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.chat-who strong {
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.chat-tag {
  padding: 1px 7px;
  border: 1px solid rgba(181, 143, 216, .45);
  border-radius: 99px;
  font-size: .58rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #c3a0e2;
}

.chat-state {
  margin-left: auto;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 306px;
  padding: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.msg {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: .95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.msg--maria {
  align-self: flex-start;
  border: 1px solid rgba(160, 122, 200, .3);
  border-bottom-left-radius: 3px;
  background: rgba(120, 86, 160, .22);
}

.msg--user {
  align-self: flex-end;
  border: 1px solid rgba(192, 64, 47, .35);
  border-bottom-right-radius: 3px;
  background: rgba(153, 45, 34, .32);
}

.msg--note {
  align-self: center;
  padding: 2px 0;
  font-size: .62rem;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
  color: var(--muted);
}

.msg.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
}

.msg.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(200, 170, 230, .7);
  animation: chat-dot 1.1s infinite ease-in-out;
}

.msg.typing span:nth-child(2) { animation-delay: .15s; }
.msg.typing span:nth-child(3) { animation-delay: .3s; }

@keyframes chat-dot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.chat-chip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, .02);
  color: var(--fg);
  font-family: inherit;
  font-size: .78rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.chat-chip:hover,
.chat-chip:focus-visible {
  border-color: rgba(181, 143, 216, .65);
  background: rgba(120, 86, 160, .16);
  outline: none;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--fg);
  font-family: inherit;
  font-size: .95rem;
}

.chat-input:focus {
  border-color: rgba(181, 143, 216, .6);
  outline: none;
}

.chat-send {
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #a33224, #7c2419);
  color: #f5e9e4;
  font-family: inherit;
  font-size: .88rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}

.chat-send:hover {
  background: linear-gradient(180deg, #c0402f, #92291c);
}

.chat-hint {
  margin: 12px 0 0;
  font-size: .84rem;
  color: var(--muted);
}

html.night .chat-demo {
  background: linear-gradient(180deg, rgba(20, 15, 22, .98), rgba(8, 6, 9, .99));
}

html.night .msg--maria {
  background: rgba(104, 74, 140, .26);
}

@media (max-width: 720px) {
  .chat-log {
    height: 268px;
    padding: 12px;
  }
  .msg {
    max-width: 88%;
    font-size: .92rem;
  }
  .chat-chips {
    padding: 0 12px 10px;
  }
  .chat-form {
    padding: 10px 12px 12px;
  }
  .chat-send {
    padding: 10px 12px;
  }
  .chat-state {
    display: none;
  }
}
