:root {
  --main: #756d3f;       /* основной: выбор, прогресс, ссылки */
  --accent: #bf4333;     /* кнопки действий */
  --accent-d: #a3382a;
  --main-d: #5e5732;
  --dark: #2b2814;
  --tint: #f4f2ea;
  --tint-2: #e6e2cf;
  --ink: #1d1b12;
  --mute: #625e4d;
  --line: #e2dfd2;
  --r: 16px;
  --font: "Golos Text", "Segoe UI", Roboto, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 17px/1.55 var(--font); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--main); text-underline-offset: 3px; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--main); outline-offset: 2px; }

h1, h2 { font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
h1 { font-size: clamp(34px, 4vw, 56px); }
.lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--mute); }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px; border-radius: 12px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; font-weight: 600; font-size: 17px; text-decoration: none;
  cursor: pointer; touch-action: manipulation; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn--ghost { background: transparent; border-color: var(--main); color: var(--main); }
.btn--ghost:hover { background: var(--tint); border-color: var(--main-d); color: var(--main-d); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Экран: фото слева, квиз справа ---------- */
.screen { display: grid; grid-template-columns: minmax(320px, 2fr) 3fr; min-height: 100vh; min-height: 100dvh; }

.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(20px, 3vw, 40px); color: #fff; overflow: hidden; isolation: isolate; background: var(--dark); }
.side__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.side::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(43, 40, 20, .6), rgba(43, 40, 20, .1) 35%, rgba(43, 40, 20, .9)); }
.logo { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 17px; }
.logo__mark { width: 38px; height: 38px; border-radius: 10px; flex: none; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 11l7 11 7-11' stroke='white' stroke-width='3' fill='none' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.side__facts li { display: grid; padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, .25); }
.side__facts b { font-size: clamp(20px, 2vw, 26px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.side__facts span { color: #e6e2cf; font-size: 15px; }

.main { display: flex; flex-direction: column; min-width: 0; padding: clamp(24px, 4vw, 56px) clamp(16px, 5vw, 72px) 24px; }

/* ---------- Квиз ---------- */
.quiz { flex: 1; display: flex; flex-direction: column; gap: 28px; width: 100%; max-width: 860px; margin-inline: auto; }
.quiz [hidden] { display: none; }
.quiz__bar { display: grid; gap: 8px; font-size: 14px; font-weight: 600; color: var(--mute); }
.quiz__track { height: 6px; border-radius: 3px; background: var(--tint); overflow: hidden; }
.quiz__track i { display: block; height: 100%; width: 0; background: var(--main); transition: width .3s; }
.quiz__step { display: grid; gap: 20px; align-content: start; border: 0; min-width: 0; }
.js .quiz__step:not(.is-on) { display: none; }
.quiz__intro, .quiz__done { margin-block: auto; }
.quiz__intro .btn { justify-self: start; margin-top: 8px; }
.quiz__q { font-size: clamp(24px, 2.4vw, 32px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
legend.quiz__q { margin-bottom: 24px; }
.quiz__hint { color: var(--mute); margin-top: -8px; }
.quiz__done { display: grid; gap: 16px; }
.quiz__done:focus { outline: 0; }
.quiz__nav { display: flex; gap: 12px; margin-top: auto; }
.quiz__nav .btn { flex: 1; max-width: 240px; }
.quiz__next { margin-left: auto; }

.kicker { justify-self: start; padding: 6px 12px; border-radius: 8px; background: var(--tint); color: var(--dark); font-size: 15px; font-weight: 600; }
.checks li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .38em; width: 16px; height: 16px; border-radius: 50%; background: var(--main) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-4.8' stroke='white' stroke-width='1.8' fill='none'/%3E%3C/svg%3E") center / 100%; }

/* Варианты ответа */
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.opts label { position: relative; }
.opts input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.opts span { display: flex; align-items: center; height: 100%; min-height: 60px; padding: 12px 18px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 500; transition: border-color .15s, background .15s, color .15s; }
.opts label:hover span { border-color: var(--main); }
.opts input:checked + span { border-color: var(--main); background: var(--tint); color: var(--main); }
.opts input:focus-visible + span { outline: 3px solid var(--main); outline-offset: 2px; }

.opts--img { grid-template-columns: repeat(4, 1fr); }
.opts--img span { flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 8px 12px; }
.opts--img img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: var(--tint); }
.opts--img b { padding-inline: 6px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.opts--img small { padding-inline: 6px; font-size: 14px; color: var(--mute); }
.opts--img .opts__none { justify-content: center; text-align: center; background: var(--tint); border-style: dashed; }

/* Контакты */
.field { display: grid; gap: 8px; border: 0; }
.field > label, .field > legend { font-weight: 600; font-size: 15px; }
.field > legend { margin-bottom: 8px; }
.field input { width: 100%; min-height: 54px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s; }
.field input::placeholder { color: #8b96aa; }
.field input:focus { outline: 0; border-color: var(--main); box-shadow: 0 0 0 3px rgba(117, 109, 63, .2); }
.field input:user-invalid { border-color: #c62828; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; border-radius: 12px; background: var(--tint); }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 44px; border-radius: 9px; font-weight: 500; transition: background .15s, color .15s; }
.seg input:checked + span { background: #fff; color: var(--main); font-weight: 600; box-shadow: 0 1px 3px rgba(43, 40, 20, .12); }
.seg input:focus-visible + span { outline: 3px solid var(--main); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--mute); cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--main); cursor: pointer; }
.hp { position: absolute; left: -9999px; }
.form__msg:empty { display: none; }
.form__msg { padding: 14px 16px; border-radius: 12px; background: #e7f6ec; color: #135c2c; font-weight: 500; }
.form__msg.is-error { background: #fdecec; color: #a3201b; }

/* ---------- Подвал ---------- */
.ftr { width: 100%; max-width: 860px; margin: 40px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--mute); font-size: 13px; }
.ftr p + p { margin-top: 4px; }
.ftr a { color: var(--mute); }
.ftr a:hover { color: var(--main); }

/* ---------- Юридические страницы ---------- */
.doc main { max-width: 820px; padding-block: 40px 96px; }
.doc h1 { font-size: clamp(32px, 5vw, 48px); margin: 24px 0 16px; }
.doc h2 { font-size: 22px; margin: 32px 0 8px; letter-spacing: -.01em; }
.doc p, .doc__list { color: var(--mute); }
.doc p + p, .doc__list + p { margin-top: 10px; }
.doc__list { list-style: disc; padding-left: 22px; margin-top: 6px; }
.doc main > p:first-child a { font-weight: 600; text-decoration: none; }

/* ---------- Адаптив ---------- */
@media (max-width: 1200px) {
  .opts--img { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  body { font-size: 16px; }
  .screen { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; min-height: 0; }
  .side__facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .side__facts li { padding: 10px 0 0; }
  .side__facts b { font-size: 16px; }
  .side__facts span { font-size: 13px; line-height: 1.35; }
  /* на вопросах фото — только узкая полоса с логотипом */
  .screen:has(.quiz__intro:not(.is-on)) .side__facts { display: none; }
  .opts--img { grid-template-columns: repeat(2, 1fr); }
  .quiz__nav .btn { max-width: none; }
}
@media (max-width: 480px) {
  .side__facts { grid-template-columns: 1fr; gap: 0; }
  .opts { grid-template-columns: 1fr; }
  .opts--img { grid-template-columns: repeat(2, 1fr); }
  .quiz__intro .btn { justify-self: stretch; }
}

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