/* ═══════════════════════════════════════════
   NOIR · Юридические документы · печать
═══════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #1a1a1a;
  --muted: #555;
  --line: #d8d8d4;
  --accent: #9a7b45;
  --paper: #f4f4f1;
}

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

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;500;600;700&display=swap');

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 14pt;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ponytail: removed translateZ(0) + backface-visibility — caused white screen in Safari */

.doc { max-width: 820px; margin: 0 auto; padding: 48px 28px 80px; }

.doc-sheet {
  background: #fff;
  border: 1px solid var(--line);
  padding: 56px 60px;
  box-shadow: 0 20px 60px -40px rgba(0,0,0,.3);
}

/* Шапка документа */
.doc-brand {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 20px; margin-bottom: 32px; border-bottom: 2px solid var(--ink);
}
.doc-brand-name {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900; letter-spacing: .12em; font-size: 18px;
}
.doc-brand-name span { color: var(--accent); font-size: 10px; vertical-align: super; }
.doc-brand-meta { font-size: 11pt; color: var(--muted); text-align: right; }

.doc-title {
  font-size: 16pt; font-weight: 700; text-align: center;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em;
}
.doc-subtitle { text-align: center; font-size: 12pt; color: var(--muted); margin-bottom: 6px; }
.doc-place { text-align: center; font-size: 11pt; color: var(--muted); margin-bottom: 36px; }

/* Секции */
.doc h2 { font-size: 13pt; font-weight: 700; margin: 24px 0 10px; text-transform: uppercase; letter-spacing: .02em; }
.doc p { margin-bottom: 10px; text-align: justify; text-indent: 1.25em; }
.doc ol { margin: 0 0 10px 0; padding-left: 0; counter-reset: clause; list-style: none; }
.doc ol > li {
  counter-increment: clause; padding-left: 40px; position: relative;
  margin-bottom: 8px; text-align: justify;
}
.doc ol > li::before {
  content: counter(clause) ". "; position: absolute; left: 0; font-weight: 700;
}
.doc ul { margin: 6px 0 10px 20px; }
.doc ul li { margin-bottom: 4px; }

/* Поля для заполнения */
.fill {
  display: inline-block; min-width: 120px; border-bottom: 1px solid var(--ink);
  padding: 0 4px; text-align: center; color: var(--ink); font-weight: 700;
  font-family: 'Times New Roman', Times, Georgia, serif;
}
.fill:focus { outline: none; background: #fffbe6; }
.fill-wide { min-width: 100%; display: block; margin: 4px 0; }

/* Реквизиты / подписи */
.requisites { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.req-block { font-size: 11pt; line-height: 1.8; }
.req-block h3 {
  font-size: 12pt; margin-bottom: 10px; font-weight: 700;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.sign-line {
  margin-top: 40px; border-top: 1px solid var(--ink);
  width: 220px; padding-top: 4px; font-size: 10pt; color: var(--muted);
}

/* Кнопки (не печатаются) */
.doc-toolbar {
  position: relative; display: flex; gap: 12px; justify-content: flex-end;
  max-width: 820px; margin: 0 auto; padding: 16px 28px;
}
.doc-btn {
  font-family: Arial, sans-serif; font-size: 14px; font-weight: 700;
  padding: 12px 24px; border-radius: 6px; border: 1px solid var(--ink);
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
  transition: all .25s ease;
}
.doc-btn:hover { background: var(--ink); color: #fff; }
.doc-btn-primary { background: var(--ink); color: #fff; }
.doc-btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.doc-note {
  max-width: 820px; margin: 0 auto 24px; padding: 0 28px;
  font-family: Arial, sans-serif; font-size: 13px; color: var(--muted);
}

/* Адаптив */
@media (max-width: 640px) {
  .doc-sheet { padding: 32px 24px; }
  .requisites { grid-template-columns: 1fr; gap: 24px; }
  .doc-brand { flex-direction: column; gap: 8px; }
  .doc-brand-meta { text-align: left; }
}

/* ═══ ПЕЧАТЬ ═══ */
@page { margin: 20mm 15mm; }

@media print {
  html, body {
    background: #fff !important; margin: 0 !important;
    padding: 0 !important; overflow: visible !important;
  }
  body {
    color: #111 !important; font-size: 12pt;
    font-family: 'Times New Roman', Times, Georgia, serif !important;
  }
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .doc-toolbar, .doc-note { display: none !important; }
  .doc { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .doc-sheet { border: none !important; box-shadow: none !important; padding: 0 !important; }
  .doc h2, .doc-brand, .requisites, .sign-line { break-inside: avoid; page-break-inside: avoid; }
  p, ol > li { orphans: 3; widows: 3; }
  a { color: inherit !important; text-decoration: none !important; }
}