/* Общие стили юридических страниц clevrion.com.
   Токены те же, что на главной (index.html): одна палитра, один акцент. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #121418;
  --muted: #555c69;
  --line: #dde0e6;
  --accent: #2b59d9;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfb;
  --mark: #fff3c4;
  --mark-ink: #5a4500;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a20;
    --ink: #eceef2;
    --muted: #a1a8b5;
    --line: #2a2f39;
    --accent: #7b9bff;
    --accent-ink: #0f1115;
    --accent-soft: #1c2440;
    --mark: #3a3214;
    --mark-ink: #f3dc8a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.65; overflow-x: hidden;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Шапка */
header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { height: 64px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 16px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.back { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.back:hover { color: var(--ink); }
.portal { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; white-space: nowrap; }
.portal:hover { color: var(--ink); }
.portal i { font-size: 20px; }
@media (max-width: 767px) { .portal span { display: none; } }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--muted);
  padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* Документ */
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding: 56px 0 96px; }
.doc.single { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.toc { position: sticky; top: 96px; align-self: start; font-size: 15px; }
.toc p { font-weight: 600; margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
article { max-width: 72ch; }
article h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.12; letter-spacing: -0.025em; margin: 0; }
article .updated { color: var(--muted); margin: 12px 0 0; font-size: 15px; }
article h2 { font-size: 22px; letter-spacing: -0.015em; margin: 44px 0 12px; scroll-margin-top: 88px; }
article h3 { font-size: 18px; margin: 28px 0 8px; }
article p, article li { margin: 0 0 12px; }
article ul, article ol { padding-left: 22px; margin: 0 0 12px; }
.note {
  background: var(--accent-soft); border-radius: 16px; padding: 18px 22px; margin: 28px 0 8px; font-size: 16px;
}
.note p:last-child { margin-bottom: 0; }
.fill { background: var(--mark); color: var(--mark-ink); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font: inherit;
  font-weight: 600; font-size: 15px; border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); }

/* Реквизиты и подписи сторон */
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.sign div { border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; font-size: 16px; }
.sign strong { display: block; margin-bottom: 8px; }
.sign .line { display: block; border-bottom: 1px solid var(--muted); height: 32px; margin-top: 18px; }
table.sow { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 16px; }
table.sow th, table.sow td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }
table.sow th { background: var(--accent-soft); font-weight: 600; }

footer { border-top: 1px solid var(--line); padding: 32px 0 44px; color: var(--muted); font-size: 15px; }
.foot { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px 40px; }
.foot nav, .foot-brand { display: flex; flex-direction: column; gap: 8px; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--ink); }
@media (max-width: 767px) { .foot { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 32px; }
  .toc { display: none; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .back { display: none; }
  .sign { grid-template-columns: 1fr; }
  table.sow { font-size: 13px; table-layout: fixed; }
  table.sow th, table.sow td { padding: 8px 6px; overflow-wrap: anywhere; }
  article h1, article h2 { overflow-wrap: anywhere; }
  .fill { white-space: normal; }
}

/* Печать и сохранение в PDF: только сам документ, чёрным по белому */
@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #999; --accent: #000; --accent-soft: #fff; --mark: #fff; --mark-ink: #000; }
  header, footer, .toc, .actions, .note.screen-only { display: none !important; }
  body { font-size: 11.5pt; line-height: 1.45; }
  .doc { display: block; padding: 0; }
  article { max-width: none; }
  article h2 { margin-top: 18pt; break-after: avoid; }
  .fill { border-bottom: 1px solid #000; border-radius: 0; padding: 0 2px; }
  .sign { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

/* Бриф проекта: форма. Подпись над полем, ошибка под полем. */
.brief { max-width: 760px; }
.brief .lead { color: var(--muted); margin: 14px 0 0; max-width: 60ch; }
.form { margin-top: 36px; display: grid; gap: 26px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: grid; gap: 8px; }
.field > label, .field > .legend { font-weight: 600; font-size: 15px; }
.field .opt { color: var(--muted); font-weight: 400; }
.field input[type=text], .field input[type=email], .field textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field .help { color: var(--muted); font-size: 14px; }
.field .err { color: #c0392b; font-size: 14px; display: none; }
@media (prefers-color-scheme: dark) { .field .err { color: #ff8a7a; } }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid textarea { border-color: #c0392b; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chips span.c { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 15px; background: var(--surface); transition: background-color .2s, border-color .2s; }
.chips input:checked + span.c { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips input:focus-visible + span.c { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.form .btn-primary { justify-self: start; padding: 14px 26px; font-size: 16px; }
.done { background: var(--accent-soft); border-radius: 18px; padding: 24px; margin-top: 8px; }
.done h2 { margin: 0 0 8px; font-size: 22px; }
.done textarea { width: 100%; min-height: 220px; margin-top: 14px; font: 14px/1.5 ui-monospace, Consolas, monospace;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); color: var(--ink); }
@media (max-width: 767px) { .row2 { grid-template-columns: 1fr; } }
