/* Чат-консультант: правила перенесены из site.css без изменений (старая главная). */
:root{--card:#15102a;--card-line:rgba(139,92,246,.22);--card-radius:22px;--muted:#b8add6;--muted-2:#7c719e;--violet-glow:rgba(124,58,237,.55)}
.btn-primary {
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-2) 100%);
  color: #fff; box-shadow: 0 0 0 1px rgba(139,92,246,0.5), 0 10px 30px -8px var(--violet-glow);
}
.btn-primary:hover { box-shadow: 0 0 0 1px var(--violet-2), 0 14px 38px -8px var(--violet-glow); transform: translateY(-2px); }
/* ─── Чат-виджет ─── */
.chat-fab {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-2) 100%);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(139,92,246,0.5), 0 8px 28px -6px var(--violet-glow);
  transition: transform .15s, box-shadow .15s;
}
.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 1px var(--violet-2), 0 12px 36px -6px var(--violet-glow);
}
.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 201;
  width: 360px;
  max-height: 560px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--card-radius);
  box-shadow: 0 0 48px -8px var(--violet-glow), 0 24px 64px -16px rgba(0,0,0,0.85);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease;
}
.chat-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-line);
  flex-shrink: 0;
}
.chat-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}
.chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-2);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  transition: color .15s;
}
.chat-close:hover { color: var(--ink); }
/* Экран регистрации */
.chat-reg {
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow-y: auto;
}
.chat-reg-hint {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.chat-field {
  margin-bottom: 12px;
}
.chat-inp {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  background: rgba(11,5,24,0.6);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-inp::placeholder { color: var(--muted-2); }
.chat-inp:focus { border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(139,92,246,0.22); }
.chat-reg-err {
  display: none;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  color: #fb7185;
  background: rgba(244,63,94,0.14);
}
.chat-reg-err.visible { display: block; }
.chat-reg-btn {
  width: 100%;
  margin-top: 4px;
  padding: 12px 20px;
  font-size: 15px;
}
/* Экран чата */
.chat-main {
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-2) 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-1);
  color: var(--ink);
  border: 1px solid var(--card-line);
  border-bottom-left-radius: 4px;
}
/* Структура ответа бота: абзацы и списки читаются раздельно, не простынёй. */
.chat-msg.bot .chat-p { margin: 0 0 10px; }
.chat-msg.bot .chat-p:last-child { margin-bottom: 0; }
.chat-msg.bot .chat-list {
  margin: 0 0 10px;
  padding-left: 20px;
}
.chat-msg.bot .chat-list:last-child { margin-bottom: 0; }
.chat-msg.bot .chat-list li { margin: 4px 0; }
.chat-msg.bot strong { font-weight: 600; }
/* Индикатор «печатает…» */
.chat-typing { min-width: 56px; }
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  display: inline-block;
  font-size: 18px;
  color: var(--violet-2);
  animation: chatDot 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--card-line);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 10px 13px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  background: rgba(11,5,24,0.6);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input::placeholder { color: var(--muted-2); }
.chat-input:focus { border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(139,92,246,0.22); }
.chat-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 18px;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-2) 100%);
  color: #fff;
  transition: opacity .15s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-send-btn:hover { opacity: 0.9; transform: scale(1.06); }
.chat-send-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
@keyframes chatDot {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40%            { opacity: 1;   transform: translateY(-4px); }
}
@media (max-width: 640px) {
.chat-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 100dvh;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
  }
.chat-fab {
    right: 16px;
    bottom: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
.chat-panel { transition: none; }
.chat-fab { transition: none; }
.typing-dots span { animation: none; opacity: 1; }
.chat-log { scroll-behavior: auto; }
}
.chat-agree{display:flex;gap:8px;align-items:flex-start;font-size:12.5px;line-height:1.4;color:var(--muted);margin:4px 0 10px;cursor:pointer}
.chat-agree input{width:16px;height:16px;margin-top:2px;flex:none;accent-color:var(--violet)}
.chat-agree a{color:inherit;text-decoration:underline}
