/* Дизайн-система портала по Брендбуку Движения «Профессионалы» 2026 */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-cyrillic-wght-normal.40ee6416c01f.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-latin-wght-normal.9a01b69183a9.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Палитра брендбука */
  --c-yellow: #FCEE73;
  --c-lime: #CFE630;
  --c-green: #4ECC0A;
  --c-green-dark: #0F9346;
  --c-gray: #BDC6CB;
  --c-graphite: #364046;
  --c-white: #FFFFFF;
  --c-black: #000000;
  /* Производные */
  --c-bg: #FFFFFF;
  --c-bg-soft: #F3F5F6;
  --c-text: var(--c-graphite);
  --c-muted: #5F6B72;
  --c-border: var(--c-gray);
  --c-link: var(--c-green-dark);
  --c-danger: #B3261E;
  --c-danger-bg: #FCE8E6;
  --c-warn-bg: #FFF8D6;
  --c-ok-bg: #E9F8DF;

  --radius: 6px;
  --gap: 16px;
  --container: 1200px;
  --shadow: 0 1px 2px rgba(54, 64, 70, .08), 0 4px 16px rgba(54, 64, 70, .06);
  font-size: 16px;
}

/* Версия для слабовидящих */
html.a11y { font-size: 20px; }
html.a11y body { --c-text: #000; --c-muted: #000; --c-link: #000; --c-border: #000; }
html.a11y img:not(.keep) { filter: grayscale(1); }
html.a11y .card, html.a11y .btn { border-width: 2px; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: var(--c-link); text-underline-offset: 2px; }
a:hover { color: var(--c-black); }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { color: var(--c-black); margin: 0 0 .6em; line-height: 1.2; }
h1, h2 { font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--c-green-dark); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.section { padding-top: 40px; padding-bottom: 40px; }
@media (max-width: 600px) { .section { padding-top: 24px; padding-bottom: 24px; } }
.muted { color: var(--c-muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Шапка ─────────────────────────────── */
.topbar { background: var(--c-graphite); color: var(--c-white); font-size: .8125rem; }
.topbar .container { display: flex; gap: 16px; justify-content: flex-end; align-items: center; min-height: 36px; flex-wrap: wrap; }
.topbar a, .topbar button { color: var(--c-white); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.topbar a:hover, .topbar button:hover { color: var(--c-lime); }

.header { background: var(--c-white); border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 20; }
.header .container { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--c-black); margin-right: auto; }
.brand img { width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-weight: 800; text-transform: uppercase; font-size: 1rem; letter-spacing: .02em; }
.brand-text span { font-size: .75rem; color: var(--c-muted); text-transform: uppercase; }

.nav { display: none; gap: 4px; }
.nav a { text-decoration: none; color: var(--c-black); font-weight: 500; padding: 8px 10px; border-radius: var(--radius); text-transform: uppercase; font-size: .875rem; }
.nav a:hover, .nav a.active { background: var(--c-bg-soft); }
.nav a.active { box-shadow: inset 0 -3px 0 var(--c-green); border-radius: var(--radius) var(--radius) 0 0; }
.burger { display: inline-flex; background: none; border: 1px solid var(--c-border); border-radius: var(--radius); width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.mobile-nav { border-top: 1px solid var(--c-border); background: var(--c-white); }
.mobile-nav a { display: block; padding: 14px 16px; text-decoration: none; color: var(--c-black); font-weight: 500; border-bottom: 1px solid var(--c-bg-soft); text-transform: uppercase; }
@media (min-width: 1180px) { .nav { display: flex; } .burger, .mobile-nav { display: none !important; } }

/* ── Hero ──────────────────────────────── */
.hero { background: var(--c-graphite); color: var(--c-white); position: relative; overflow: hidden; }
.hero .container { padding-top: 56px; padding-bottom: 56px; position: relative; z-index: 1; }
.hero h1 { color: var(--c-white); max-width: 820px; }
.hero p { max-width: 640px; font-size: 1.125rem; color: #E6EBEE; }
.hero .slogan { color: var(--c-green); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.hero::after { /* сфера — стилеобразующий элемент */
  content: ""; position: absolute; right: -120px; top: 50%; width: 420px; height: 420px; transform: translateY(-50%);
  border-radius: 50%; border: 36px solid transparent;
  border-color: var(--c-green) var(--c-green) transparent #1e2427;
  opacity: .9;
}
@media (max-width: 700px) { .hero::after { width: 260px; height: 260px; right: -140px; border-width: 24px; opacity: .5; } }

.page-head { background: var(--c-bg-soft); border-bottom: 1px solid var(--c-border); }
.page-head .container { padding-top: 28px; padding-bottom: 20px; }
.page-head h1 { margin-bottom: .25em; }
.breadcrumbs { font-size: .875rem; color: var(--c-muted); margin-bottom: 8px; }
.breadcrumbs a { color: var(--c-muted); }

/* ── Кнопки ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--c-graphite); background: var(--c-white); color: var(--c-black);
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--c-bg-soft); color: var(--c-black); }
.btn-primary { background: var(--c-green); border-color: var(--c-green); color: var(--c-black); }
.btn-primary:hover { background: var(--c-lime); border-color: var(--c-lime); }
.btn-dark { background: var(--c-graphite); border-color: var(--c-graphite); color: var(--c-white); }
.btn-dark:hover { background: var(--c-black); color: var(--c-white); }
.btn-danger { border-color: var(--c-danger); color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger-bg); color: var(--c-danger); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .arrow::after { content: "→"; }
.link-btn { background: none; border: 0; padding: 8px 0; min-height: 36px; color: var(--c-link); font: inherit; cursor: pointer; text-decoration: underline; }

/* ── Карточки ──────────────────────────── */
.card { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-accent { border-left: 6px solid var(--c-green); }
.card h3 { margin-top: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 2rem; font-weight: 800; color: var(--c-black); line-height: 1; }
.stat span { color: var(--c-muted); font-size: .875rem; }

.person { display: flex; gap: 14px; align-items: flex-start; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--c-bg-soft); border: 3px solid var(--c-green); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--c-graphite); }
.avatar-lg { width: 96px; height: 96px; font-size: 1.5rem; }

/* ── Бейджи ────────────────────────────── */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; background: var(--c-bg-soft); color: var(--c-graphite); border: 1px solid var(--c-border); }
.badge-draft { background: var(--c-bg-soft); }
.badge-open { background: var(--c-green); border-color: var(--c-green); color: var(--c-black); }
.badge-closed { background: var(--c-yellow); border-color: var(--c-yellow); color: var(--c-black); }
.badge-approved { background: var(--c-graphite); border-color: var(--c-graphite); color: var(--c-white); }
.badge-elected { background: var(--c-green); border-color: var(--c-green); color: var(--c-black); }
.badge-tie { background: var(--c-yellow); border-color: #E0CF3A; color: var(--c-black); }
.badge-not_elected { background: var(--c-white); }
.badge-problem { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-danger); }

/* ── Уведомления ───────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--c-border); background: var(--c-bg-soft); margin-bottom: 16px; }
.alert-success { background: var(--c-ok-bg); border-color: var(--c-green); }
.alert-error { background: var(--c-danger-bg); border-color: var(--c-danger); color: #5c120d; }
.alert-warning { background: var(--c-warn-bg); border-color: #E0CF3A; }
.alert-info { background: var(--c-bg-soft); }
.alert ul { margin: 0; padding-left: 20px; }

/* ── Формы ─────────────────────────────── */
.form { display: grid; gap: 16px; max-width: 760px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .help { font-size: .8125rem; color: var(--c-muted); margin-top: 4px; }
.field .errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--c-danger); font-size: .875rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--c-text);
  border: 1px solid var(--c-gray); border-radius: var(--radius); background: var(--c-white);
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--c-green-dark); outline: 2px solid rgba(15, 147, 70, .25); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--c-green-dark); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 2px; flex: none; }
input[type=file] { font: inherit; max-width: 100%; }

/* ── Таблицы ───────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--c-bg-soft); text-align: left; vertical-align: top; }
.table th { background: var(--c-bg-soft); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-elected td { background: #F2FBEC; }
.table tr.is-tie td { background: #FFFBE3; }
@media (max-width: 700px) {
  table.table.stackable thead { display: none; }
  table.table.stackable, .stackable tbody, .stackable tr, .stackable td { display: block; width: 100%; }
  .stackable tr { border-bottom: 1px solid var(--c-border); padding: 8px 0; }
  .stackable td { border: 0; padding: 4px 12px; }
  .stackable td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--c-muted); }
}

/* ── Вкладки управления ────────────────── */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--c-border); margin-bottom: 24px; scrollbar-width: thin; }
.tabs a { white-space: nowrap; padding: 10px 14px; text-decoration: none; color: var(--c-graphite); font-weight: 500; border-bottom: 3px solid transparent; }
.tabs a.active { border-bottom-color: var(--c-green); color: var(--c-black); font-weight: 700; }
.tabs a:hover { background: var(--c-bg-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--c-border); text-decoration: none; color: var(--c-graphite); font-size: .875rem; }
.chip.active { background: var(--c-graphite); border-color: var(--c-graphite); color: var(--c-white); }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

details.box { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 0 16px; background: var(--c-white); }
details.box > summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; }
details.box > summary::before { content: "＋ "; color: var(--c-green-dark); }
details.box[open] > summary::before { content: "－ "; }
details.box[open] { padding-bottom: 16px; }

/* ── Анкета ────────────────────────────── */
.ballot-cat { border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.ballot-cat > header { background: var(--c-bg-soft); padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.ballot-cat > header h3 { margin: 0; }
.ballot-cat.is-full > header { background: var(--c-ok-bg); }
.counter { font-weight: 700; white-space: nowrap; }
.cand { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--c-bg-soft); cursor: pointer; }
.cand:hover { background: #FAFBFB; }
.cand.is-checked { background: #F2FBEC; }
.cand.is-disabled { opacity: .5; cursor: not-allowed; }
.cand input { width: 24px; height: 24px; flex: none; }
.cand .avatar { width: 52px; height: 52px; border-width: 2px; }
.cand-info { flex: 1; min-width: 0; }
.cand-info b { display: block; }
.cand-info span { font-size: .875rem; color: var(--c-muted); }
.ballot-bar .container { padding-left: 16px !important; padding-right: 16px !important; }
.ballot-bar { position: sticky; bottom: 0; background: var(--c-white); border-top: 1px solid var(--c-border); padding: 12px 0; box-shadow: 0 -4px 16px rgba(0,0,0,.06); z-index: 10; }

/* ── Модальное окно ────────────────────── */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--c-white); border-radius: var(--radius); max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; }
.modal h3 { margin-top: 0; }
[x-cloak] { display: none !important; }

/* ── Подвал ────────────────────────────── */
.footer { background: var(--c-graphite); color: #D9DFE2; margin-top: 48px; font-size: .9375rem; }
.footer .container { padding-top: 32px; padding-bottom: 24px; }
.footer a { color: var(--c-white); }
.footer a:hover { color: var(--c-lime); }
.footer h4 { color: var(--c-white); text-transform: uppercase; font-size: .875rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-bottom { border-top: 1px solid #4b565c; margin-top: 24px; padding-top: 16px; font-size: .8125rem; color: #AAB4BA; }
.footer .stripe { height: 6px; background: linear-gradient(90deg, #1e2427 0 18%, var(--c-green) 26% 100%); }

/* ── Телефоны ──────────────────────────── */
@media (max-width: 600px) {
  :root { --gap: 12px; }
  h1 { font-size: 1.5rem; }
  .card { padding: 16px; }
  .page-head .container { padding-top: 20px; padding-bottom: 14px; }
  .hero .container { padding-top: 36px; padding-bottom: 36px; }
  .hero p { font-size: 1rem; }
  .avatar-lg { width: 64px; height: 64px; font-size: 1.1rem; }
  .brand img { width: 40px; height: 40px; }
  .brand-text b { font-size: .9rem; }
  .brand-text span { font-size: .6875rem; }
  .header .container { min-height: 60px; }
  .topbar .container { gap: 12px; justify-content: space-between; }
  .stat b { font-size: 1.6rem; }
  .grid { grid-template-columns: 1fr; }
  .tabs a { padding: 10px 12px; }
  /* Анкета: компактная строка кандидата */
  .cand { gap: 10px; padding: 10px 12px; }
  .cand .avatar { width: 40px; height: 40px; font-size: .8rem; }
  .cand-info b { font-size: .95rem; line-height: 1.25; }
  .cand-info span { display: block; font-size: .8125rem; line-height: 1.3; }
  .cand .btn-info { width: 40px; min-height: 40px; padding: 0; }
  .cand .btn-info .lbl { display: none; }
  .ballot-cat > header { padding: 12px; }
  .ballot-bar .btn { padding-left: 14px; padding-right: 14px; }
  .modal { padding: 18px; }
}
.btn-info .ico { display: none; font-weight: 800; font-style: normal; }
@media (max-width: 600px) { .btn-info .ico { display: inline; } }
.hint-warn { color: var(--c-muted); }
.tried .hint-warn { color: var(--c-danger); }
.btn.is-muted { opacity: .55; }
@media (max-width: 700px) {
  .stackable td[data-label]:first-child::before { display: none; }
  .stackable td:first-child { font-weight: 600; color: var(--c-black); }
  .stackable td:first-child .small, .stackable td:first-child .muted { font-weight: 400; }
}
@media (max-width: 600px) {
  .topbar .hide-sm { display: none; }
  .check { min-height: 36px; align-items: center; }
}
