/* Квиз «Подбери услугу» на главной (патч 99). Дополняет main.css (переменные, .section, .btn, .card__badge). */
.quiz-wrap{ scroll-margin-top:var(--header-h, 88px); }
#quiz{ scroll-margin-top:calc(var(--header-h, 88px) - 10px); }
.quiz-wrap .section{ padding-top:70px; padding-bottom:70px; }

.quiz{
  position:relative; max-width:760px; margin:0 auto;
  background:#fff; border:1.5px solid var(--line); border-radius:28px;
  padding:26px 28px 30px; box-shadow:0 22px 50px -34px rgba(92,0,115,.55);
  min-height:360px;
}
.quiz__nojs{ margin:0; font-weight:700; }

/* Верх: полоса прогресса, номер вопроса, «Назад» */
.quiz__top{ display:flex; align-items:center; gap:14px; margin-bottom:22px; }
.quiz__back{
  flex:none; display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:50%; border:1.5px solid var(--line); background:#fff; color:var(--ink);
  cursor:pointer; transition:border-color .15s, background .15s; padding:0;
}
.quiz__back:hover{ border-color:var(--ink); }
.quiz__back[hidden]{ display:none; }
.quiz__bar{ flex:1; height:12px; border-radius:999px; background:var(--blush); overflow:hidden; }
.quiz__bar i{
  display:block; height:100%; width:0; border-radius:999px;
  background:var(--green); transition:width .35s ease;
}
.quiz__count{ flex:none; font-family:'Raleway',sans-serif; font-weight:700; font-size:14px; color:var(--grey); min-width:64px; text-align:right; }

/* Вопрос: аватар и «реплика» */
.quiz__ask{ display:flex; align-items:flex-start; gap:14px; margin-bottom:20px; }
.quiz__avatar{
  flex:none; width:58px; height:58px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; font-size:30px; line-height:1;
  background:var(--blush); border:2px solid var(--mole);
}
.quiz__bubble{
  position:relative; background:var(--blush-2); border:1.5px solid var(--line); border-radius:6px 20px 20px 20px;
  padding:14px 18px; font-family:'Raleway',sans-serif; font-weight:800; font-size:clamp(19px, 2.4vw, 24px); line-height:1.25;
  outline:none;
}

/* Варианты ответов */
.quiz__answers{ display:grid; gap:10px; }
.quiz__ans{
  text-align:left; font-family:'Raleway',sans-serif; font-weight:600; font-size:17px; line-height:1.35; color:var(--ink);
  background:#fff; border:1.5px solid var(--line); border-bottom-width:4px; border-radius:16px; padding:14px 18px; cursor:pointer;
  transition:border-color .15s, background .15s, transform .12s;
}
.quiz__ans:hover{ border-color:var(--purple); background:var(--blush-2); }
.quiz__ans:active{ transform:translateY(2px); border-bottom-width:2px; margin-top:2px; }
.quiz__ans--picked{ border-color:var(--green); background:#effbf2; }
.quiz__ans:focus-visible, .quiz__back:focus-visible{ outline:3px solid var(--amber); outline-offset:2px; }

/* Результат */
.quiz__result-title{
  font-family:'Raleway',sans-serif; font-weight:800; font-size:clamp(20px, 2.6vw, 26px); margin:0 0 16px; outline:none;
}
.quiz__rcard{
  border:1.5px solid var(--purple); border-radius:22px; padding:22px 22px 20px; background:var(--blush-2);
  display:flex; flex-direction:column; gap:10px;
}
.quiz__rcard h3{ margin:0; font-family:'Raleway',sans-serif; font-weight:800; font-size:clamp(21px, 2.6vw, 27px); line-height:1.15; }
.quiz__rcard p{ margin:0; color:var(--grey); line-height:1.55; }
.quiz__price{ font-family:'Raleway',sans-serif; font-weight:800; font-size:24px; color:var(--purple); }
.quiz__approx{ margin-top:-4px; font-family:'Raleway',sans-serif; font-size:11px; font-weight:600; letter-spacing:.06em; color:var(--purple); opacity:.6; }
.quiz__btns{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:6px; }
.quiz__note{ margin:14px 2px 0; color:var(--grey); font-size:14.5px; line-height:1.5; }
.quiz__restart{
  margin-top:14px; background:none; border:none; padding:6px 2px; cursor:pointer;
  font-family:'Raleway',sans-serif; font-weight:700; font-size:15px; color:var(--grey); text-decoration:underline;
}
.quiz__restart:hover{ color:var(--ink); }

/* Смена экранов */
.quiz__screen{ animation:quizIn .28s ease both; }
@keyframes quizIn{ from{ opacity:0; transform:translateX(14px); } to{ opacity:1; transform:none; } }
.quiz__screen--back{ animation-name:quizInBack; }
@keyframes quizInBack{ from{ opacity:0; transform:translateX(-14px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce){
  .quiz__screen, .quiz__screen--back{ animation:none; }
  .quiz__bar i{ transition:none; }
}

@media (max-width:640px){
  .quiz{ padding:18px 16px 22px; border-radius:22px; min-height:0; }
  .quiz__avatar{ width:46px; height:46px; font-size:24px; }
  .quiz__ans{ font-size:16px; padding:13px 15px; }
  .quiz__rcard{ padding:18px 16px 16px; }
  .quiz-wrap .section{ padding-top:48px; padding-bottom:48px; }
}
