/* Анкета QPortall. Цвет кнопок и фон группы (?k=…) задаёт anketa.js. */
:root {
  --accent: #c000b8;          /* малиновый QPortall - только акцентом: полоса шага, выбранное, фокус */
  --btn: #17171c;             /* главные кнопки */
  --btn-text: #fff;
  --text: #17171c;
  --muted: #5d5b66;
  --line: #dedce3;
  --soft: #f5f4f7;
  --error: #b42318;
  --error-bg: #fdecea;
  --ok: #146c2e;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Hebrew", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 16px/1.5 var(--font); color: var(--text); background: #f3f1f4;
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Фон: общий - спокойная заливка; у группы - картинка, затемнённая и размытая. */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(900px 600px at 10% -10%, #fde7fb 0%, transparent 60%),
              radial-gradient(800px 600px at 110% 110%, #e6e9f7 0%, transparent 60%), #f3f1f4; }
.bg.has-img { background: #222; }
.bg.has-img::before { content: ""; position: absolute; inset: -30px; background: var(--bg-img) center / cover no-repeat;
  filter: blur(5px) brightness(.9); }

.card {
  width: min(640px, calc(100% - 32px)); margin: 32px auto; background: #fff; border-radius: 22px;
  box-shadow: 0 1px 2px rgba(20, 16, 30, .06), 0 12px 40px rgba(20, 16, 30, .12);
  padding: 28px 36px 24px; display: flex; flex-direction: column; min-height: min(720px, calc(100vh - 64px));
}
.loading { margin: auto; color: var(--muted); text-align: center; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: block; height: 26px; width: auto; }
.count { margin-inline-start: auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.bar { height: 4px; border-radius: 4px; background: var(--soft); margin: 14px 0 26px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s ease; }

h1 { font-size: 28px; line-height: 1.2; margin: 0 0 22px; letter-spacing: -.01em; }
h1:focus { outline: none; }
.lead { color: var(--muted); margin: -16px 0 24px; }
.hero .lead, .banner + .lead { margin-top: 0; }
.step { flex: 1; }

.banner { background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 20px; }

/* Поле */
.field { margin: 0 0 22px; border: 0; padding: 0; min-width: 0; }
.label { display: block; font-weight: 600; margin: 0 0 4px; padding: 0; }
.req { color: var(--accent); margin-inline-start: 2px; }
.help { display: block; font-size: 14px; color: var(--muted); margin: 0 0 8px; }
input[type=text], input[type=tel], input[type=email], input[type=url], textarea, select {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px; min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
select { appearance: none; padding-inline-end: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235d5b66' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center; }
input:hover, textarea:hover, select:hover { border-color: #c4c1cc; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field.bad input, .field.bad textarea, .field.bad select { border-color: var(--error); }
.err { display: block; color: var(--error); font-size: 14px; margin-top: 6px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }

/* Выбор: варианты-«пилюли» и галочки */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 16px; border: 1.5px solid var(--line);
  border-radius: 999px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; user-select: none; }
.opt span::before { content: ""; width: 16px; height: 16px; flex: none; border: 1.5px solid #b9b6c2; border-radius: 50%; }
.opt input[type=checkbox] + span::before { border-radius: 5px; }
.opt input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, #fff); }
.opt input:checked + span::before { border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 3px #fff; }
.opt input[type=checkbox]:checked + span::before { box-shadow: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8'%3E%3Cpath d='M1 4l3 3 5-6' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") no-repeat center; }
.opt input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.opts.days .opt span { padding: 9px 14px; }
.opts.days .opt span::before { display: none; }

/* Цвет сайта */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px 8px; }
.sw { position: relative; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; text-align: center; overflow-wrap: normal; }
.sw i { width: 48px; height: 48px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: box-shadow .15s; }
.sw input:checked + span i { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.sw input:checked + span { color: var(--text); font-weight: 600; }
.sw input:focus-visible + span i { outline: 3px solid var(--accent); outline-offset: 4px; }

/* Вид сайта: карточки с наброском */
.designs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dz { position: relative; }
.dz input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dz > span { display: block; height: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; cursor: pointer; font-size: 14px; }
.dz-t { display: block; }
.dz b { display: block; margin-top: 8px; line-height: 1.25; }
.dz small { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; margin-top: 2px; }
.dz input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.dz input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.sk { display: grid; gap: 4px; aspect-ratio: 4 / 3.4; align-content: start; }
.sk i { display: block; border-radius: 3px; background: #e7e5ec; height: 10px; }
.sk .hd { height: 18px; background: var(--c, #9a97a6); opacity: .85; }
.sk .ph { height: 26px; background: #cfccd8; }
.sk .mo { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: none; height: auto; }
.sk .mo i { height: 14px; background: #cfccd8; }
.sk .mo i:nth-child(3) { grid-column: span 2; }
.sk .tx { height: 4px; background: #d9d7e0; }

/* Да / Нет - переключатель */
.gate { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.gate.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.switch { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; font-weight: 600; }
.switch small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.switch input { appearance: none; flex: none; width: 48px; height: 28px; border-radius: 28px; background: #d3d0da; position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.gate-body { margin-top: 16px; }
.gate-body .field:last-child { margin-bottom: 4px; }

/* Карточки услуг и вопросов */
.item { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px 16px 2px; margin: 0 0 12px; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 10px; }
.item-head b { font-size: 15px; }
.link { background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 1.5px dashed #c4c1cc;
  border-radius: var(--radius); background: none; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.add:hover { border-color: var(--accent); }

/* Фото */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 112px; border: 1.5px dashed #c4c1cc; border-radius: var(--radius); padding: 16px; cursor: pointer; background: var(--soft);
  transition: border-color .15s, background .15s; position: relative; }
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, #fff); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.drop b { font-weight: 600; }
.drop small { color: var(--muted); font-size: 13px; }
.drop svg { width: 28px; height: 28px; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 10px; }
.thumbs:empty { display: none; }
.th { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--soft); }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th .noimg { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 12px; color: var(--muted); padding: 6px; text-align: center; }
.th .num { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 22px; text-align: center; }
.th .x { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.th .x:hover { background: rgba(0,0,0,.8); }
.th .warn { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(180, 35, 24, .88); color: #fff; font-size: 12px; line-height: 1.2; padding: 4px 6px; }
.one .thumbs { grid-template-columns: minmax(0, 220px); }
.up-logo .th img { object-fit: contain; padding: 8px; background: #fff; }

/* Проверка */
.terms { margin: 14px 0 4px; font-size: 14px; line-height: 1.5; }
.terms summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.terms summary::before { content: "▸"; margin-inline-end: 8px; }
[dir=rtl] .terms summary::before { content: "◂"; }
.terms[open] summary::before { content: "▾"; }
.terms summary::-webkit-details-marker { display: none; }
.terms summary { list-style: none; }
.terms ol { margin: 6px 0 0; padding-inline-start: 22px; }
.terms li { margin: 0 0 6px; }
.sum { border: 1.5px solid var(--line); border-radius: var(--radius); margin: 0 0 10px; }
.sum-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 8px 10px 16px; gap: 8px; }
.sum-head b { font-size: 15px; }
.sum dl { margin: 0; padding: 0 16px 12px; font-size: 14px; }
.sum dt { color: var(--muted); margin-top: 6px; }
.sum dd { margin: 0; white-space: pre-line; }
.sum .empty { color: var(--muted); padding: 0 16px 12px; font-size: 14px; margin: 0; }

/* Кнопки внизу */
.nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 16px; border-top: 1px solid #efeef2; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 26px;
  border-radius: 999px; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: filter .15s, background .15s; }
.btn-main { background: var(--btn); color: var(--btn-text); margin-inline-start: auto; }
.btn-main:hover { filter: brightness(1.15); }
.btn-ghost { background: none; color: var(--text); padding-inline: 14px; }
.btn-ghost:hover { background: var(--soft); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* Начало и конец */
.hero { text-align: center; margin: auto 0; padding: 24px 0; }
.hero h1 { font-size: 32px; }
.hero .lead { max-width: 420px; margin: 10px auto 28px; }
.facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; margin: 0 0 32px; padding: 0; list-style: none; }
.facts li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-inline-end: 8px; vertical-align: middle; }
.hero .btn-main { margin: 0 auto; min-width: 200px; }
.check { display: block; width: 64px; height: 64px; margin: 0 auto 16px; color: var(--ok); }
.check svg { display: block; width: 100%; height: 100%; }
.keybox { display: flex; gap: 8px; margin: 18px 0 8px; text-align: start; }
.keybox input { flex: 1; font-size: 14px; min-width: 0; }
.keybox .btn { min-height: 48px; padding: 10px 18px; background: var(--btn); color: var(--btn-text); }
.note { color: var(--muted); font-size: 14px; }
.progress { height: 6px; background: var(--soft); border-radius: 6px; overflow: hidden; margin: 14px 0 6px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.alert { background: var(--error-bg); color: var(--error); border-radius: 12px; padding: 12px 14px; margin: 16px 0 0; font-size: 15px; }
.hp { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

@media (max-width: 600px) {
  .card { width: 100%; margin: 0; border-radius: 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; box-shadow: none; }
  .bg.has-img + .card { width: calc(100% - 16px); margin: 8px auto; border-radius: 18px; min-height: calc(100dvh - 16px); }
  h1 { font-size: 24px; }
  .hero h1 { font-size: 27px; }
  .bar { margin: 12px 0 20px; }
  .nav { position: sticky; bottom: 0; background: #fff; margin: 20px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .btn-main { flex: 1; }
  .designs { grid-template-columns: 1fr; }
  .dz > span { display: flex; gap: 14px; align-items: center; }
  .dz .sk { width: 92px; flex: none; }
  .dz b { margin-top: 0; }
}

/* Языки анкеты: RU / עב / EN. Иврит - справа налево. */
.langs { display: flex; gap: 2px; margin-inline-start: 8px; }
.lng { font: inherit; font-size: 13px; font-weight: 600; min-width: 40px; min-height: 40px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.lng:hover { color: var(--text); background: var(--soft); }
.lng.on { color: var(--text); background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--line); }
.lng:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
[dir=rtl] select { background-position: left 16px center; }
[dir=rtl] .switch input::after { left: auto; right: 3px; }
[dir=rtl] .switch input:checked::after { transform: translateX(-20px); }
[dir=rtl] .th .num { left: auto; right: 6px; }
[dir=rtl] .th .x { right: auto; left: 4px; }
/* Узкий экран и крупный шрифт: если логотип, «Шаг N из M» и языки не помещаются - языки переносятся вниз, к краю. */
.top { flex-wrap: wrap; row-gap: 2px; }
.langs { margin-inline-start: auto; }
.count + .langs { margin-inline-start: 4px; }

/* Первый экран: какой сайт нужен (QPage / QReal) */
.types { display: grid; gap: 12px; margin: 8px 0 4px; }
.type { display: flex; flex-direction: column; gap: 6px; text-align: start; width: 100%; padding: 18px; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; font: inherit; color: var(--text); cursor: pointer; }
.type:hover { border-color: var(--accent); }
.type:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
.type-name { font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 400; line-height: 1.1; }
.type-q { color: #fb01f2; font-family: Georgia, "Times New Roman", serif; }
.type > span { color: var(--muted); }
.facts-list { display: grid; gap: 8px; justify-content: stretch; text-align: start; font-size: 15px; margin-bottom: 20px; }
.nav-stack .btn-main { margin-inline-start: 0; }
.nav-stack .btn { width: 100%; }
.h-brand { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 40px; }
.nav-stack { flex-direction: column; align-items: stretch; }
.btn-wa { background: #0d7337; color: #fff; text-decoration: none; }
.btn-wa:hover { background: #0a5c2c; }
a.btn { text-decoration: none; text-align: center; }
