/* ============================================================
   Mind Group — страницы тестов (hub + runner)
   ============================================================ */

.tests-page { background: var(--cream); min-height: 100vh; display: flex; flex-direction: column; }
.tests-page .nav { position: sticky; }
.tests-page main { flex: 1; }

/* ---------- HUB ---------- */
.thub { padding: 70px 0 90px; position: relative; overflow: hidden; }
.thub::before { content: ""; position: absolute; top: -160px; right: -140px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(111,185,143,.3), transparent 70%); pointer-events: none; }
.thub__head { text-align: center; max-width: 640px; margin: 0 auto 56px; position: relative; }
.thub__title { font-size: clamp(26px, 7.2vw, 64px); font-weight: 800; margin: 10px 0 18px; overflow-wrap: break-word; }
.thub__title .grad { background: var(--grad-sun); -webkit-background-clip: text; background-clip: text; color: transparent; }
.thub__lead { font-size: 18px; color: var(--ink-soft); }

.tgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; max-width: 920px; margin: 0 auto; }
.tcard-test { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm); transition: transform .35s var(--ease), box-shadow .35s; position: relative; overflow: hidden; }
.tcard-test:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.tcard-test--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 26px; background: linear-gradient(135deg, var(--white) 55%, var(--cream-2)); }
.tcard-test--wide .tcard-test__body { flex: 1; }
.tcard-test__emoji { font-size: 44px; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 22px; background: var(--cream-2); flex-shrink: 0; color: var(--peach-d); font-weight: 700; line-height: 1; }
.tcard-test h2 { font-size: 21px; margin-bottom: 2px; }
.tcard-test__sub { font-size: 13px; font-weight: 700; color: var(--peach-d); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.tcard-test p { color: var(--ink-soft); font-size: 14.5px; }
.tcard-test__meta { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.tcard-test .btn { align-self: flex-start; margin-top: auto; }
.thub__note { text-align: center; max-width: 560px; margin: 44px auto 0; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- RUNNER ---------- */
.trun { padding: 60px 0 90px; }
.trun__container { max-width: 720px; }
.trun__card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 44px 44px 40px; box-shadow: var(--shadow-lg); min-height: 420px; }

.trun__intro { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.trun__emoji { font-size: 64px; color: var(--peach-d); font-weight: 700; line-height: 1; }
.trun__intro h1 { font-size: clamp(28px, 4vw, 40px); }
.trun__intro p { color: var(--ink-soft); max-width: 480px; font-size: 16px; }
.trun__warn { background: var(--cream-2); border-radius: var(--r); padding: 14px 18px; font-size: 14px !important; }
.trun__intro .btn { margin-top: 12px; }

.trun__bar { height: 8px; background: var(--cream-2); border-radius: 100px; overflow: hidden; }
.trun__bar-fill { height: 100%; background: var(--grad-sun); border-radius: 100px; transition: width .4s var(--ease); }
.trun__count { text-align: right; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 8px 0 22px; }
.trun__q { font-size: clamp(20px, 3vw, 27px); margin-bottom: 22px; text-align: center; }
.trun__hint { text-align: center; color: var(--ink-soft); margin: -12px 0 22px; font-size: 15px; }
.trun__opts { display: grid; gap: 12px; }
.topt { padding: 17px 22px; border: 2px solid var(--line); border-radius: var(--r); background: var(--cream); font-family: inherit; font-weight: 600; font-size: 15.5px; color: var(--ink); text-align: left; cursor: pointer; transition: .2s var(--ease); }
.topt:hover { border-color: var(--peach-d); background: var(--cream-2); transform: translateY(-2px); }
.trun__back { margin-top: 18px; }

/* Rorschach blot */
.blot { width: 230px; height: 230px; display: block; margin: 0 auto 6px; filter: drop-shadow(0 10px 24px rgba(2,28,30,.18)); }

/* assoc grid */
.assoc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.assoc-grid input { padding: 12px 12px; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--cream); font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); outline: none; transition: border-color .2s; min-width: 0; }
.assoc-grid input:focus { border-color: var(--peach-d); background: #fff; }
.assoc-submit { grid-column: 1 / -1; justify-self: center; margin-top: 10px; }

/* valence list */
.val-list { display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 6px; margin-bottom: 20px; }
.val-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--cream); }
.val-word { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.val-btns { display: flex; gap: 4px; flex-shrink: 0; }
.val-btns button { width: 38px; height: 38px; border: 2px solid transparent; border-radius: 12px; background: none; font-size: 19px; cursor: pointer; transition: .15s; }
.val-btns button:hover { background: var(--cream-2); }
.val-btns button.on { border-color: var(--peach-d); background: var(--cream-2); }

/* luscher swatches */
.color-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 460px; margin: 0 auto; }
.swatch { aspect-ratio: 1; border: none; border-radius: 20px; cursor: pointer; box-shadow: 0 8px 20px rgba(2,28,30,.18); transition: transform .2s var(--ease), box-shadow .2s; }
.swatch:hover { transform: translateY(-5px) scale(1.04); box-shadow: 0 14px 30px rgba(2,28,30,.28); }

/* AI thinking */
.ai-think { text-align: center; padding: 70px 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.ai-orb { width: 86px; height: 86px; border-radius: 50%; background: var(--grad-sun); animation: orbPulse 1.6s ease-in-out infinite; box-shadow: 0 0 60px rgba(111,185,143,.6); }
.ai-think h2 { font-size: 24px; }
.ai-think p { color: var(--ink-soft); font-weight: 600; }
@keyframes orbPulse { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(.86); opacity: .75 } }

/* AI result */
.ai-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 100px; background: var(--grad-sun); color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 18px; }
.ai-head { font-size: clamp(26px, 4vw, 38px); margin-bottom: 6px; }
.ai-sub { font-weight: 700; color: var(--peach-d); font-size: 17px; margin-bottom: 22px; }
.ai-score { height: 12px; background: var(--cream-2); border-radius: 100px; overflow: hidden; margin-bottom: 24px; }
.ai-score-fill { height: 100%; background: var(--grad-sun); border-radius: 100px; transition: width 1s var(--ease); }
.ai-par { color: var(--ink); font-size: 15.5px; line-height: 1.65; margin-bottom: 14px; opacity: 0; animation: parIn .6s var(--ease) forwards; }
.ai-par strong { color: var(--terra); }
@keyframes parIn { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
.ai-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 16px; }
.ai-saved { margin: 18px 0 0; padding: 12px 16px; background: var(--cream-2); border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--ink); }
.ai-saved a { color: var(--peach-d); font-weight: 700; }
.ai-disclaimer { font-size: 12.5px; color: var(--ink-soft); margin-top: 14px; }

/* responsive */
@media (max-width: 760px) {
  .tgrid { grid-template-columns: 1fr; }
  .tcard-test--wide { flex-direction: column; align-items: flex-start; }
  .trun__card { padding: 28px 20px; }
  .assoc-grid { grid-template-columns: repeat(2, 1fr); }
  .color-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .blot { width: 180px; height: 180px; }
}
