:root {
  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --ink: #16161A;
  --muted: #77767C;
  --line: #ECEBE6;
  --blue: #2340D8;
  --blue-dark: #12215F;
  --blue-soft: rgba(35, 64, 216, .10);
  --lime-soft: rgba(163, 230, 53, .24);
  --lime-line: rgba(118, 190, 30, .75);
  --gray-btn: #EFEEEA;
  --red: #E5322D;
  --red-soft: rgba(229, 50, 45, .07);
  --yellow: #FFD233;
  --coral: #FF6B4A;
  --radius: 22px;
  --tile: #F3F3EF;
  --header-h: 68px;
  --display: "Unbounded", system-ui, sans-serif;
  --text: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- header / footer ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); width: 100%;
  padding: 0 max(clamp(16px, 4vw, 48px), calc((100% - 1240px) / 2 + clamp(16px, 4vw, 48px)));
  background: rgba(250, 250, 247, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease;
}
.top.scrolled { border-bottom-color: var(--line); }
.logo {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  text-decoration: none; letter-spacing: -.02em;
}
.logo span { color: var(--blue); }
#nav { display: flex; gap: 8px; align-items: center; }
.nav-link {
  text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 10px 16px; border-radius: 999px; background: transparent; border: 0; cursor: pointer;
}
.nav-link:hover { background: var(--gray-btn); }
.nav-user { font-weight: 600; color: var(--muted); font-size: 14px; padding: 0 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 48px) 64px; }
.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: 1240px; width: 100%; margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px); color: var(--muted); font-size: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- type ---------- */
.display {
  font-family: var(--display); font-weight: 700; letter-spacing: -.04em;
  font-size: clamp(44px, 8.4vw, 108px); line-height: .98; margin: 0;
}
.display .accent { color: var(--blue); }
.h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.03em; line-height: 1.05; margin: 0 0 12px; }
.h3 { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -.02em; margin: 0 0 10px; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 620px; margin: 24px 0 0; }
.label {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 16px; padding: 16px 28px; min-height: 54px;
  transition: transform .12s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover:not(:disabled) { background: var(--blue-dark); }
.btn-gray { background: var(--gray-btn); color: var(--ink); }
.btn-gray:hover:not(:disabled) { background: #E4E3DE; }
.btn-ghost { background: transparent; border: 1px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn .arrow { font-size: 20px; line-height: 1; }

/* ---------- messages ---------- */
.msg-error {
  background: var(--red-soft); color: var(--red);
  border-radius: 14px; padding: 14px 18px; font-weight: 600; margin-top: 18px;
}
.msg-error:empty { display: none; }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; padding: 48px 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }
.shapes { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; justify-self: end; }
.shape { position: absolute; }
.shape.s1 { width: 62%; aspect-ratio: 1; border-radius: 50%; background: var(--blue); top: 4%; left: 6%; }
.shape.s2 { width: 44%; aspect-ratio: 1; background: var(--yellow); border-radius: 28px; right: 2%; top: 30%; transform: rotate(12deg); }
.shape.s3 { width: 38%; aspect-ratio: 1; background: var(--coral); bottom: 2%; left: 22%; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.shape.s4 { width: 16%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); right: 18%; top: 4%; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.fact { background: var(--surface); border-radius: var(--radius); padding: 28px; }
.fact b { display: block; font-family: var(--display); font-weight: 600; font-size: 44px; letter-spacing: -.03em; line-height: 1; margin-bottom: 10px; }
.fact:nth-child(1) b { color: var(--blue); }
.fact:nth-child(2) b { color: var(--coral); }
.fact:nth-child(3) b { color: #16A34A; }
.fact span { color: var(--muted); font-weight: 500; }

.how { margin-top: 72px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.how-step { border-top: 1px solid var(--line); padding-top: 18px; }
.how-step .n { font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--blue); }
.how-step p { margin: 8px 0 0; font-weight: 500; }

/* ---------- auth ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 460px; gap: 48px; align-items: start; padding-top: 32px; }
.card { background: var(--surface); border-radius: 28px; padding: clamp(24px, 4vw, 40px); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--tile); border-radius: 999px; padding: 5px; margin-bottom: 28px; }
.tab { border: 0; background: transparent; border-radius: 999px; padding: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.input {
  width: 100%; border: 1px solid transparent; background: var(--tile); border-radius: 16px;
  padding: 16px 18px; font: inherit; font-weight: 500; outline: none; transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--blue); background: #fff; }
.input::placeholder { color: #A9A8AD; }
.field-err { color: var(--red); font-size: 13px; font-weight: 600; margin-top: 6px; }
.field-err:empty { display: none; }
.field-err-center { text-align: center; margin-top: -8px; }
.input.invalid { border-color: var(--red); background: #fff; }
.consent.invalid input { outline: 1px solid var(--red); outline-offset: 1px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.ts-box { min-height: 70px; margin: 8px 0 18px; display: flex; justify-content: center; }
.auth-card .btn { width: 100%; }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; margin-top: 16px; font-weight: 500; }

/* ---------- start screen ---------- */
.start { max-width: 760px; padding-top: 40px; }
.start .btn { margin-top: 28px; }

/* ---------- test ---------- */
.test { max-width: 980px; margin: 0 auto; padding-top: 8px; }
.dots {
  position: sticky; top: var(--header-h); z-index: 40;
  display: grid; grid-template-columns: repeat(15, 1fr); gap: 8px;
  margin: 0 -8px 32px; padding: 12px 8px;
  background: rgba(250, 250, 247, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
@media (min-width: 1100px) { .dots { grid-template-columns: repeat(30, 1fr); gap: 6px; } }
.dot {
  aspect-ratio: 1; width: 100%; max-width: 44px; justify-self: center;
  border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: var(--blue-soft); color: var(--blue);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
  transition: transform .12s ease, background .15s ease;
}
.dot:hover { transform: scale(1.12); }
.dot.answered { background: var(--blue-dark); color: #fff; }
.dot.current { outline: 1px solid var(--ink); outline-offset: 3px; }
.dot.missing { background: rgba(229, 50, 45, .16); color: var(--red); }

.q-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.q-num { font-family: var(--display); font-weight: 500; font-size: 15px; }
.q-num b { color: var(--blue); }
.q-text {
  font-family: var(--display); font-weight: 600; letter-spacing: -.03em; line-height: 1.15;
  font-size: clamp(26px, 4vw, 44px); margin: 0 0 14px; min-height: 2.3em;
}
.q-hint { color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 22px; }
.q-anim { animation: qin .28s ease; }
@keyframes qin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt {
  text-align: left; border: 1px solid transparent; background: var(--surface); border-radius: 20px;
  padding: 20px 22px; cursor: pointer; font-weight: 500; font-size: 17px; line-height: 1.35;
  display: flex; gap: 14px; align-items: flex-start; min-height: 84px;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.opt:hover { background: #F6F6F2; }
.opt:active { transform: scale(.985); }
.opt .key {
  flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--tile);
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--muted);
}
.opt.selected, .opt.selected:hover { background: var(--lime-soft); border-color: var(--lime-line); }
.opt.selected .key { background: #7CC520; color: #fff; }
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; }
.q-nav-right { display: flex; gap: 12px; margin-left: auto; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: rgba(229, 50, 45, .13); }
.invisible { visibility: hidden; }
.narrow { display: none; }
.q-nav .btn { min-width: 160px; }

/* ---------- loading ---------- */
.loading { text-align: center; padding: 80px 0; }
.loader { display: inline-flex; gap: 12px; margin-bottom: 36px; }
.loader i { width: 22px; height: 22px; display: block; animation: bounce 1.2s ease-in-out infinite; }
.loader i:nth-child(1) { background: var(--blue); border-radius: 50%; }
.loader i:nth-child(2) { background: var(--yellow); border-radius: 6px; animation-delay: .15s; }
.loader i:nth-child(3) { background: var(--coral); clip-path: polygon(50% 0, 100% 100%, 0 100%); animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-22px); } }
.loading-text { color: var(--muted); font-weight: 500; margin-top: 12px; min-height: 1.5em; transition: opacity .3s; }

/* ---------- aurora result ---------- */
/* без обводки: только мягкое переливающееся свечение вокруг блока */
.aurora {
  --c1: #2340D8; --c2: #14B8A6; --c3: #A855F7; --c4: #2340D8;
  position: relative; border-radius: 30px; isolation: isolate;
}
.aurora::before {
  content: ""; position: absolute; inset: -14px; z-index: -1; border-radius: 48px;
  background: linear-gradient(115deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c1));
  background-size: 300% 300%; animation: aurora 9s ease-in-out infinite, glow 6s ease-in-out infinite;
  filter: blur(40px); opacity: .5;
}
@keyframes aurora {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes glow { 0%, 100% { opacity: .4; transform: scale(.98); } 50% { opacity: .7; transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .aurora, .aurora::before { animation: none; } }
.aurora-inner { background: var(--surface); border-radius: 30px; padding: clamp(24px, 5vw, 56px); }

.result { max-width: 980px; margin: 24px auto 0; }
.res-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.res-arch {
  font-family: var(--display); font-weight: 700; letter-spacing: -.035em; line-height: 1.02;
  font-size: clamp(34px, 6vw, 64px); margin: 10px 0 14px;
  background: linear-gradient(100deg, var(--c1), var(--c2), var(--c3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.res-tag { font-size: clamp(18px, 2.2vw, 22px); font-weight: 600; margin: 0; }
.res-summary { font-size: 18px; margin: 28px 0 0; max-width: 760px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; }
.colors-note { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 760px; }

.sec { margin-top: 48px; }
.sec-title { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; margin: 0 0 18px; }
.bars { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 170px 1fr 44px; gap: 14px; align-items: center; font-weight: 500; font-size: 15px; }
.bar-track { height: 10px; background: var(--tile); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c1), var(--c2)); width: 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.bar-val { text-align: right; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile { background: var(--tile); border-radius: 20px; padding: 22px; }
.tile h4 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.tile p { margin: 0; color: #3A3A40; }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.list li { background: var(--tile); border-radius: 16px; padding: 14px 18px; font-weight: 500; display: flex; gap: 12px; }
.list li::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--c1); }
.list.growth li::before { background: var(--c3); border-radius: 3px; }
.list.steps { counter-reset: s; }
.list.steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; margin: 0; border-radius: 9px; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; }

.profs { display: grid; gap: 12px; }
.prof { background: var(--tile); border-radius: 22px; padding: 22px 24px; display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
.prof-n { font-family: var(--display); font-weight: 600; font-size: 26px; color: var(--c1); line-height: 1.1; }
.prof h4 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.prof .field { color: var(--muted); font-weight: 700; font-size: 14px; margin: 4px 0 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.prof p { margin: 0 0 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; }
.prof .path { font-size: 14px; color: var(--muted); margin-top: 10px; font-weight: 600; }

.res-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 40px; justify-content: center; }

/* ---------- cabinet ---------- */
.cab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 32px 0 36px; }
.cab-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cab-item { text-decoration: none; background: var(--surface); border-radius: 26px; padding: 26px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s ease; cursor: pointer; border: 0; text-align: left; }
.cab-item:hover { transform: translateY(-3px); }
.cab-item .strip { height: 6px; border-radius: 999px; }
.cab-item .date { color: var(--muted); font-weight: 700; font-size: 14px; }
.cab-item .arch { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; line-height: 1.1; }
.cab-item .tag { color: #4A4A50; font-weight: 500; }
.empty { background: var(--surface); border-radius: 26px; padding: 48px; text-align: center; }
.empty p { color: var(--muted); font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero, .auth-wrap { grid-template-columns: 1fr; }
  .shapes { max-width: 300px; justify-self: start; order: -1; }
  .how { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .facts { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; }
  .opt { min-height: 0; padding: 16px 18px; }
  .dots { gap: 5px; }
  .dot { font-size: 10px; }
  .q-nav .btn { min-width: 0; flex: 1; padding-left: 14px; padding-right: 14px; }
  .q-nav-right { flex: 2; }
  .q-nav .btn-danger { flex: none; font-size: 14px; }
  .q-nav .btn-gray { flex: none; width: 54px; }
  .wide { display: none; }
  .narrow { display: inline; }
  .q-nav {
    position: sticky; bottom: 0; z-index: 30; margin: 24px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(250, 250, 247, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  :root { --header-h: 60px; }
  .dots { margin: 0 -16px 24px; padding: 10px 16px; }
  .bar { grid-template-columns: 110px 1fr 36px; font-size: 13px; }
  .prof { grid-template-columns: 1fr; gap: 6px; }
  .nav-user { display: none; }
  .shapes { max-width: 220px; }
}

/* ---------- footer links ---------- */
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* ---------- consent ---------- */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 4px 0 6px; cursor: pointer; line-height: 1.45; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); cursor: pointer; }
.consent a { color: var(--ink); }

/* ---------- cabinet: active test ---------- */
.cab-active { background: var(--blue-soft); }
.cab-active .tag { color: var(--blue); }
.progress { height: 6px; border-radius: 999px; background: rgba(35, 64, 216, .14); overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 999px; }

/* ---------- legal ---------- */
.legal { max-width: 820px; padding-top: 32px; }
.legal-title { font-size: clamp(28px, 7.2vw, 64px); margin-top: 16px; overflow-wrap: break-word; hyphens: auto; }
.legal-upd { color: var(--muted); font-size: 14px; margin: 14px 0 28px; }
.legal-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 40px; }
.legal-tabs a { text-decoration: none; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px; background: var(--tile); color: var(--muted); }
.legal-tabs a.active { background: var(--ink); color: #fff; }
.legal-sec { margin-bottom: 32px; }
.legal-sec p, .legal-sec li { color: #3A3A40; }
.legal-sec p { margin: 0 0 12px; }
.legal-sec ul { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.legal-sec a { color: var(--blue); }

/* ---------- 404 ---------- */
.nf { text-align: center; padding: 56px 0 24px; }
.nf-shapes { display: flex; justify-content: center; align-items: center; gap: clamp(8px, 2vw, 20px); margin-bottom: 36px; }
.nf-4 { font-family: var(--display); font-weight: 700; font-size: clamp(110px, 20vw, 220px); line-height: .85; letter-spacing: -.05em; color: var(--ink); }
.nf-4:last-child { color: var(--blue); }
.nf-o { width: clamp(90px, 16vw, 180px); aspect-ratio: 1; border-radius: 50%; background: var(--yellow); position: relative; }
.nf-o::after { content: ""; position: absolute; width: 38%; aspect-ratio: 1; background: var(--coral); right: -8%; bottom: -6%; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
