/* ===== Хэлпи — общий стиль и анимации страниц психологических тестов =====
   Подключается ПОСЛЕ page.css. Использует переменные дизайн-системы. */

.test-wrap{ max-width:760px }

/* ---- липкий прогресс-бар прохождения ---- */
.test-progress{ position:sticky; top:8px; z-index:6; height:6px; border-radius:999px;
  background:color-mix(in srgb,var(--border) 60%,transparent); overflow:hidden; margin:6px 0 26px }
.test-progress .bar{ display:block; height:100%; width:0;
  background:linear-gradient(90deg,var(--accent),color-mix(in srgb,var(--accent) 50%,#8fbbe6));
  border-radius:999px; transition:width .45s cubic-bezier(.22,1,.36,1) }
.test-progress .pct{ position:absolute; right:0; top:10px; font-size:12px; color:var(--faint); font-weight:600 }

/* ---- ключ шкалы ответов ---- */
.scale-key{ display:flex; justify-content:space-between; gap:8px; background:var(--surface-2);
  border:.5px solid var(--border); border-radius:12px; padding:12px 16px; margin:8px 0 22px;
  font-size:13px; color:var(--muted); flex-wrap:wrap }
.scale-key b{ color:var(--head) }

/* ---- вопросы ---- */
.qz{ display:flex; flex-direction:column; gap:16px; margin:18px 0 8px }
.qcard{ background:var(--surface); border:.5px solid var(--border); border-radius:16px;
  padding:18px 20px; box-shadow:var(--sh-md); transition:border-color .25s ease, box-shadow .25s ease }
.qcard.answered{ border-color:color-mix(in srgb,var(--accent) 42%,var(--border));
  box-shadow:0 10px 30px -18px color-mix(in srgb,var(--accent) 55%,transparent),var(--sh-md) }
.qcard .qq{ font-size:16px; line-height:1.45; margin-bottom:14px; color:var(--text) }
.qcard .qq .n{ color:var(--faint); font-weight:600; margin-right:6px }
.opts{ display:grid; gap:8px }
.opt input{ position:absolute; opacity:0; width:1px; height:1px }
.opt label{ display:flex; align-items:center; gap:10px; padding:13px 16px; border:1px solid var(--border);
  border-radius:11px; font-size:15px; color:var(--text); cursor:pointer;
  transition:border-color .18s ease, background .18s ease, color .18s ease, transform .12s ease }
.opt label .dot{ flex:none; width:18px; height:18px; border-radius:50%; border:2px solid var(--border); transition:all .18s ease }
.opt label:hover{ border-color:var(--accent); transform:translateX(2px) }
.opt input:checked + label{ border-color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,transparent); color:var(--head); font-weight:500 }
.opt input:checked + label .dot{ border-color:var(--accent); background:var(--accent); box-shadow:inset 0 0 0 3px var(--surface) }
.opt input:checked + label{ animation:optPop .26s ease }
.opt input:focus-visible + label{ outline:2px solid var(--accent); outline-offset:2px }
@keyframes optPop{ 0%{transform:scale(.97)} 55%{transform:scale(1.025)} 100%{transform:scale(1)} }

/* компактная числовая раскладка (для шкал 0..4 и т.п.) можно включить классом .opts-num */
.opts-num{ grid-template-columns:repeat(var(--cols,5),1fr) }
.opts-num .opt label{ justify-content:center; width:58px; height:58px; padding:0; margin:0 auto; border-radius:16px; font-family:var(--display); font-size:21px }
.opts-num .opt label .dot{ display:none }
/* промпт-вопрос под прогресс-чёрточкой, перед шкалой */
.test-lead{ color:var(--muted); line-height:1.5; margin:2px 0 18px }

/* ---- появление вопросов со сдвигом (stagger) ---- */
html.js-on .reveal{ opacity:0; transform:translateY(18px) }
html.js-on .reveal.in{ animation:qReveal .6s cubic-bezier(.22,1,.36,1) forwards; animation-delay:var(--d,0ms) }
@keyframes qReveal{ to{ opacity:1; transform:none } }

/* ---- кнопки ---- */
.actions{ display:flex; gap:12px; flex-wrap:wrap; margin-top:22px }
.btn-pri,.btn-sec{ display:inline-flex; align-items:center; gap:9px; font:inherit; font-weight:500;
  font-size:15px; padding:13px 24px; border-radius:14px; cursor:pointer; border:.5px solid transparent;
  transition:transform .14s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease }
.btn-pri{ background:var(--accent); color:#fff; box-shadow:0 12px 28px -14px color-mix(in srgb,var(--accent) 70%,transparent) }
.btn-pri:hover{ background:var(--accent-2,#3a73a8); transform:translateY(-2px) }
.btn-sec{ background:var(--surface); border-color:var(--border); color:var(--text) }
.btn-sec:hover{ border-color:var(--accent); transform:translateY(-2px) }
.hint{ font-size:14px; color:var(--faint); margin-top:14px }

/* ---- результат ---- */
.result{ display:none; margin-top:40px; scroll-margin-top:24px }
.result.show{ display:block; animation:resIn .65s cubic-bezier(.22,1,.36,1) both }
@keyframes resIn{ from{ opacity:0; transform:translateY(26px) scale(.985) } to{ opacity:1; transform:none } }

.score-card{ position:relative; background:var(--surface); border:.5px solid var(--border);
  border-radius:22px; padding:34px 28px 30px; box-shadow:var(--sh-md); text-align:center; overflow:hidden }
.score-card .aura{ position:absolute; left:50%; top:-30%; width:340px; height:340px; transform:translateX(-50%);
  border-radius:50%; pointer-events:none; z-index:0; filter:blur(54px); opacity:.5;
  background:radial-gradient(closest-side, var(--ring-col,var(--accent)), transparent 70%) }
html.js-on .score-card .aura{ animation:auraPulse 6s ease-in-out infinite }
@keyframes auraPulse{ 0%,100%{ opacity:.4; transform:translateX(-50%) scale(1) } 50%{ opacity:.6; transform:translateX(-50%) scale(1.08) } }

/* кольцо результата */
.score-ring{ position:relative; width:176px; height:176px; margin:4px auto 6px; z-index:1 }
.score-ring svg{ width:100%; height:100%; transform:rotate(-90deg) }
.score-ring .track{ fill:none; stroke:color-mix(in srgb,var(--border) 80%,transparent); stroke-width:11 }
.score-ring .prog{ fill:none; stroke:var(--ring-col,var(--accent)); stroke-width:11; stroke-linecap:round;
  stroke-dasharray:var(--circ,471); stroke-dashoffset:var(--circ,471);
  transition:stroke-dashoffset 1.15s cubic-bezier(.22,1,.36,1) }
.score-ring .center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center }
.score-num{ font-family:var(--display); font-size:52px; line-height:1; color:var(--ring-col,var(--accent)); font-weight:600 }
.score-num small{ font-size:18px; color:var(--faint); font-weight:400 }
.score-band{ display:inline-block; margin-top:6px; font-weight:600; font-size:15px; padding:7px 18px; border-radius:999px }
.score-card .interp{ margin-top:16px; color:var(--muted); max-width:48ch; margin-left:auto; margin-right:auto; line-height:1.6; position:relative; z-index:1 }

/* крючок после результата */
.test-hook{ margin-top:18px; background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 9%,var(--surface)),var(--surface));
  border:.5px solid color-mix(in srgb,var(--accent) 28%,var(--border)); border-radius:18px; padding:22px 24px }
.test-hook h3{ font-family:var(--display); font-size:18px; color:var(--head); margin:0 0 8px }
.test-hook p{ color:var(--muted); line-height:1.55; margin:0 0 16px }
.test-hook .hook-cta{ display:flex; gap:10px; flex-wrap:wrap }
.hook-btn{ display:inline-flex; align-items:center; gap:8px; padding:12px 20px; border-radius:12px; font-weight:500; font-size:14.5px; text-decoration:none; transition:transform .14s ease, background .2s ease }
.hook-btn.primary{ background:var(--accent); color:#fff } .hook-btn.primary:hover{ transform:translateY(-2px); background:var(--accent-2,#3a73a8) }
.hook-btn.ghost{ background:var(--surface); border:.5px solid var(--border); color:var(--text) } .hook-btn.ghost:hover{ transform:translateY(-2px); border-color:var(--accent) }

/* сохранение / динамика */
.save-note{ margin-top:14px; font-size:13.5px; color:var(--faint); display:flex; align-items:center; gap:8px; justify-content:center }
.save-note.ok{ color:#1c7a4f } .save-note.guest a{ color:var(--accent); font-weight:600 }

@media (max-width:520px){ .opts-num .opt label{ width:50px; height:50px; font-size:19px } .score-ring{ width:150px; height:150px } .score-num{ font-size:44px } }
@media (prefers-reduced-motion: reduce){
  html.js-on .reveal,html.js-on .reveal.in{ animation:none!important; opacity:1!important; transform:none!important }
  .result.show{ animation:none } .score-ring .prog{ transition:none } .opt input:checked + label{ animation:none }
  html.js-on .score-card .aura{ animation:none }
}
