/* style.css — официальный “гос-современный” стиль + идеальная мобильная версия
   Mobile-first: на телефоне выглядит как мобильный сайт, на ПК — как ПК-версия.
   Под твои классы (из всех страниц): header__top/header__row, header__nav, brand__*, tools/select,
   nav/nav__link, hero/cards/grid/panel/card/tile, input/textarea/btn, info-table, notice, breadcrumbs, footer.
*/

/* =======================
   БАЗА / ПЕРЕМЕННЫЕ
   ======================= */
:root{
  --bg:#f6f7fb;
  --paper:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --line:#d7dde8;

  --primary:#0b3d91;      /* гос-синий */
  --primary2:#0a2f6e;
  --accent:#1565c0;

  --shadow: 0 10px 26px rgba(15, 23, 42, .08);
  --shadow-sm: 0 8px 18px rgba(15, 23, 42, .08);

  --radius: 14px;
  --radius2: 18px;

  --focus: 0 0 0 4px rgba(11,61,145,.22);
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", sans-serif;

  /* layout */
  --container: 1160px;
  --pad: clamp(14px, 4vw, 20px);

  /* typography */
  --h1: clamp(22px, 6.2vw, 34px);
  --h2: clamp(18px, 4.8vw, 26px);
  --h3: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
html{ scroll-behavior:smooth; -webkit-text-size-adjust:100%; text-size-adjust:100%; }

body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

img,svg{ max-width:100%; height:auto; display:block; }
a{ color: inherit; text-decoration:none; }
a:hover{ text-decoration: underline; }

:focus-visible{ outline:none; box-shadow: var(--focus); border-radius: 12px; }

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.sr-only{
  position:absolute; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* skip links */
.skip, .skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px; height:1px;
  overflow:hidden;
}
.skip:focus, .skip-link:focus{
  left:12px; top:12px;
  width:auto; height:auto;
  padding:10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  z-index: 10000;
  border-radius: 12px;
}

/* =======================
   ТИПОГРАФИКА
   ======================= */
.h1{ margin:0 0 10px; font-size: var(--h1); line-height:1.12; letter-spacing:-.02em; }
.h2{ margin:0 0 10px; font-size: var(--h2); line-height:1.2; }
.h3{ margin:0 0 10px; font-size: var(--h3); line-height:1.25; }

p{ margin:0 0 12px; }
.lead{ font-size: 15px; color: var(--muted); }
.muted{ color: var(--muted); font-size: 14px; }

.note, .hint{
  color: var(--muted);
  font-size: 14px;
}

/* =======================
   ШАПКА
   ======================= */
.header{
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header__row,
.header__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

.brand__mark,
.brand__logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color:#fff;
  font-weight: 900;
  letter-spacing:.02em;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}

.brand__text{ min-width:0; }
.brand__title{ font-weight: 900; font-size: 15px; line-height:1.15; }
.brand__subtitle{ color: var(--muted); font-size: 12.5px; line-height:1.25; margin-top:2px; }

.header__actions,
.tools{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.tools__label{ font-size: 13px; color: var(--muted); }

.select{
  appearance:none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 14px;
  min-height: 38px;
}

.sep{ width:1px; height:22px; background: var(--line); }

/* =======================
   НАВИГАЦИЯ
   ======================= */
/* desktop/tablet: обычная строка */
.header__nav{
  border-top: 1px solid var(--line);
}

.nav{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 10px 0 14px;
  flex-wrap: wrap;
}

.nav__link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.nav__link:hover{
  background: rgba(11,61,145,.06);
  border-color: rgba(11,61,145,.28);
  text-decoration:none;
  transform: translateY(-1px);
}

.nav__link.is-active,
.nav__link[aria-current="page"]{
  background: rgba(11,61,145,.10);
  border-color: rgba(11,61,145,.38);
  color: var(--primary2);
  font-weight: 900;
}

/* Поиск в шапке (если есть) */
.search{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-left: auto;
}

.input{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 14px;
  min-height: 38px;
  width: 260px;
}

.textarea{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 14px;
  min-height: 110px;
  width: 100%;
  resize: vertical;
}

/* =======================
   КНОПКИ
   ======================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor:pointer;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  padding: 9px 12px;
  min-height: 38px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.btn:hover{
  background: rgba(15,23,42,.03);
  transform: translateY(-1px);
  text-decoration:none;
}

.btn.primary,
.btn--primary{
  background: var(--primary);
  border-color: var(--primary);
  color:#fff;
}
.btn.primary:hover,
.btn--primary:hover{
  background: var(--primary2);
  border-color: var(--primary2);
  box-shadow: 0 10px 22px rgba(11,61,145,.18);
}

.control{ display:flex; gap:10px; flex-wrap:wrap; }

/* =======================
   ОСНОВНОЕ / СЕТКИ
   ======================= */
.main{ padding: 16px 0 28px; }

.page{ display:block; }
.section{ margin-top: 16px; }

.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
}

.hero__grid{ display:grid; gap: 12px; }

.cards{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.two{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.panel, .card, .tile{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}

.panel{ padding: 14px; }
.card{ padding: 13px; }
.tile{ padding: 13px; }

.tile__title{ font-weight: 900; margin: 0 0 6px; }
.tile__desc{ color: var(--muted); margin: 0; }

.badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11,61,145,.06);
  font-size: 13px;
  font-weight: 800;
}

.dot{
  width:10px; height:10px;
  border-radius:999px;
  background: var(--accent);
}

/* KPI (если есть) */
.kpi{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.kpi__item{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.kpi__top{ font-weight: 900; }

/* =======================
   NOTICE / BREADCRUMBS
   ======================= */
.notice{
  border: 1px solid rgba(21,101,192,.28);
  background: rgba(21,101,192,.08);
  border-radius: var(--radius);
  padding: 12px;
}
.notice__title{ font-weight: 900; margin:0 0 6px; }

.breadcrumbs{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items:center;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumbs a{ color: var(--primary); }

/* =======================
   ТАБЛИЦЫ
   ======================= */
.info-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.info-table th,
.info-table td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

.info-table th{
  text-align: left;
  background: rgba(11,61,145,.06);
  font-weight: 900;
}

.info-table tr:last-child td{ border-bottom: 0; }

/* =======================
   FOOTER
   ======================= */
.footer{
  margin-top: 22px;
  padding: 18px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
}

.footer__row{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer__title{ font-weight: 900; color: var(--text); }
.footer__links{ display:flex; gap: 10px; flex-wrap: wrap; }

/* =======================
   RESPONSIVE: TABLET
   ======================= */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
  .cards{ grid-template-columns: 1fr; }
  .kpi{ grid-template-columns: 1fr; }

  .search{ width: 100%; margin-left: 0; }
  .input{ width: 100%; }
}

/* =======================
   МОБИЛЬНАЯ ВЕРСИЯ “как мобильная”
   - меню: бургер + выезжающая панель (offcanvas)
   - элементы компактнее (без “великана”)
   - немного воздуха от краёв
   ======================= */

/* кнопка бургера (создаётся JS-ом, но стили тут) */
.burger{
  display:none;
  align-items:center;
  justify-content:center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 9998;
}
.backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 760px){
  /* шапка — в колонку */
  .header__row,
  .header__top{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 0;
  }

  /* инструменты — аккуратно */
  .header__actions,
  .tools{
    width: 100%;
    justify-content: space-between;
  }

  .tools__label{ display:none; } /* на мобилке лишнее */
  .select{
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13.5px;
  }

  /* показываем бургер */
  .burger{ display:inline-flex; }

  /* nav превращаем в выезжающую панель */
  .nav{
    position: fixed;
    inset: 0 0 0 auto;
    width: min(86vw, 360px);
    height: 100dvh;
    background: var(--paper);
    border-left: 1px solid var(--line);
    box-shadow: -16px 0 40px rgba(15,23,42,.18);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;

    transform: translateX(100%);
    transition: transform .18s ease;
    z-index: 9999;
  }

  .nav.is-open{ transform: translateX(0); }

  /* ссылки — большие тап-таргеты, но не “великан” */
  .nav__link{
    width: 100%;
    justify-content: flex-start;
    padding: 11px 12px;
    border-radius: 12px;
    white-space: normal;
  }

  /* поиск в меню — тоже на ширину */
  .search{ width: 100%; margin: 6px 0 0; }
  .input{
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 14px;
  }

  /* контент: чуть компактнее */
  .main{ padding: 14px 0 22px; }
  .panel{ padding: 13px; }
  .card, .tile{ padding: 12px; }

  /* формы: компактнее */
  .textarea{
    min-height: 96px;
    padding: 7px 10px;
  }

  .btn{
    min-height: 36px;
    padding: 8px 11px;
  }

  /* таблицы: горизонтальный скролл */
  .info-table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
  }
  .info-table th,
  .info-table td{ white-space: nowrap; }
}

/* =======================
   ТЕМЫ (data-theme на <html>)
   ======================= */

/* Повышенная читаемость */
html[data-theme="vision"]{
  font-size: 18px;
}
html[data-theme="vision"] body{
  line-height: 1.7;
  --focus: 0 0 0 4px rgba(11,61,145,.30);
}

/* Высокая контрастность: неоново-синий текст + чуть крупнее */
html[data-theme="contrast"]{
  font-size: 18px;
}
html[data-theme="contrast"] body{
  --bg:#000;
  --paper:#000;
  --text:#33ccff;
  --muted:#b8f8ff;
  --line: rgba(51,204,255,.55);
  --primary:#33ccff;
  --primary2:#33ccff;
  --accent:#66e0ff;
  --focus: 0 0 0 4px rgba(0,170,255,.35);
}

html[data-theme="contrast"] .panel,
html[data-theme="contrast"] .card,
html[data-theme="contrast"] .tile,
html[data-theme="contrast"] .nav__link,
html[data-theme="contrast"] .info-table,
html[data-theme="contrast"] .input,
html[data-theme="contrast"] .textarea,
html[data-theme="contrast"] .select{
  background:#000 !important;
  border-color: rgba(51,204,255,.75) !important;
  color: #33ccff !important;
}

html[data-theme="contrast"] .btn{
  background: transparent !important;
  color: #33ccff !important;
  border-color: rgba(51,204,255,.75) !important;
}
html[data-theme="contrast"] .btn:hover{
  background: rgba(0,170,255,.18) !important;
  box-shadow: 0 0 10px rgba(0,170,255,.30);
}
html[data-theme="contrast"] .btn.primary,
html[data-theme="contrast"] .btn--primary{
  background: transparent !important;
  border-color: #66e0ff !important;
  color: #66e0ff !important;
}

/* Дальтоники: меняем только акценты */
html[data-theme="cb-protan"] body{
  --primary:#0b5bd3; --primary2:#0846a4; --accent:#b45309;
}
html[data-theme="cb-deutan"] body{
  --primary:#1453d1; --primary2:#0f3ea2; --accent:#b45309;
}
html[data-theme="cb-tritan"] body{
  --primary:#6d28d9; --primary2:#4c1d95; --accent:#be185d;
}

/* Видимый контур при hover в cb-режимах */
html[data-theme^="cb-"] .btn.primary:hover,
html[data-theme^="cb-"] .btn--primary:hover{
  outline: 2px solid rgba(15,23,42,.25);
  outline-offset: 2px;
}