/* Hil Studio — стилі багатокрокових брифів (статична версія)
   ver 250826/20.40/1

   Кольори НЕ хардкодяться: усе тягнеться зі змінних сайту, тому брифи
   автоматично підхоплюють перемикач світлої/темної теми, як решта сторінок.
   Запасні значення у var(...) другим аргументом — щоб сторінка лишалась читабельною,
   навіть якщо основний css чомусь не підвантажився.

   Контракт зі змінними сайту (мають бути визначені в css/main-<hash>.css):
     --surface  фон секції        --text     основний текст
     --muted    другорядний текст --line     тонкі рамки/розділювачі
     --card     фон картки        --red      акцент (#d92028)
     --blue     другорядний акцент (#1757f1)
*/

.hs-brief {
  --hs-red:        var(--red,   #d92028);
  /* hover рахуємо з основного акценту — окрема змінна не потрібна */
  --hs-red-dark:   color-mix(in srgb, var(--red, #d92028) 82%, #000);
  --hs-blue:       var(--blue,  #1757f1);
  --hs-bg:         var(--surface, #ebebe9);
  --hs-card:       var(--card,  #ffffff);
  --hs-text:       var(--text,  #090d1a);
  --hs-muted:      var(--muted, #6b6f7a);
  --hs-border:     var(--line,  #dcdcd8);

  background: var(--hs-bg);
  color: var(--hs-text);
  padding: 56px 20px 80px;
  box-sizing: border-box;
  font-family: inherit;            /* Montserrat приходить із main.css */
}
.hs-brief *, .hs-brief *::before, .hs-brief *::after { box-sizing: border-box; }
.hs-brief a { color: inherit; text-decoration: none; }

.hs-wrap { max-width: 760px; margin: 0 auto; }

/* ---------- Вступ ---------- */
.hs-intro .hs-mega {
  font-size: clamp(34px, 9vw, 55px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.hs-intro .hs-lead {
  font-size: clamp(24px, 6vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 14px;
}
.hs-intro p {
  font-size: clamp(14px, 3.6vw, 18px);
  line-height: 1.55;
  color: var(--hs-muted);
  max-width: 62ch;
  margin: 0 0 20px;
}
.hs-warning {
  border-left: 3px solid var(--hs-red);
  padding: 10px 0 10px 14px;
  margin: 0 0 28px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--hs-muted);
}

/* ---------- Картка форми ---------- */
.hs-card {
  background: var(--hs-card);
  border: 1px solid var(--hs-border);
  border-radius: 18px;
  overflow: hidden;
}
.hs-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 28px 0;
}
.hs-step-title-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hs-red);
  margin: 0;
}
.hs-step-count {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--hs-muted);
  margin: 0;
  white-space: nowrap;
}

/* Прогрес: сегмент на крок. Анімуємо лише background-color. */
.hs-progress-track {
  display: flex;
  gap: 4px;
  padding: 14px 28px 0;
}
.hs-progress-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--hs-border);
  transition: background-color 0.25s ease;
}
.hs-progress-seg.done { background: var(--hs-red); }

form.hs-form { padding: 8px 28px 30px; }

/* ---------- Поля ---------- */
.hs-step { display: none; border: 0; padding: 0; margin: 0; }
.hs-step.active { display: block; }

.hs-field { margin: 22px 0 0; }
.hs-field > label,
.hs-group > label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 6px;
}
.hs-req { color: var(--hs-red); margin-left: 2px; }
.hs-hint {
  font-size: 13px;
  line-height: 1.45;
  color: var(--hs-muted);
  margin: 0 0 8px;
}

.hs-brief input[type="text"],
.hs-brief input[type="email"],
.hs-brief input[type="tel"],
.hs-brief input[type="url"],
.hs-brief textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--hs-text);
  background: var(--hs-bg);
  border: 1px solid var(--hs-border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hs-brief textarea { min-height: 96px; resize: vertical; }
.hs-brief input:focus,
.hs-brief textarea:focus {
  outline: none;
  border-color: var(--hs-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hs-red) 18%, transparent);
}
.hs-brief ::placeholder { color: var(--hs-muted); opacity: 0.75; }

/* ---------- Чекбокси / радіо ---------- */
.hs-options { display: flex; flex-direction: column; gap: 8px; }
.hs-check, .hs-radio { display: block; cursor: pointer; }
.hs-check input, .hs-radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.hs-opt-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--hs-border);
  border-radius: 10px;
  background: var(--hs-bg);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.hs-opt-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--hs-border);
  border-radius: 5px;
  background: var(--hs-card);
  position: relative;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.hs-radio .hs-opt-icon, .hs-check-circle .hs-opt-icon { border-radius: 50%; }
.hs-opt-text { font-size: 14.5px; line-height: 1.4; }

.hs-check input:checked + .hs-opt-row,
.hs-radio input:checked + .hs-opt-row {
  border-color: var(--hs-red);
  background: color-mix(in srgb, var(--hs-red) 7%, transparent);
}
.hs-check input:checked + .hs-opt-row .hs-opt-icon,
.hs-radio input:checked + .hs-opt-row .hs-opt-icon {
  border-color: var(--hs-red);
  background: var(--hs-red);
}
.hs-check input:checked + .hs-opt-row .hs-opt-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.hs-radio input:checked + .hs-opt-row .hs-opt-icon::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}
.hs-check input:focus-visible + .hs-opt-row,
.hs-radio input:focus-visible + .hs-opt-row {
  outline: 2px solid var(--hs-red);
  outline-offset: 2px;
}

.hs-group.hs-error .hs-opt-row { border-color: var(--hs-red); }
.hs-error-msg { display: none; font-size: 13px; color: var(--hs-red); margin: 6px 0 0; }
.hs-group.hs-error .hs-error-msg { display: block; }

/* ---------- Шкала Лікерта ---------- */
.hs-likert-legend-head {
  font-size: 13px;
  color: var(--hs-muted);
  margin: 0 0 10px;
  line-height: 1.45;
}
.hs-likert-field { margin: 26px 0 0; }
.hs-likert-text { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 10px; }
.hs-options.hs-likert-scale { flex-direction: row; gap: 6px; }
.hs-likert-opt { flex: 1; cursor: pointer; }
.hs-likert-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.hs-likert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  border: 1px solid var(--hs-border);
  border-radius: 10px;
  background: var(--hs-bg);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.hs-likert-opt input:checked + .hs-likert-icon {
  border-color: var(--hs-red);
  background: var(--hs-red);
  color: #fff;
}
.hs-likert-opt input:focus-visible + .hs-likert-icon {
  outline: 2px solid var(--hs-red);
  outline-offset: 2px;
}

/* ---------- Навігація ---------- */
.hs-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 0 0;
  margin: 26px 0 0;
  border-top: 1px solid var(--hs-border);
}
.hs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.hs-btn:disabled { opacity: 0.6; cursor: default; }
.hs-btn-primary { background: var(--hs-red); color: #fff; margin-left: auto; }
.hs-btn-primary:hover:not(:disabled) { background: var(--hs-red-dark); }
.hs-btn-ghost { background: transparent; border-color: var(--hs-border); color: var(--hs-text); }
.hs-btn-ghost:hover { border-color: var(--hs-text); }
.hs-btn[hidden] { display: none; }

.hs-privacy { font-size: 12.5px; line-height: 1.5; color: var(--hs-muted); margin: 16px 0 0; }
.hs-privacy a { text-decoration: underline; }

/* ---------- Помилка та екран подяки ---------- */
.hs-banner {
  display: none;
  border: 1px solid var(--hs-red);
  background: color-mix(in srgb, var(--hs-red) 8%, transparent);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.5;
}
.hs-banner.show { display: block; }
.hs-banner a { text-decoration: underline; }

.hs-done { display: none; text-align: center; padding: 60px 20px; }
.hs-done.show { display: block; }
.hs-done-title { font-size: clamp(24px, 6vw, 34px); font-weight: 800; margin: 0 0 10px; }
.hs-done p { font-size: 16px; line-height: 1.55; color: var(--hs-muted); margin: 0 auto; max-width: 52ch; }

/* ---------- Результат тесту на архетипи ---------- */
.hs-archetype-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0 0;
  text-align: left;
}
.hs-archetype-col {
  background: var(--hs-card);
  border: 1px solid var(--hs-border);
  border-radius: 14px;
  padding: 14px 16px 20px;
  overflow: hidden;
}
.hs-archetype-media {
  width: calc(100% + 32px);
  margin: -14px -16px 14px;
  overflow: hidden;
  line-height: 0;
}
/* aspect-ratio тримає місце під картинку до її завантаження — без стрибка CLS */
.hs-archetype-img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; }
.hs-archetype-rank {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hs-muted);
  margin: 0 0 6px;
}
.hs-archetype-score { font-size: 12.5px; font-weight: 700; color: var(--hs-blue); margin: 0 0 10px; }
.hs-archetype-desc { font-size: 12.5px; line-height: 1.5; color: var(--hs-muted); margin: 0; }
.hs-archetype-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--hs-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

/* ---------- Адаптив ---------- */
@media (max-width: 880px) {
  .hs-archetype-result { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hs-brief { padding: 36px 14px 64px; }
  form.hs-form { padding: 6px 20px 28px; }
  .hs-card-head { padding: 18px 20px 0; flex-wrap: wrap; row-gap: 6px; }
  .hs-progress-track { padding: 12px 20px 0; }
  .hs-nav { flex-wrap: wrap; }
  .hs-btn { width: 100%; }
  .hs-btn-primary { margin-left: 0; order: -1; }
  .hs-options.hs-likert-scale { gap: 4px; }
  .hs-likert-icon { min-height: 44px; font-size: 10px; padding: 4px 2px; }
  .hs-archetype-result { grid-template-columns: 1fr; }
}

/* Повага до системного налаштування «менше руху» */
@media (prefers-reduced-motion: reduce) {
  .hs-brief *, .hs-brief *::before, .hs-brief *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


/* --- зони дотику на сенсорних екранах (мін. 44x44 за рекомендаціями) --- */
@media (max-width:900px){
  /* бургер був 40x34 */
  .burger{padding:10px 8px;min-width:44px;min-height:44px;justify-content:center;align-items:center}
}
/* крапки каруселі: сама крапка лишається 9px, а зона дотику 28x28 */
.reviews__dot{position:relative}
.reviews__dot::after{content:"";position:absolute;left:50%;top:50%;width:28px;height:28px;transform:translate(-50%,-50%)}


/* --- пункти меню в бургері: були 20px заввишки при відступі 16px між ними,
   тож половина дотиків припадала на порожнє місце між пунктами --- */
@media (max-width:900px){
  .nav ul{gap:4px}
  .nav a{display:block;padding:10px 0}
  .nav a::after{bottom:4px}
}


/* --- поля форм на телефоні: Safari на iOS сам наближає сторінку, коли
   стає у поле з шрифтом дрібнішим за 16px, і назад уже не віддаляє --- */
@media (max-width:900px){
  .form input[type=text],.form input[type=email],.form input[type=tel],.form textarea,
  .yourcase__form input[type=text],.yourcase__form input[type=tel],
  .hs-brief input[type="text"],.hs-brief input[type="email"],.hs-brief input[type="tel"],
  .hs-brief input[type="number"],.hs-brief input[type="url"],.hs-brief textarea,
  .hs-brief select{font-size:16px}
}


/* Помилка на прихованому полі (чекбокс згоди): блок підсвічується так само,
   як група варіантів, і показує текст — інакше людина не бачить причини,
   чому крок не гортається. */
.hs-field.hs-error .hs-opt-row { border-color: var(--hs-red); }
.hs-field.hs-error .hs-error-msg { display: block; }


/* Умовне питання, яке зараз не показується. Без явного правила [hidden] тут
   не спрацював би: у .hs-field задано margin, і браузерний display:none
   легко перекрити — на пагінації блогу ця пастка вже колись спрацювала. */
.hs-field[hidden] { display: none; }


/* --- плаваючі кнопки однакової форми --- */
/* Кнопка «вгору» була квадратом 42x42 зі скругленням 8px, кнопка Telegram —
   колом 52x52. Поруч у кутку екрана вони читались як дві різні речі.
   Тепер обидві — коло 52x52; підпис Telegram і далі розкривається на наведення. */
.to-top{
  width:52px;height:52px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:19px;line-height:1;
}
.tg-fab{height:52px;width:52px;padding:0;justify-content:center}
.tg-fab:hover{width:auto;padding:0 16px;justify-content:flex-start}
@media (max-width:560px){
  .tg-fab:hover{width:52px;padding:0;justify-content:center;gap:0}
  .tg-fab:hover .tg-fab__label{max-width:0;opacity:0}
}
