/**
 * Конфигуратор v2 — Chat UI (v3)
 * Тёмная шапка, бледно-голубые pills, зелёная «Далее», жёлтый hint
 * Single-screen: один вопрос, анимация перехода
 */

/* === Layout === */
.cv2-chat-wrap {
  display: flex;
  max-width: 920px;
  margin: 0 auto;
  height: 620px;
  background: #FFFFFF;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #E2E5EA;
  font-family: 'Manrope', 'Roboto', system-ui, sans-serif;
}

.cv2-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* === Шапка — тёмная === */
.cv2-chat-header {
  padding: 16px 20px;
  background: #0B2A40;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cv2-chat-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #009FED;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cv2-chat-header__info { flex: 1; min-width: 0; }

.cv2-chat-header__name {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.cv2-chat-header__sub {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.cv2-chat-header__counter {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  padding: 5px 14px;
  border-radius: 999px;
}

/* === Тело === */
.cv2-chat-body {
  flex: 1;
  padding: 24px 24px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* === Анимация появления === */
@keyframes cv2-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cv2-chat-body > * {
  animation: cv2-fade-in 0.35s cubic-bezier(0.22,1,0.36,1) both;
}
.cv2-chat-body > *:nth-child(1) { animation-delay: 0s; }
.cv2-chat-body > *:nth-child(2) { animation-delay: 0.07s; }
.cv2-chat-body > *:nth-child(3) { animation-delay: 0.14s; }
.cv2-chat-body > *:nth-child(4) { animation-delay: 0.20s; }
.cv2-chat-body > *:nth-child(5) { animation-delay: 0.26s; }
.cv2-chat-body > *:nth-child(6) { animation-delay: 0.30s; }
.cv2-chat-body > *:nth-child(7) { animation-delay: 0.34s; }
.cv2-chat-body > *:nth-child(8) { animation-delay: 0.38s; }
.cv2-chat-body > *:nth-child(9) { animation-delay: 0.42s; }
.cv2-chat-body > *:nth-child(10){ animation-delay: 0.46s; }

/* === Сообщение бота === */
.cv2-chat-row--bot {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.cv2-chat-avatar {
  min-width: 32px; width: 32px; height: 32px;
  border-radius: 50%;
  background: #009FED;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.cv2-chat-bubble--bot {
  background: #E8F4FD;
  border-radius: 16px 16px 16px 4px;
  padding: 14px 18px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: #0B2A40;
  max-width: 88%;
}

/* === Подсказка — тёплый жёлтый === */
.cv2-chat-bubble--hint {
  background: #FFF8E7;
  border: 1px solid #F0DFA0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #6B5300;
  max-width: 88%;
  margin-left: 42px;
  margin-bottom: 12px;
}

/* === Сообщение пользователя === */
.cv2-chat-row--user {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.cv2-chat-bubble--user {
  background: #009FED;
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  max-width: 72%;
  cursor: pointer;
  transition: opacity 0.15s;
}

.cv2-chat-bubble--user:hover { opacity: 0.85; }

/* === Pill-кнопки — бледно-голубые === */
.cv2-chat-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-left: 42px;
}

.cv2-chat-pill {
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #5BBEF5;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
  line-height: 1.35;
  -webkit-user-select: none;
  user-select: none;
}

.cv2-chat-pill:hover {
  background: #3AAEEF;
  transform: translateY(-1px);
}

.cv2-chat-pill:active {
  transform: scale(0.97);
}

.cv2-chat-pill--selected {
  background: #0068A8;
  border-color: rgba(0,77,120,0.3);
}

.cv2-chat-pill--selected:hover {
  background: #005A94;
  transform: none;
}

/* Pill с описанием */
.cv2-chat-pill--rich {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 14px;
  padding: 12px 18px;
}

.cv2-chat-pill__title {
  font-size: 15px;
  font-weight: 700;
}

.cv2-chat-pill__desc {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
}

.cv2-chat-pill--selected .cv2-chat-pill__desc {
  color: rgba(255,255,255,0.8);
}

/* Бейдж */
.cv2-chat-pill__badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  color: #FFFFFF;
  margin-top: 5px;
}

/* === Кнопка «Далее» — зелёная === */
.cv2-chat-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  background: #1B9E5A;
  color: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
  margin-left: 42px;
  margin-bottom: 12px;
}

.cv2-chat-confirm:hover {
  background: #158A4D;
  transform: translateY(-1px);
}

.cv2-chat-confirm:active {
  transform: scale(0.97);
}

.cv2-chat-confirm:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

/* === Секция compound === */
.cv2-chat-section-label {
  font-size: 14px;
  font-weight: 700;
  color: #1E3A50;
  letter-spacing: 0.01em;
  padding-left: 42px;
  margin: 16px 0 8px;
  position: relative;
}

.cv2-chat-section-label::before {
  content: '';
  display: block;
  width: calc(100% - 42px);
  height: 1px;
  background: #E5E7EB;
  margin-bottom: 14px;
}

.cv2-chat-row--bot + .cv2-chat-section-label::before,
.cv2-chat-bubble--hint + .cv2-chat-section-label::before {
  display: none;
}

/* === Typing === */
.cv2-chat-typing {
  display: flex;
  gap: 5px;
  padding-left: 42px;
  margin-bottom: 12px;
}

.cv2-chat-typing__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #B0BEC5;
  animation: cv2-typing 1.2s infinite;
}
.cv2-chat-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.cv2-chat-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes cv2-typing {
  0%,60%,100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* === Done === */
.cv2-chat-done { text-align: center; padding: 24px 0; }

.cv2-chat-done__icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(27,158,90,0.1);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}

.cv2-chat-done__title {
  font-size: 18px; font-weight: 700; color: #111827; margin: 0 0 6px;
}

.cv2-chat-done__sub {
  font-size: 14px; color: #6B7280; margin: 0;
}

/* === Правая панель === */
.cv2-chat-panel {
  width: 260px;
  background: #F9FAFB;
  border-left: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
}

.cv2-chat-panel__context {
  flex: 1;
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}

.cv2-chat-panel__context-icon { margin-bottom: 12px; }

.cv2-chat-panel__context-title {
  font-size: 15px; font-weight: 700; color: #111827; margin: 0 0 6px;
}

.cv2-chat-panel__context-desc {
  font-size: 13px; color: #6B7280; margin: 0; line-height: 1.5;
}

.cv2-chat-panel__badges {
  display: flex; flex-direction: column; gap: 4px; margin-top: 12px; width: 100%;
}

.cv2-chat-panel__badge {
  font-size: 12px; padding: 7px 12px; border-radius: 8px;
  background: #FFFFFF; border: 1px solid #E5E7EB; color: #6B7280;
}

.cv2-chat-panel__summary {
  padding: 16px;
  border-top: 1px solid #E5E7EB;
}

.cv2-chat-panel__summary-title {
  font-size: 12px; font-weight: 700; color: #9CA3AF;
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px;
}

.cv2-chat-panel__summary-row {
  display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px;
}

.cv2-chat-panel__summary-label { color: #9CA3AF; }
.cv2-chat-panel__summary-value { color: #111827; font-weight: 600; }
.cv2-chat-panel__summary-value--empty { color: #D1D5DB; font-weight: 400; }

/* === Mobile === */
@media (max-width: 768px) {
  .cv2-chat-wrap { border-radius: 0; border: none; height: 100vh; height: 100dvh; }
  .cv2-chat-panel { display: none; }
  .cv2-chat-bubble--bot, .cv2-chat-bubble--hint { max-width: 92%; }
  .cv2-chat-bubble--user { max-width: 80%; }
  .cv2-chat-buttons { padding-left: 42px; padding-right: 8px; }
}

@media (max-width: 480px) {
  .cv2-chat-header { padding: 14px 16px; }
  .cv2-chat-body { padding: 18px 16px; }
  .cv2-chat-pill { padding: 10px 16px; font-size: 14px; }
  .cv2-chat-buttons { padding-left: 36px; }
  .cv2-chat-confirm { margin-left: 36px; }
  .cv2-chat-section-label { padding-left: 36px; }
  .cv2-chat-avatar { min-width: 28px; width: 28px; height: 28px; }
  .cv2-chat-bubble--bot { font-size: 16px; }
  .cv2-chat-bubble--hint { margin-left: 36px; }
}
