/* Публичная страница отзыва. Mobile-first: базовые стили — для телефона, шире 640px — карточка по центру. */

:root {
  --paper: #EDF2F1;
  --surface: #FFFFFF;
  --field: #F4F7F6;
  --ink: #12302E;
  --muted: #587270;
  --line: #D5E0DE;
  --neutral: #8CA3A0;
  --m1: #DC4A47;
  --m2: #E8803A;
  --m3: #D49B1C;
  --m4: #6CA544;
  --m5: #22966A;
  --danger: #C23B36;
  --accent: #0B7A75;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(11, 122, 117, .12);
  --accent-ring: rgba(11, 122, 117, .28);
  --r-l: 28px;
  --r-m: 18px;
  --r-s: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0C1718;
  --surface: #132325;
  --field: #0F1E20;
  --ink: #E3EEEC;
  --muted: #93AAA7;
  --line: #23393B;
  --neutral: #62807C;
  --m1: #F06A66;
  --m2: #F39550;
  --m3: #E8B53C;
  --m4: #8CC264;
  --m5: #3DB585;
  --danger: #F07A75;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --paper: #0C1718;
    --surface: #132325;
    --field: #0F1E20;
    --ink: #E3EEEC;
    --muted: #93AAA7;
    --line: #23393B;
    --neutral: #62807C;
    --m1: #F06A66;
    --m2: #F39550;
    --m3: #E8B53C;
    --m4: #8CC264;
    --m5: #3DB585;
    --danger: #F07A75;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- каркас ---------- */

.sheet {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding:
    max(16px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
}
.brand-logo { display: block; max-height: 40px; max-width: 170px; width: auto; height: auto; }
.brand-name { font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }

.step { display: none; }
#app[data-state="rate"] .step-rate { display: flex; }
#app[data-state="next"] .step-next { display: flex; }
#app[data-state="success"] .step-success { display: flex; }

.step.is-entering, .block.is-entering { animation: step-in .36s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes step-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- шаг 1: оценка ---------- */

.step-rate {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 20px 0 12px;
}

h1, h2 {
  margin: 0;
  font-weight: 720;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
h1 { font-size: clamp(29px, 8vw, 38px); line-height: 1.1; }
h2 { font-size: clamp(25px, 6.6vw, 31px); line-height: 1.14; }

.lead {
  margin: 12px auto 0;
  max-width: 27ch;
  color: var(--muted);
  font-size: 17px;
  text-wrap: pretty;
}

.face {
  display: block;
  color: var(--neutral);
  overflow: visible;
  transition: color .28s ease;
}
.face-main {
  width: clamp(124px, 40vw, 164px);
  height: auto;
  margin: clamp(22px, 6vh, 44px) auto clamp(20px, 5vh, 36px);
}
.face-disc { fill: currentColor; fill-opacity: .13; stroke: currentColor; stroke-width: 4; }
.eye { fill: currentColor; }
.mouth, .brow { fill: none; stroke: currentColor; stroke-width: 5.5; stroke-linecap: round; }
.brow { opacity: 0; }

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 5px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.opt {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: clamp(11.5px, 3.35vw, 13.5px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  min-height: 70px;
  padding: 14px 1px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.opt-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mood);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
.opt.is-preview { background: var(--field); color: var(--ink); }
.opt.is-preview .opt-dot { transform: scale(1.3); }
.opt.is-selected {
  background: var(--field);
  background: color-mix(in srgb, var(--mood) 15%, var(--surface));
  color: var(--ink);
}
.opt.is-selected .opt-dot { transform: scale(1.3); }
@media (hover: hover) {
  .opt:hover { background: var(--field); color: var(--ink); }
}

.scale-hint {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  display: none;
}
@media (pointer: coarse) { .scale-hint { display: block; } }

/* ---------- шаг 2 ---------- */

.step-next {
  flex-direction: column;
  padding: 12px 0 8px;
}

.back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 16px 5px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.back:active { background: var(--field); }
.back-arrow { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.face-mini { width: 30px; height: 30px; }

.block { display: none; margin-top: 26px; }
.step-next[data-platforms="open"] .block-platforms { display: block; }
.step-next[data-form="open"] .block-form { display: block; }
.step-next[data-kind="positive"] .block-platforms { order: 1; }
.step-next[data-kind="positive"] .block-form { order: 2; }
.step-next[data-kind="negative"] .block-form { order: 1; }
.step-next[data-kind="negative"] .block-platforms { order: 2; }
.step-next[data-kind="positive"] .only-neg,
.step-next[data-kind="negative"] .only-pos { display: none; }
.step-next[data-kind="negative"][data-platforms="open"] .block-platforms { margin-top: 36px; }

.block h2 + .sub, .block h2 + h2 + .sub { margin-top: 10px; }
.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16.5px;
  text-wrap: pretty;
}

.platforms {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}
.platforms li + li { border-top: 1px solid var(--line); }
.platforms a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 12px 16px 12px 12px;
  color: inherit;
  text-decoration: none;
  transition: background-color .12s ease;
}
.platforms a:active { background: var(--field); }
@media (hover: hover) { .platforms a:hover { background: var(--field); } }

.tile {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  overflow: hidden;
}
.tile svg { width: 24px; height: 24px; }
.tile.has-logo { background: #FFFFFF; border: 1px solid var(--line); }
.tile img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.p-text { flex: 1; min-width: 0; }
.p-name { display: block; font-weight: 650; font-size: 16.5px; line-height: 1.25; }
.p-hint { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); line-height: 1.3; }
.p-go { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.go-check { display: none; }
a.is-opened .go-arrow { display: none; }
a.is-opened .go-check { display: inline; }
a.is-opened .p-go { stroke: var(--accent); }

/* форма */
.form { display: grid; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 7px; }
.field-label { font-size: 15px; font-weight: 600; }
.opt-note { font-weight: 400; color: var(--muted); }
.input {
  width: 100%;
  min-height: 56px;
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--neutral); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { min-height: 128px; resize: none; overflow: hidden; }
.field.has-error .input { border-color: var(--danger); }
.field-error { margin: 0; color: var(--danger); font-size: 14px; }
.form-error {
  padding: 12px 14px;
  border-radius: var(--r-s);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--ink);
  font-size: 15px;
}
.form-error[hidden] { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 4px;
  padding: 14px 20px;
  border: 0;
  border-radius: 17px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.985); filter: brightness(.95); }
.btn[disabled] { opacity: .72; cursor: progress; }
.btn .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.consent { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.consent a { color: inherit; text-underline-offset: 2px; }
.field-note { margin: 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); }

/* галочка согласия: вся строка — зона нажатия */
.field-consent { gap: 4px; }
.consent-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.consent-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cbox {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--neutral);
  border-radius: 7px;
  background: var(--surface);
  transition: background-color .12s ease, border-color .12s ease;
}
.cbox svg { width: 16px; height: 16px; fill: none; stroke: var(--accent-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: opacity .12s ease, transform .15s ease; }
.consent-check input:checked + .cbox { background: var(--accent); border-color: var(--accent); }
.consent-check input:checked + .cbox svg { opacity: 1; transform: none; }
.consent-check input:focus-visible + .cbox { outline: 3px solid var(--accent); outline-offset: 2px; }
.consent-check:has(input:checked) { border-color: var(--accent); }
.consent-text { font-size: 15.5px; line-height: 1.4; padding-top: 1px; }
.consent-text a { color: var(--accent); text-underline-offset: 2px; font-weight: 600; }
.field-consent.has-error .consent-check { border-color: var(--danger); }

/* капча */
.captcha { min-height: 102px; }
.captcha-invisible { min-height: 0; height: 0; overflow: hidden; }
.captcha:empty::before {
  content: "Загружаем проверку «Я не робот»…";
  display: flex; align-items: center; min-height: 102px; padding: 0 14px;
  border: 1.5px dashed var(--line); border-radius: var(--r-s);
  color: var(--muted); font-size: 14px;
}
.captcha-invisible:empty::before { display: none; }

/* переключатели между блоками */
.toggles { order: 3; display: grid; gap: 10px; margin-top: 24px; }
.toggle {
  display: none;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.toggle:active { background: var(--surface); }
.toggle svg {
  flex: none; width: 24px; height: 24px; fill: none;
  stroke: var(--accent); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round;
}
.toggle b { display: block; font-weight: 650; }
.toggle small { display: block; color: var(--muted); font-size: 14px; line-height: 1.3; margin-top: 1px; }
.step-next[data-form="closed"] .toggle-form { display: flex; }
.step-next[data-platforms="closed"] .toggle-platforms { display: flex; }

/* ---------- шаг 3 ---------- */

.step-success {
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}
.done-mark svg { width: 72px; height: 72px; display: block; margin-bottom: 22px; }
.done-mark circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.done-mark path {
  fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 0;
}
.step-success.is-entering .done-mark path { animation: draw .5s .12s ease-out both; }
@keyframes draw { from { stroke-dashoffset: 40; } }
.sent-phone { margin: 18px 0 0; font-size: 16.5px; }
.sent-phone[hidden] { display: none; }

/* ---------- подвал ---------- */

.foot {
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.foot p { margin: 0; }
.foot a, .linkbtn { color: inherit; text-underline-offset: 2px; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; }
.foot-links a, .linkbtn { display: inline-flex; align-items: center; min-height: 32px; }
.linkbtn { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.foot-org { max-width: 34ch; }
.credit { opacity: .85; }

/* ---------- баннер cookie ---------- */

.cookie {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  margin: 0 auto;
  max-width: 34rem;
  padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -18px 40px -24px rgba(10, 40, 38, .35);
  border-radius: 22px 22px 0 0;
  animation: rise .32s cubic-bezier(.2, .8, .2, 1) both;
}
.cookie p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.cookie a { color: var(--accent); text-underline-offset: 2px; }
.cookie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cbtn {
  min-height: 48px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
}
.cbtn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
body.has-cookie .sheet { padding-bottom: 170px; }
@keyframes rise { from { transform: translateY(100%); } }

/* ---------- лист с документом ---------- */

.docsheet {
  width: 100%;
  max-width: 40rem;
  max-height: 88vh;
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.docsheet[open] { display: flex; animation: rise .3s cubic-bezier(.2, .8, .2, 1) both; }
.docsheet::backdrop { background: rgba(8, 24, 23, .45); }
.docsheet-bar { position: relative; display: flex; justify-content: flex-end; align-items: center; min-height: 48px; padding: 6px 8px 0; }
.docsheet-grip { position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line); }
.docsheet-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.docsheet-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.docsheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 20px 16px; }
.docsheet-foot { display: grid; gap: 8px; padding: 12px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.docsheet-foot .btn { margin: 0; min-height: 52px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.docsheet-loading { color: var(--muted); padding: 24px 0; }
@media (min-width: 640px) {
  .docsheet { margin: auto; border-radius: 24px; max-height: 84vh; }
  .docsheet-grip { display: none; }
}

/* ---------- документы ---------- */

.doc { font-size: 15.5px; line-height: 1.6; }
.doc h1 { font-size: clamp(25px, 6.6vw, 32px); line-height: 1.15; margin: 24px 0 14px; }
.doc .doc-title { font-size: 23px; line-height: 1.2; margin: 0 0 12px; }
.doc h2 { font-size: 19px; line-height: 1.3; margin: 26px 0 8px; letter-spacing: -0.01em; }
.doc h3 { font-size: 16.5px; line-height: 1.35; margin: 18px 0 6px; font-weight: 680; }
.doc p { margin: 0 0 12px; max-width: 68ch; }
.doc ul { margin: 0 0 12px; padding-left: 1.25em; max-width: 68ch; }
.doc li { margin: 0 0 6px; }
.doc a { color: var(--accent); overflow-wrap: anywhere; text-underline-offset: 2px; }
.doc mark.missing { background: #FDE7A9; color: #4A3500; padding: 0 4px; border-radius: 4px; }
.doc-warn { padding: 12px 14px; border-radius: var(--r-s); background: #FDF1CF; color: #4A3500; font-size: 14.5px; }
.doc-links { display: grid; gap: 4px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc-links a { color: var(--accent); min-height: 40px; display: flex; align-items: center; }
.sheet-doc { min-height: 0; }
@media (min-width: 640px) { body.doc-page { place-items: start center; } .sheet-doc { max-width: 46rem; } }

/* ---------- планшеты и компьютеры ---------- */

@media (min-width: 640px) {
  body {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background:
      radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%),
      var(--paper);
  }
  .sheet {
    min-height: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    padding: 32px 40px 28px;
    box-shadow: 0 30px 70px -40px rgba(10, 40, 38, .35);
  }
  .step-rate { padding: 28px 0 8px; }
  .platforms, .scale, .back { background: var(--surface); }
  .scale { background: var(--field); border-color: transparent; }
  .opt.is-preview, .opt:hover { background: var(--surface); }
  .input { background: var(--field); }
  .input:focus { background: var(--surface); }
  .toggle:active { background: var(--field); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (min-width: 640px) {
  .cookie { bottom: 16px; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 60px -28px rgba(10, 40, 38, .45); }
  body.has-cookie { padding-bottom: 200px; }
  body.has-cookie .sheet { padding-bottom: 28px; }
}
