/* ===== id.szbi.ru — Исполнительная документация онлайн =====
   Слой поверх nok.css (общий design-system, имя файла историческое).
   Подключать ТОЛЬКО после nok.css: здесь лежат осознанные переопределения.
   Палитра — токены НОК: --nos-blue #1B3A5C, фон #F5F7FA, радиус 10px.
   Шрифт — системный (Verdana из донора намеренно НЕ переносится).
   Никаких внешних шрифтов/CDN: CSP режет любые внешние запросы.
*/

:root {
  /* Палитра НОК, продублирована с префиксом --id- чтобы id.css работал и без nok.css */
  --id-blue: #1B3A5C;
  --id-blue-dark: #122840;
  --id-blue-bg: #EDF2F7;
  --id-blue-light: #C8D6E5;
  --id-green: #5ea13d;
  --id-yellow: #ffae00;
  --id-red: #FF262E;
  --id-text: #333;
  --id-text-light: #666;
  --id-muted: #94a3b8;
  --id-bg: #F5F7FA;
  --id-line: #e2e8f0;
  --id-card-border: rgba(27, 58, 92, 0.08);
  --id-radius: 10px;
  --id-radius-lg: 14px;
  --id-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ── Базовые переопределения донора ───────────────────────────────────────── */

/* 1. Шрифт: донор жёстко ставил Verdana — в ИД системный. */
body,
.nos-form-input,
.nos-btn,
button,
input,
select,
textarea {
  font-family: var(--id-font);
}

body {
  background: var(--id-bg);
  color: var(--id-text);
  font-size: 14px;
  line-height: 1.5;
}

/* 2. Печать. Донор (тренажёр) блокировал печать целиком:
      @media print { body { display: none } html::after { content: 'Печать запрещена' } }
      Для сервиса исполнительной документации печать — основной сценарий,
      поэтому блокировку снимаем полностью. */
@media print {
  body {
    display: block !important;
    background: #fff !important;
  }
  html::after {
    content: none !important;
    display: none !important;
  }
  .nos-header,
  .nos-footer,
  .nos-toasts,
  .id-no-print,
  #cookie-banner,
  #scroll-top-btn {
    display: none !important;
  }
  .nos-content {
    padding: 0 !important;
    max-width: none !important;
  }
  .id-card,
  .nos-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
}

/* 3. Выделение текста разрешено везде (донор глушил user-select). */
body,
.nos-content,
.id-card {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ── Каркас страницы кабинета ─────────────────────────────────────────────── */

.id-page {
  max-width: 1080px;
  margin: 0 auto;
}
.id-page-narrow {
  max-width: 720px;
  margin: 0 auto;
}
.id-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.id-page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--id-text);
}
.id-page-sub {
  font-size: 13px;
  color: var(--id-text-light);
  margin-top: 2px;
}

/* ── Карточка ─────────────────────────────────────────────────────────────── */

.id-card {
  background: #fff;
  border: 1px solid var(--id-card-border);
  border-radius: var(--id-radius);
  box-shadow: 0 1px 3px rgba(15, 33, 55, 0.05);
  margin-bottom: 14px;
}
.id-card-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--id-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.id-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--id-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.id-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--id-blue);
}
.id-card-body {
  padding: 20px;
}
.id-card-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Кнопки ───────────────────────────────────────────────────────────────── */

.id-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--id-radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.id-btn-primary {
  background: var(--id-blue);
  color: #fff;
}
.id-btn-primary:hover {
  background: var(--id-blue-dark);
  color: #fff;
}
.id-btn-outline {
  background: #fff;
  color: var(--id-blue);
  border-color: var(--id-blue-light);
}
.id-btn-outline:hover {
  background: var(--id-blue-bg);
  color: var(--id-blue);
}
.id-btn-ghost {
  background: transparent;
  color: var(--id-text-light);
  border-color: var(--id-line);
}
.id-btn-ghost:hover {
  background: #f8fafc;
  color: var(--id-text);
}
.id-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}
.id-btn-lg {
  padding: 14px 30px;
  font-size: 16px;
}
.id-btn[disabled],
.id-btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Объекты ──────────────────────────────────────────────────────────────── */

.id-objects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.id-object {
  display: block;
  background: #fff;
  border: 1px solid var(--id-card-border);
  border-radius: var(--id-radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.id-object:hover {
  border-color: var(--id-blue-light);
  box-shadow: 0 4px 14px rgba(15, 33, 55, 0.08);
  transform: translateY(-1px);
  color: inherit;
}
.id-object-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--id-text);
  margin-bottom: 4px;
  word-break: break-word;
}
.id-object-meta {
  font-size: 12px;
  color: var(--id-text-light);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.id-object-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--id-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--id-muted);
}

/* Пустое состояние */
.id-empty {
  background: #fff;
  border: 1px dashed var(--id-blue-light);
  border-radius: var(--id-radius);
  padding: 48px 24px;
  text-align: center;
}
.id-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--id-text);
  margin-bottom: 6px;
}
.id-empty-text {
  font-size: 13px;
  color: var(--id-text-light);
  max-width: 460px;
  margin: 0 auto 18px;
  line-height: 1.6;
}

/* ── Бейджи статусов ──────────────────────────────────────────────────────── */

.id-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.id-badge-free {
  background: #f1f5f9;
  color: #64748b;
}
.id-badge-paid {
  background: #eef7e9;
  color: var(--id-green);
}
.id-badge-draft {
  background: #fff8e1;
  color: #b58900;
}
.id-badge-ready {
  background: var(--id-blue-bg);
  color: var(--id-blue);
}
.id-badge-hot {
  background: var(--id-yellow);
  color: #4a3200;
}

/* ── Таблица ──────────────────────────────────────────────────────────────── */

.id-table-wrap {
  overflow-x: auto;
}
.id-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.id-table th {
  background: #f8fafc;
  text-align: left;
  font-weight: 700;
  color: var(--id-text-light);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--id-line);
  white-space: nowrap;
}
.id-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--id-line);
  color: var(--id-text);
  vertical-align: top;
}
.id-table tr:last-child td {
  border-bottom: none;
}

/* ── Плашки / уведомления ─────────────────────────────────────────────────── */

.id-note {
  border-radius: var(--id-radius);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.id-note-info {
  background: var(--id-blue-bg);
  border: 1px solid var(--id-blue-light);
  color: var(--id-blue);
}
.id-note-warn {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #8a6100;
}
.id-note-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.id-note-ok {
  background: #f2f9ee;
  border: 1px solid #cfe6c2;
  color: #3f7229;
}

/* Плашка «функция платная» */
.id-paywall {
  background: linear-gradient(135deg, #fff8ec, #fffdf8);
  border: 1px solid #ffd89b;
  border-radius: var(--id-radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.id-paywall-text {
  flex: 1;
  min-width: 220px;
  font-size: 13px;
  color: #8a6100;
  line-height: 1.55;
}
.id-paywall-text b {
  display: block;
  font-size: 14px;
  color: #6b4b00;
  margin-bottom: 2px;
}

/* ── Тарифы ───────────────────────────────────────────────────────────────── */

.id-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.id-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 2px solid var(--id-card-border);
  border-radius: var(--id-radius-lg);
  padding: 24px 22px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.id-plan:hover {
  border-color: var(--id-blue-light);
}
.id-plan.selected {
  border-color: var(--id-blue);
  box-shadow: 0 6px 22px rgba(27, 58, 92, 0.12);
}
.id-plan.popular {
  border-color: var(--id-blue);
}
.id-plan-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--id-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.id-plan-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--id-text);
  margin-bottom: 4px;
}
.id-plan-desc {
  font-size: 12px;
  color: var(--id-text-light);
  line-height: 1.5;
  min-height: 34px;
}
.id-plan-price {
  font-size: 30px;
  font-weight: 800;
  color: var(--id-blue);
  margin: 14px 0 2px;
  letter-spacing: -0.5px;
}
.id-plan-price-note {
  font-size: 12px;
  color: var(--id-muted);
  min-height: 18px;
}
.id-plan-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--id-text);
}
.id-plan-list li {
  padding: 5px 0 5px 22px;
  position: relative;
  line-height: 1.5;
}
.id-plan-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--id-green);
  border-bottom: 2px solid var(--id-green);
  transform: rotate(-45deg);
}
.id-plan-foot {
  margin-top: auto;
  padding-top: 18px;
}
.id-plan-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--id-blue);
}
.id-plan-radio input {
  accent-color: var(--id-blue);
  width: 16px;
  height: 16px;
}

/* ── Водяной знак (бесплатный режим: печать/PDF) ──────────────────────────── */

.id-watermark {
  position: relative;
}
.id-watermark::after {
  content: attr(data-watermark);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(27, 58, 92, 0.09);
  transform: rotate(-24deg);
  pointer-events: none;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Мелочи ───────────────────────────────────────────────────────────────── */

.id-muted {
  color: var(--id-muted);
  font-size: 12px;
}
.id-hr {
  height: 1px;
  background: var(--id-line);
  border: 0;
  margin: 18px 0;
}
.id-inline-link {
  color: var(--id-blue);
  text-decoration: underline;
}
.id-inline-link:hover {
  color: var(--id-red);
}

@media (max-width: 640px) {
  .id-card-body {
    padding: 16px;
  }
  .id-plan {
    padding: 20px 18px;
  }
  .id-page-title {
    font-size: 19px;
  }
}

/* =============================================================================
   ДОПОЛНЕНИЕ (этап 5, лендинг): мост между кабинетом и дизайн-системой лендинга.
   -----------------------------------------------------------------------------
   Правило блока: только НОВЫЕ селекторы. Ни одно правило выше не меняется,
   ни один существующий компонент кабинета не переопределяется — всё ниже
   работает исключительно при явном добавлении класса в разметку.
   Полная дизайн-система лендинга живёт в отдельном файле /static/landing.css
   и сюда НЕ переносится: у лендинга своя палитра (#001B3D / #4B509E / #f97316),
   у кабинета своя (--id-blue #1B3A5C / --id-green #5ea13d). Смешивать нельзя.
   ========================================================================== */

/* ── Montserrat, локально ──────────────────────────────────────────────────
   Дубль @font-face из landing.css сделан осознанно: id.css подключён на всех
   страницах (base.html и standalone-шаблоны), а landing.css — только на
   лендинге. URL файлов совпадают, поэтому браузер качает шрифт один раз;
   лишних сетевых запросов дублирование не создаёт.
   Переменный шрифт (ось wght 700–900), SIL OFL 1.1 → static/fonts/OFL.txt.
   unicode-range: подмножество скачивается, только если его символы реально
   встретились в тексте, набранном Montserrat.
   ВАЖНО: сам по себе шрифт НИГДЕ не применяется — базовая типографика кабинета
   остаётся системной (см. --id-font). Montserrat включается только через
   --id-font-display / .id-sec-h / .id-display. */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/static/fonts/montserrat-cyrillic-700-900.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/static/fonts/montserrat-latin-700-900.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/static/fonts/montserrat-latin-ext-700-900.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Заголовочный шрифт. Запасной вариант честный: тот же системный стек,
     что и --id-font, поэтому при недоступности Montserrat страница просто
     набирается системным гротеском без синтетического жирного. */
  --id-font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  /* Фиолетовый маркер секций — единственный токен лендинга, который нужен
     внутренним витринным страницам (/spravochnik, /corporate, /checkout). */
  --id-accent-violet: #4b509e;
}

/* Явное включение заголовочного шрифта. Без этого класса ничего не меняется. */
.id-display {
  font-family: var(--id-font-display);
}

/* ── Якоря под липкой шапкой ──────────────────────────────────────────────
   .nos-header липкая и 64px высотой на десктопе (на ≤768px она position:relative,
   поэтому там смещение не нужно). Без scroll-margin-top переход по /#features
   и вызовы scrollIntoView прячут заголовок под панель. */
@media (min-width: 769px) {
  .nos-content :is(h1, h2, h3, section, .id-card)[id],
  [id].id-anchor {
    scroll-margin-top: 84px;
  }
}

/* ── Паттерн секции для внутренних витринных страниц ───────────────────────
   Тот же ритм, что на лендинге (маркер → заголовок → полоска → подзаголовок),
   но в масштабе кабинета. Префикс .id-sec-, с .section-* лендинга не пересекается. */
.id-sec {
  margin: 0 0 28px;
}
.id-sec-tag {
  display: inline-block;
  font-family: var(--id-font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--id-accent-violet);
  margin-bottom: 10px;
}
.id-sec-h {
  font-family: var(--id-font-display);
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin: 0 0 6px;
  overflow-wrap: break-word;
}
.id-sec-line {
  width: 60px;
  height: 4px;
  background: var(--id-accent-violet);
  border-radius: 2px;
  margin: 14px 0 14px;
}
.id-sec-center {
  text-align: center;
}
.id-sec-center .id-sec-line {
  margin-left: auto;
  margin-right: auto;
}
.id-sec-sub {
  font-size: 15px;
  color: var(--id-text-light);
  line-height: 1.65;
  max-width: 620px;
}
.id-sec-center .id-sec-sub {
  margin-left: auto;
  margin-right: auto;
}

/* ── Кнопка-действие в стиле лендинга (оранжевый градиент) ────────────────
   Только для точек конверсии (/checkout, /corporate), чтобы воронка выглядела
   единой с лендингом. Обычные кнопки кабинета (.id-btn-primary) не трогаем. */
.id-btn-cta {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.id-btn-cta:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.45);
}

/* ── Появление при прокрутке для внутренних страниц ────────────────────────
   Namespace .id-reveal намеренно отличается от .reveal лендинга: если обе
   системы окажутся на одной странице, обработчики не подерутся за один класс. */
.id-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.id-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.id-reveal-delay-1 { transition-delay: 0.1s; }
.id-reveal-delay-2 { transition-delay: 0.2s; }
.id-reveal-delay-3 { transition-delay: 0.3s; }
.id-reveal-delay-4 { transition-delay: 0.4s; }
/* Если JS не отработал — контент обязан остаться видимым. */
.no-js .id-reveal {
  opacity: 1;
  transform: none;
}

/* ── Защита от горизонтальной прокрутки ───────────────────────────────────
   Утилита-обёртка для широкого содержимого (схемы, длинные строки, таблицы
   вне .id-table-wrap). Правило «страница не прокручивается вбок никогда»
   решается обёртками, а не overflow-x:hidden на body. */
.id-scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.id-break-word {
  overflow-wrap: break-word;
  word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
  .id-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .id-btn-cta:hover,
  .id-object:hover {
    transform: none;
  }
}

@media print {
  .id-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
