/* Опрос канала — стиль гайда «Как установить Claude из России»:
   синий #388AF8, чёрный, белый, светло-голубые плашки, тяжёлый гротеск, срезанные углы.
   Контраст (WCAG): #388AF8 на белом 3.41 — только крупный жирный текст (≥24px или кнопки 19px bold);
   мелкий синий текст и белый текст на мелких синих заливках — #1F66D1 (5.41 на белом, 4.77 на #EBF1FC). */
:root {
  --blue: #388AF8;
  --blue-deep: #1F66D1;
  --black: #000000;
  --white: #FFFFFF;
  --panel: #EBF1FC;
  --line: #AFD0FC;
  --hair: #E3E8F0;
  --muted: #5B6475;      /* 5.96 на белом, 5.25 на #EBF1FC */
  --error: #C62828;      /* 5.62 на белом */
  --cover-text: rgba(255, 255, 255, .8);
  --cover-muted: #B3BCCB; /* 10.97 на чёрном */
  --cover-panel: #07101F;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cut: 12px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background: var(--white);
  color: var(--black);
  color-scheme: light;
}
body.cover { background: var(--black); color: var(--white); color-scheme: dark; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 20px; }

a { color: var(--blue-deep); text-underline-offset: 3px; }
a:hover { color: var(--black); }
.cover a { color: var(--blue); }
.cover a:hover { color: var(--white); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.title:focus, .title:focus-visible { outline: none; }

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

.loading { color: var(--cover-muted); text-align: center; padding: 30vh 20px 0; margin: 0; }

.enter { animation: enter .25s ease-out both; }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }

.accent { color: var(--blue); }

/* ================= ОБЛОЖКА (вступление, спасибо) ================= */

.cover {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.cover-in { position: relative; z-index: 1; flex: 1 0 auto; width: 100%; padding-top: 18px; padding-left: 26px; padding-right: 26px; }

/* HUD-рамка: уголки и линейки по краям */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hud i { position: absolute; display: block; }
.hud .tl, .hud .tr, .hud .bl, .hud .br { width: 22px; height: 22px; border: 0 solid var(--blue); }
.hud .tl { top: 10px; left: 8px; border-top-width: 2px; border-left-width: 2px; }
.hud .tr { top: 10px; right: 8px; border-top-width: 2px; border-right-width: 2px; }
.hud .bl { bottom: 10px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; }
.hud .br { bottom: 10px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; }
.hud .rl, .hud .rr {
  top: 64px; bottom: 64px; width: 11px;
  opacity: .75;
  background:
    linear-gradient(var(--blue), var(--blue)) 0 0 / 1px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--blue) 0 1px, transparent 1px 32px) 0 0 / 11px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--blue) 0 1px, transparent 1px 6px) 0 0 / 6px 100% no-repeat;
  -webkit-mask: repeating-linear-gradient(to bottom, #000 0 180px, transparent 180px 214px);
  mask: repeating-linear-gradient(to bottom, #000 0 180px, transparent 180px 214px);
}
.hud .rl { left: 10px; }
.hud .rr { right: 10px; transform: scaleX(-1); }

.cover-kicker { margin: 0 0 30px; text-align: center; font-size: 15px; font-weight: 500; color: var(--white); }

.cover h1.title {
  margin: 0 0 22px;
  text-align: center;
  font-size: clamp(34px, 10vw, 52px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--white);
}

.lead { text-align: center; }
.lead p, .lead-p { margin: 0 0 12px; color: var(--cover-text); font-size: 17.5px; line-height: 1.45; }
.lead-p { text-align: center; }

/* блок анонимности — тёмная плашка с синей рамкой */
.anon {
  margin: 26px 0 18px;
  padding: 20px 20px 16px;
  background: var(--cover-panel);
  border: 1px solid rgba(56, 138, 248, .55);
  border-radius: 28px;
}
.anon-title { margin: 0 0 14px; font-size: 21px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--blue); }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 2px 0 12px 42px; font-size: 16.5px; line-height: 1.4; color: var(--white); }
.ticks li::before { /* светло-голубой квадрат */
  content: "";
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--panel);
}
.ticks li::after { /* синяя галочка */
  content: "";
  position: absolute; left: 10px; top: 5px;
  width: 8px; height: 14px;
  border-right: 3px solid var(--blue-deep);
  border-bottom: 3px solid var(--blue-deep);
  transform: rotate(45deg);
}
.anon-foot { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid rgba(56, 138, 248, .3); color: var(--cover-muted); font-size: 15px; }

.consent-note { margin: -4px 0 4px 38px; color: var(--cover-muted); font-size: 14px; line-height: 1.45; }

/* юридическая подпись внизу обложки и документов */
.legal { position: relative; z-index: 1; margin-top: 30px; padding-left: 30px; padding-right: 30px; text-align: center; color: var(--cover-muted); font-size: 13px; line-height: 1.5; }
.legal p { margin: 0 0 4px; }
.legal a { color: var(--cover-muted); }
.legal a:hover { color: var(--white); }
.doc .legal { color: var(--muted); border-top: 1px solid var(--hair); padding: 18px 0 0; }
.doc .legal a { color: var(--muted); }
.doc .legal a:hover { color: var(--black); }

/* картинка-герой: края растворяются в чёрном, никакого видимого прямоугольника */
.hero { position: relative; z-index: 0; margin: 0 -26px; pointer-events: none; }
.hero img { display: block; width: 100%; height: auto; }
.cover .lead { position: relative; z-index: 1; }
/* вступление: высота не больше ~58% экрана, пустой чёрный верх картинки срезан, телефон и руки целиком */
.hero-intro { height: min(55vh, 580px); margin-top: -36px; }
.hero-intro img {
  height: 100%;
  object-fit: cover;
  object-position: 50% 72%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 86%, transparent 100%);
}
.hero-intro + .scroll-cue + .anon, .hero-intro + .anon { position: relative; z-index: 1; margin-top: -40px; }
/* подсказка «листайте» — внизу первого экрана */
.scroll-cue {
  position: absolute; z-index: 2;
  left: 50%; top: calc(100vh - 64px); top: calc(100svh - 64px);
  width: 44px; height: 44px; margin-left: -22px;
  border: 1px solid rgba(56, 138, 248, .7);
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  cursor: pointer;
  animation: cue 2.2s ease-in-out infinite;
}
.scroll-cue::before {
  content: "";
  position: absolute; left: 15px; top: 11px;
  width: 11px; height: 11px;
  border-right: 2.5px solid var(--white);
  border-bottom: 2.5px solid var(--white);
  transform: rotate(45deg);
}
.scroll-cue:hover { box-shadow: 0 0 18px rgba(56, 138, 248, .55); }
@keyframes cue { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
/* «спасибо»: перчатка (прозрачный фон) сразу под заголовком, без маски — иначе режет пальцы */
.hero-thanks, .hero-already { width: min(340px, 88vw); margin: 4px auto 8px; }

.end-mark {
  position: relative;
  width: 84px; height: 84px;
  margin: 12vh auto 26px;
  border-radius: 22px;
  background: var(--panel);
}
.end-mark::after {
  content: "";
  position: absolute; left: 30px; top: 14px;
  width: 20px; height: 40px;
  border-right: 7px solid var(--blue);
  border-bottom: 7px solid var(--blue);
  transform: rotate(45deg);
}

/* синее свечение снизу + подпись */
.glow {
  position: relative; z-index: 1;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 130px 20px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(to bottom, rgba(56, 138, 248, 0) 0%, rgba(56, 138, 248, .35) 40%, #3A80EC 78%, #2A6FDD 100%);
}
.glow p { margin: 0; font-size: 14px; font-weight: 600; color: var(--white); }

.noscript { padding-top: 30vh; text-align: center; color: var(--white); }
.noscript h1 { font-size: 26px; font-weight: 800; }
.noscript p { color: var(--cover-text); }

/* ================= БЕЛЫЕ СТРАНИЦЫ (вопросы, финал, документы) ================= */

.screen { padding-bottom: 8px; }
/* Экран вопроса не ниже окна: панель «Назад / Дальше» всегда у нижнего края (и с safe-area). */
.screen.has-bar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: 0;
}
.screen-body { flex: 1 0 auto; }

.top { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; }
.tab { /* «Вопрос 3 из 12» — как «Шаг 2»: висит от верхнего края, нижние углы срезаны */
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 18px 12px;
  background: var(--blue);
  color: var(--white);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px));
}
.progress {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--panel);
  overflow: hidden;
}
.top > .progress:only-child { margin-top: 22px; }
.progress-fill {
  height: 100%;
  background: var(--blue);
  transform-origin: left center;
  transition: transform .35s ease;
}

.chip-row { margin: 0 0 14px; }
.chip { /* восьмиугольная плашка — кикер вопроса */
  display: inline-block;
  padding: 7px 16px;
  background: var(--blue-deep);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  -webkit-clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}

h2.title, .doc h1 {
  margin: 0 0 12px;
  font-size: clamp(29px, 8.4vw, 40px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--black);
}

.hint { margin: 0 0 16px; color: var(--blue-deep); font-size: 16.5px; font-weight: 600; }
.note { margin: 10px 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

/* ---------- варианты ---------- */

.opts { border: 0; margin: 8px 0 0; padding: 0; min-width: 0; }

.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  margin: 0 0 10px;
  padding: 14px 18px;
  background: var(--panel);
  color: var(--black);
  border: 2px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  font-size: 17px;
  line-height: 1.32;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, color .15s, box-shadow .2s, border-color .15s, opacity .15s;
}
.opt:hover { border-color: var(--line); box-shadow: 0 6px 22px rgba(56, 138, 248, .18); }
.opt.on { background: var(--blue-deep); color: var(--white); border-color: var(--blue-deep); }
.opt.on:hover { box-shadow: 0 6px 24px rgba(31, 102, 209, .35); }
.opt.dim { opacity: .4; }
.opt.dim:hover { border-color: transparent; box-shadow: none; }
.opt.excl { margin-top: 18px; border: 2px dashed var(--line); }
.opt.excl.on { border-style: solid; border-color: var(--blue-deep); }
.opt:has(.sr-input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }

.mark {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  border: 2px solid var(--blue-deep);
  background: var(--white);
  position: relative;
}
.opt.multi .mark { border-radius: 7px; }
.opt.single .mark { border-radius: 50%; }
.opt.multi .mark::after {
  content: "";
  position: absolute; left: 6px; top: 2px;
  width: 6px; height: 12px;
  border-right: 3px solid var(--blue-deep);
  border-bottom: 3px solid var(--blue-deep);
  transform: rotate(45deg) scale(0);
  transition: transform .15s;
}
.opt.single .mark::after {
  content: "";
  position: absolute; inset: 4px;
  border-radius: 50%;
  background: var(--blue-deep);
  transform: scale(0);
  transition: transform .15s;
}
.opt.on .mark { border-color: var(--white); }
.opt.multi.on .mark::after { transform: rotate(45deg) scale(1); }
.opt.single.on .mark::after { transform: scale(1); }
.opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.counter { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.max-hint {
  margin: 6px 0 0;
  color: var(--error);
  font-size: 14.5px;
  font-weight: 600;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity .2s, max-height .2s;
}
.max-hint.on { opacity: 1; max-height: 80px; }

/* ---------- поля ---------- */

.own, .area {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  padding: 15px 18px;
  background: var(--panel);
  color: var(--black);
  border: 2px solid transparent;
  border-radius: 18px;
  font: inherit;
  font-size: 16.5px; /* ≥16px — iOS не зумит поле */
  line-height: 1.45;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.own::placeholder, .area::placeholder { color: var(--muted); opacity: 1; }
.own:hover, .area:hover { border-color: var(--line); }
.own:focus, .area:focus { border-color: var(--blue); outline: none; background: var(--white); }
.area { min-height: 116px; resize: vertical; margin-top: 8px; }
textarea.own { resize: none; min-height: 58px; overflow: hidden; }
.area.grow { overflow: hidden; resize: none; min-height: 100px; }

.field { margin: 24px 0 6px; }
.field-label { display: block; font-weight: 800; font-size: 19px; line-height: 1.3; letter-spacing: -.01em; margin: 0 0 6px; color: var(--black); }
.field .hint { margin-bottom: 4px; }

/* ---------- галочки (согласия, тумблер) ---------- */

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  cursor: pointer;
  font-size: 15.5px;
  line-height: 1.45;
}
.check .box {
  flex: 0 0 26px;
  width: 26px; height: 26px;
  border: 2px solid var(--blue-deep);
  border-radius: 7px;
  background: var(--white);
  position: relative;
  transition: background-color .15s, border-color .15s, box-shadow .2s;
}
.check .box::after {
  content: "";
  position: absolute; left: 7px; top: 2px;
  width: 7px; height: 13px;
  border-right: 3px solid var(--white);
  border-bottom: 3px solid var(--white);
  transform: rotate(45deg) scale(0);
  transition: transform .15s;
}
.check input:checked + .box { background: var(--blue-deep); border-color: var(--blue-deep); }
.check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box { outline: 3px solid var(--blue); outline-offset: 3px; }
.check:hover .box { box-shadow: 0 0 0 4px rgba(56, 138, 248, .25); }
.check-text { padding-top: 2px; }

.cover .check { color: var(--white); }
.cover .check .box { background: transparent; border-color: var(--white); }
.cover .check input:checked + .box { background: var(--blue); border-color: var(--blue); }

.toggle { margin-top: 8px; font-size: 17px; font-weight: 700; }

.reply-box {
  margin: 4px 0 6px;
  padding: 18px 18px 6px;
  background: var(--panel);
  border-radius: 28px;
}
.reply-box .own { margin-top: 4px; background: var(--white); }
.reply-box .own:focus { border-color: var(--blue); }
.reply-box[hidden] { display: none; }

.form-error { margin: 10px 0 0; color: var(--error); font-weight: 700; font-size: 15px; }
.form-error:empty { margin: 0; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.skip-row { margin: 14px 0 0; text-align: center; }
.skip {
  background: none;
  border: 0;
  padding: 10px 12px;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.skip:hover { color: var(--black); }

/* ---------- кнопки и нижняя панель ---------- */

.bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 18px -20px 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--hair);
}
.bar.static { position: static; background: none; border-top: 0; margin: 18px 0 0; padding: 4px 0 0; }
.bar-in { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.005em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.btn.primary { /* синяя кнопка со срезанными углами; белый 19px bold на #388AF8 = 3.41 (крупный текст) */
  flex: 1;
  color: var(--white);
  background: var(--blue);
  -webkit-clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.btn.primary:hover { color: var(--white); background: #4A97FF; box-shadow: inset 0 0 22px rgba(255, 255, 255, .28); }
.btn.primary:active { background: var(--blue-deep); }
.btn.primary:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--white), inset 0 0 0 5px var(--black); }
.btn.primary:disabled { cursor: not-allowed; background: #E4E9F2; color: var(--muted); box-shadow: none; }
.cover .btn.primary:disabled { background: #1C2433; color: var(--cover-muted); }
.btn.ghost { flex: 0 0 auto; padding: 0 14px 0 4px; color: var(--black); background: none; }
.btn.ghost:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ================= документы (privacy, soglasie) ================= */

.doc { padding-bottom: 48px; }
.doc .top { margin-bottom: 22px; }
.doc .back { font-size: 15px; font-weight: 600; }
.doc .meta { color: var(--muted); font-size: 14.5px; margin: 0 0 26px; }
.doc h2 { font-size: 21px; color: var(--blue-deep); font-weight: 800; letter-spacing: -.01em; margin: 32px 0 10px; line-height: 1.25; }
.doc p, .doc li { font-size: 16.5px; line-height: 1.6; }
.doc ul { padding-left: 20px; }
.doc li { margin: 0 0 6px; }
.doc li::marker { color: var(--blue-deep); }
.doc .panel { background: var(--panel); border-radius: 28px; padding: 18px 20px; margin: 18px 0; }
.doc .panel p { margin: 0; }

@media (min-width: 640px) {
  .cover-in { padding-top: 40px; }
}

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