/* Behavioral Psychological Game — интерфейс.
   Тон спокойный и серьёзный: игра давит на человека, оформление давить не должно. */

:root {
  --bg:      #12100e;
  --bg-soft: #1a1815;
  --line:    #2c2823;
  --fg:      #ece7df;
  --fg-dim:  #9d968b;
  --accent:  #c8783c;
  --accent-soft: #3a2416;
  --err:     #d97a68;
  --radius:  10px;
  --wrap:    38rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  overflow-wrap: break-word;
}

/* ───────────────────────────────────────────── экраны */

.screen { display: none; }
.screen.active { display: block; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 4rem) 1.25rem 4rem;
}

/* ───────────────────────────────────────────── типографика */

h1 {
  font-size: clamp(1.75rem, 6vw, 2.4rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.35rem, 4.5vw, 1.7rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.lead { color: var(--fg-dim); margin-bottom: 1.75rem; }

.fine { font-size: 0.85rem; color: var(--fg-dim); margin-top: 0.7rem; }

.hint { font-size: 0.85rem; color: var(--accent); margin-top: 0.5rem; }

.err {
  font-size: 0.9rem;
  color: var(--err);
  margin-top: 0.6rem;
}

/* ───────────────────────────────────────────── буллеты лендинга */

.bullets { list-style: none; margin-bottom: 2rem; }

.bullets li {
  padding: 1rem 0 1rem 1.1rem;
  border-left: 2px solid var(--line);
  margin-bottom: 0.15rem;
  color: var(--fg-dim);
  font-size: 0.97rem;
}

.bullets b {
  display: block;
  color: var(--fg);
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 0.15rem;
}

.note {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ───────────────────────────────────────────── формы */

label {
  display: block;
  font-size: 0.87rem;
  color: var(--fg-dim);
  margin: 1.2rem 0 0.45rem;
}

input[type="text"], input:not([type]), input[type="date"], textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font: inherit;
  padding: 0.75rem 0.85rem;
  resize: vertical;
}

textarea { line-height: 1.5; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

input::placeholder, textarea::placeholder { color: #6b6459; }

#invite {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
}

.row { display: flex; gap: 0.6rem; align-items: stretch; }
.row.gap { margin-top: 1.5rem; }
.row > input, .row > textarea { flex: 1; min-width: 0; }

button {
  font: inherit;
  border: 0;
  border-radius: var(--radius);
  padding: 0.75rem 1.3rem;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

.primary { background: var(--accent); color: #17120d; font-weight: 600; }
.primary:hover:not(:disabled) { background: #d9873f; }
.primary:disabled { opacity: 0.4; cursor: not-allowed; }

.ghost {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--line);
}
.ghost:hover { color: var(--fg); }

.wide { width: 100%; margin-top: 1.5rem; }

.link {
  background: none;
  color: var(--fg-dim);
  padding: 0;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link:hover { color: var(--fg); }

.invite { margin-top: 2rem; }

/* ───────────────────────────────────────────── квиз */

.steps { display: flex; gap: 0.4rem; margin-bottom: 2rem; }
.steps span {
  height: 3px;
  flex: 1;
  background: var(--line);
  border-radius: 2px;
  transition: background .3s;
}
.steps span.on { background: var(--accent); }

.step { display: none; }
.step.active { display: block; animation: rise .25s ease-out; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.cards { display: grid; gap: 0.55rem; grid-template-columns: 1fr 1fr; }

@media (max-width: 30rem) { .cards { grid-template-columns: 1fr; } }

.cards button {
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.85rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
}
.cards button span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--fg-dim);
  margin-top: 0.2rem;
}
.cards button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.frame-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  margin-bottom: 1.75rem;
}
.frame-box p + p { margin-top: 0.8rem; }

.check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--fg-dim);
  cursor: pointer;
  margin: 0;
}
.check input { margin-top: 0.28rem; accent-color: var(--accent); flex: none; }

/* ───────────────────────────────────────────── чат */

.chat-screen.active { display: flex; flex-direction: column; height: 100dvh; }

.bar {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 1rem 0.6rem;
  background: var(--bg);
  flex: none;
}

.progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s; }

.bar-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
}

#feed {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem 1rem;
  scroll-behavior: smooth;
}

.msg {
  max-width: var(--wrap);
  margin: 0 auto 1.5rem;
  animation: rise .25s ease-out;
}

.msg.me {
  background: var(--accent-soft);
  border: 1px solid #4a2f1c;
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  color: #e8d5c4;
  font-size: 0.95rem;
}

.msg.bot h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.2rem 0 0.5rem;
}
.msg.bot h3:first-child { margin-top: 0; }
.msg.bot p { margin-bottom: 0.75rem; }
.msg.bot p:last-child { margin-bottom: 0; }
.msg.bot strong { color: #fff; font-weight: 600; }
.msg.bot em { color: var(--fg-dim); font-style: normal; }
.msg.bot hr { border: 0; border-top: 1px solid var(--line); margin: 1.3rem 0; }
.msg.bot ul { margin: 0 0 0.85rem 1.1rem; }
.msg.bot li { margin-bottom: 0.3rem; }

.opt {
  display: block;
  padding: 0.35rem 0 0.35rem 1.7rem;
  text-indent: -1.7rem;
}
.opt b { color: var(--accent); font-weight: 600; }

.typing::after {
  content: '▍';
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.composer {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: var(--bg);
}

.choices {
  max-width: var(--wrap);
  margin: 0 auto 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.choices:empty { display: none; }

.choices button {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.choices button:hover { border-color: var(--accent); color: var(--accent); }

#say {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
#input { max-height: 9rem; }
#send { flex: none; padding: 0.75rem 1.1rem; font-size: 1.1rem; line-height: 1.2; }

.composer .err { max-width: var(--wrap); margin: 0.5rem auto 0; }

/* ───────────────────────────────────────────── после отчёта */

.sub {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2.25rem 0 0.9rem;
}

.calib-item {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
}
.calib-item p { font-size: 0.97rem; margin-bottom: 0.75rem; }
.calib-item .row { gap: 0.5rem; }
.calib-item button { flex: 1; font-size: 0.9rem; padding: 0.5rem; }

.calib-item button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.calib-item.answered { opacity: 0.75; }

.verdict {
  background: var(--accent-soft);
  border: 1px solid #4a2f1c;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.93rem;
  margin-top: 1rem;
}

.scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.scale > span { font-size: 0.95rem; }

.dots { display: flex; gap: 0.35rem; flex: none; }
.dots button {
  width: 2rem; height: 2rem;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 0.85rem;
}
.dots button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #17120d;
  font-weight: 600;
}

.thanks {
  color: var(--accent);
  font-size: 0.93rem;
  margin-top: 0.9rem;
  text-align: center;
}

#to-qa { margin-top: 2.5rem; }
#qa-left { text-align: center; }

/* ───────────────────────────────────────────── выбор одного или нескольких */

.choice-group { display: grid; gap: 0.5rem; margin-bottom: 0.4rem; }

.choice-group button {
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.8rem 0.9rem;
  font-size: 0.95rem;
  line-height: 1.35;
}
.choice-group button span {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-top: 0.2rem;
}
.choice-group button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice-group button[aria-pressed="true"] span { color: #c9a487; }
