/* Модули дня 2: опросник, чат, сравнение, избранное.
   Цвета/радиусы согласованы с basic.css и лендингом. А2. */

.quiz-box,
.chat-window,
.compare-wrap {
  background: #fff;
  border: 1px solid var(--line, #ececef);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 12px 32px rgba(40, 24, 12, 0.07));
}

.quiz-box {
  max-width: 640px;
  margin: 0 auto 28px;
  padding: 24px;
}
.quiz-progress {
  color: var(--muted, #6d6d75);
  font-size: 0.85rem;
  margin: 8px 0 4px;
}
.progress-bar {
  height: 6px;
  background: var(--accent-soft, #F0E5FC);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent, #A85CFF);
  border-radius: inherit;
  transition: width 0.2s ease;
}
.quiz-form h2 {
  margin: 10px 0 16px;
  font-size: 1.2rem;
}
.quiz-form input[type=number] {
  padding: 10px 12px;
  border: 1px solid var(--line, #ececef);
  border-radius: 10px;
  font-size: 1rem;
  width: min(220px, 100%);
  font-family: inherit;
}
.budget-custom {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent, #A85CFF) 40%, var(--line, #ececef));
  border-radius: 12px;
  background: #fff;
}
.budget-custom label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted, #6d6d75);
  font-weight: 500;
  margin-bottom: 6px;
}
.budget-custom input[type=number] {
  width: min(260px, 100%);
}
.budget-custom .notice { margin: 8px 0 0; }
.unit {
  margin-left: 8px;
  color: var(--muted, #6d6d75);
}
.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line, #ececef);
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option:hover {
  border-color: var(--accent, #A85CFF);
  background: var(--accent-soft, #F0E5FC);
}
.option:has(input:checked) {
  border-color: var(--accent, #A85CFF);
  background: var(--accent-soft, #F0E5FC);
}
.option input { accent-color: var(--accent, #A85CFF); }
.quiz-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.quiz-actions .spacer { flex: 1; }
.restart-form { margin-top: 14px; }
.link-like {
  background: none;
  border: 0;
  color: var(--muted, #6d6d75);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
  font-family: inherit;
}
.link-like:hover { color: var(--accent-dark, #9343f2); }
.form-error { color: #b42318; font-weight: 500; }
.notice {
  color: var(--muted, #6d6d75);
  font-size: 0.9rem;
  line-height: 1.45;
}
.notice a { color: var(--accent-dark, #9343f2); }
.reason {
  color: var(--yes, #067647);
  font-size: 0.85rem;
  margin: 4px 0 0;
}

.chat-window {
  max-width: 760px;
  margin: 0 auto 28px;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 6px;
  margin-bottom: 4px;
}
.msg {
  display: flex;
  flex-direction: column;
  max-width: min(80%, 520px);
}
.msg.user {
  align-self: flex-end;
  align-items: flex-end;
}
.msg .bubble {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--accent-soft, #F0E5FC);
  line-height: 1.45;
}
.msg.user .bubble {
  background: var(--accent, #A85CFF);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.msg.assistant .bubble,
.msg .bubble {
  border-bottom-left-radius: 6px;
}
.msg.user .bubble { border-bottom-left-radius: 16px; }
.msg .time {
  font-size: 0.7rem;
  color: var(--faint, #8d8d95);
  margin: 2px 6px;
}
.chat-products {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.product-card.mini {
  padding: 10px 14px;
  min-width: 180px;
}
.product-card.mini h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
}
.chat-form {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.chat-form input[type=text] {
  flex: 1 1 220px;
  padding: 12px 14px;
  border: 1px solid var(--line, #ececef);
  border-radius: 999px;
  font-size: 0.95rem;
  font-family: inherit;
}
.chat-form input[type=text]:focus {
  outline: 2px solid color-mix(in srgb, var(--accent, #A85CFF) 35%, white);
  border-color: var(--accent, #A85CFF);
}
.pdn-warning {
  color: var(--faint, #8d8d95);
  font-size: 0.78rem;
  margin-top: 10px;
}

.compare-wrap {
  overflow-x: auto;
  padding: 8px;
  margin-bottom: 28px;
}
.compare-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}
.compare-table th,
.compare-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, #ececef);
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}
.compare-table thead th a {
  color: var(--ink, #161616);
  text-decoration: none;
  font-weight: 700;
}
.compare-table thead th a:hover { color: var(--accent-dark, #9343f2); }
.diff-row td,
.diff-row th {
  background: var(--accent-soft, #F0E5FC);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}
.detail-actions form { display: inline; }

@media (max-width: 800px) {
  .quiz-box,
  .chat-window { padding: 16px; }
  .msg { max-width: 92%; }
}

.auth-links {
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.auth-links a,
.auth-links .link-like {
  color: var(--muted, #6d6d75);
  font-size: 0.9rem;
  text-decoration: none;
  font-family: inherit;
}
.auth-links a:hover,
.auth-links .link-like:hover { color: var(--accent-dark, #9343f2); }
.auth-box {
  max-width: 460px;
  margin: 0 auto 28px;
  background: #fff;
  border: 1px solid var(--line, #ececef);
  border-radius: var(--radius, 14px);
  padding: 24px;
  box-shadow: var(--shadow, 0 12px 32px rgba(40, 24, 12, 0.07));
}
.auth-box input {
  padding: 10px 12px;
  border: 1px solid var(--line, #ececef);
  border-radius: 10px;
  width: 100%;
  max-width: 320px;
  font-family: inherit;
}
.privacy-text {
  max-width: 720px;
  color: var(--ink, #161616);
  line-height: 1.55;
}
.privacy-text h2 { margin-top: 1.4em; }
.privacy-text p { color: var(--muted, #6d6d75); }
.error-page {
  max-width: 520px;
  margin: 48px auto;
  text-align: center;
}
.error-page .code {
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--accent, #A85CFF);
  line-height: 1;
  margin: 0 0 8px;
}
.error-page .detail-actions { justify-content: center; margin-top: 20px; }
.site-footer a {
  color: var(--accent-dark, #9343f2);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.login { cursor: pointer; }

/* Подсказки в опроснике: «?» у вариантов и пояснение к вопросу */
.q-hint {
  color: var(--muted, #6d6d75);
  font-size: 0.85rem;
  line-height: 1.45;
  margin: -6px 0 14px;
  max-width: 52ch;
}
.option { position: relative; }
.opt-hint {
  margin-left: auto;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--accent, #A85CFF);
  color: var(--accent-dark, #9343f2);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  position: relative;
  background: #fff;
}
.opt-hint__tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: min(260px, 78vw);
  background: var(--ink, #161616);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  padding: 8px 12px;
  border-radius: 10px;
  z-index: 30;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  white-space: normal;
  text-align: left;
}
.opt-hint:hover .opt-hint__tip,
.opt-hint:focus .opt-hint__tip,
.opt-hint:focus-within .opt-hint__tip { display: block; }

/* Баннер «мы ослабили условия» на странице результатов */
.relax-banner {
  background: #FFF8E6;
  border: 1px solid #F2DFA8;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 0 0 18px;
  color: #6b5518;
  font-size: 0.92rem;
  line-height: 1.5;
}
.relax-banner p { margin: 6px 0 0; }
.relax-banner a { color: var(--accent-dark, #9343f2); }

/* Ошибка «ничего не выбрано» — карточка со скруглением */
.quiz-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-soft, #F0E5FC);
  border: 1px solid #ddc6fa;
  border-radius: 14px;
  padding: 13px 16px;
  margin: 0 0 14px;
}
.quiz-alert__icon {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.quiz-alert p { margin: 2px 0 0; font-size: 0.85rem; color: #5b3a8f; }

/* Варианты-карточки с иконками */
.option {
  border-radius: 14px;
  padding: 12px 16px;
  gap: 12px;
}
.option__icon {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--accent-soft, #F0E5FC);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.option:has(input:checked) .option__icon { background: #fff; }
.option__label { flex: 1; }

/* Быстрые кнопки брендов */
.brand-quick { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.brand-quick__btn {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line, #ececef);
  background: #fff;
  color: var(--muted, #6d6d75);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}
.brand-quick__btn:hover { border-color: var(--accent, #A85CFF); color: var(--accent-dark, #9343f2); }

/* Сердце-избранное в шапке */
.header-fav {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line, #ececef);
  border-radius: 12px;
  color: var(--ink, #161616);
  text-decoration: none;
  background: #fff;
}
.header-fav:hover { border-color: var(--accent, #A85CFF); color: var(--accent, #A85CFF); }
.header-fav__count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent, #A85CFF);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Чат: шире, компактнее шрифт, карточки моделей с фото-слотом */
.chat-window { max-width: 920px; padding: 24px; }
.chat-feed { max-height: 62vh; gap: 14px; }
.msg .bubble { font-size: 0.92rem; padding: 11px 15px; }
.chat-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.product-card.mini {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  min-width: 0;
}
.mini__img {
  flex: none;
  width: 64px; height: 52px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line, #ececef);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mini__img img { width: 100%; height: 100%; object-fit: contain; }
.mini__img svg { width: 60%; color: #c7c7d0; }
.product-card.mini h4 { margin: 0 0 3px; font-size: 0.88rem; font-weight: 600; }
.product-card.mini .pc-price { font-size: 0.95rem; padding: 0; }
.msg--typing .bubble { color: var(--muted, #6d6d75); font-style: italic; }
.msg--typing .bubble::after {
  content: '···';
  display: inline-block;
  margin-left: 4px;
  letter-spacing: 2px;
  animation: typing-dots 1.1s ease-in-out infinite;
}
@keyframes typing-dots { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chat-form { margin-top: 14px; }
.chat-form .btn-primary[disabled] { opacity: 0.6; cursor: wait; }

/* ── Рекомендации анкеты: строка «как на маркетплейсе» — фото слева, инфо справа ── */
.rec-list { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.rec-card {
  display: flex;
  align-items: stretch;
  gap: 18px;
  background: #fff;
  border: 1px solid var(--line, #ececef);
  border-radius: 16px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow, 0 1px 2px rgba(20, 20, 43, 0.04));
  transition: border-color .15s ease;
}
.rec-card:hover { border-color: var(--accent, #7c5cff); }
.rec-card__img {
  flex: none;
  width: 150px;
  height: 112px;
  border: 1px solid var(--line, #ececef);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  align-self: center;
}
.rec-card__img img { width: 100%; height: 100%; object-fit: contain; }
.rec-card__img svg { width: 62%; color: #c7c7d0; }
.rec-card__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rec-card h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.rec-card .pc-specs { margin: 0; }
/* страховка от неразрывных кусков (парт-номера, «от 209 000 ₽»): слово
   длиннее строки переносится по символам, а не растягивает карточку */
.rec-card h3, .rec-card .pc-specs li, .rec-card__why, .rec-card .pc-price {
  overflow-wrap: anywhere;
}
.rec-card__why {
  font-size: 0.83rem;
  color: var(--muted, #6d6d75);
  line-height: 1.45;
}
.rec-card__why::before { content: '✔ '; color: #2e9e5b; }
.rec-card__side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  min-width: 130px;
}
.rec-card .pc-price { font-size: 1.15rem; font-weight: 700; }
.rec-card__go { font-size: 0.85rem; color: var(--accent, #7c5cff); font-weight: 600; }
@media (max-width: 560px) {
  /* цена с неразрывными пробелами не сжимается — на узких экранах
     переносим её под карточку на всю ширину, текст получает всё место */
  .rec-card { flex-wrap: wrap; gap: 10px 12px; padding: 12px; }
  .rec-card__img { width: 96px; height: 74px; }
  .rec-card__body { flex: 1 1 calc(100% - 108px); }
  .rec-card__side {
    order: 3;
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    align-items: baseline;
    gap: 12px;
  }
  .rec-card .pc-price { font-size: 1.05rem; }
  .rec-card__go { display: none; }
}

/* Карточка ответа чата с кнопкой сравнения */
.mini-card-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.mini-card-wrap .product-card.mini { min-width: 0; }
.mini-cmpform { margin: 0; }
.mini-cmp {
  padding: 7px 12px;
  border: 1px solid var(--line, #ececef);
  border-radius: 10px;
  background: #fff;
  color: var(--ink, #161616);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.mini-cmp:hover { border-color: #A85CFF; color: #A85CFF; }
