:root {
  --forest: #0e3f26;
  --leaf: #1f7a43;
  --sprout: #6db57a;
  --mint: #e4f1e2;
  --mist: #f4f8f2;
  --surface: #fbfefa;
  --ink: #15291d;
  --muted: #4d6255;
  --line: #d3e2d1;
  --on-dark: #f4f8f2;
  --danger: #a8321f;
  --danger-bg: #fbeae8;
  --gold-ink: #7a5000;
  --gold-bg: #fdf1d6;
  --radius-m: 16px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --font-body: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.1;
  color: var(--forest);
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--leaf);
}

:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 20px;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 32px;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -64px;
  left: 12px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--forest);
  color: var(--on-dark);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

.page-error {
  margin: 0;
  padding: 14px 20px;
  text-align: center;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 500;
}

/* Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn .ph {
  font-size: 1.25em;
}

.btn-primary {
  background: var(--leaf);
  color: var(--on-dark);
}

.btn-primary:hover {
  background: var(--forest);
}

.btn-ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}

.btn-ghost:hover {
  background: var(--mint);
}

.btn-small {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.9375rem;
}

.btn-wide {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  background: #e3e9e2;
  border-color: transparent;
  color: #56675c;
  cursor: not-allowed;
  transform: none;
}

/* Шапка */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 248, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--leaf);
  color: var(--on-dark);
  font-size: 1.25rem;
}

.nav {
  display: none;
  gap: 28px;
}

.nav a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--leaf);
}

@media (min-width: 880px) {
  .nav {
    display: flex;
  }
}

.lang {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font: 600 0.8125rem/1 var(--font-body);
  cursor: pointer;
}

.lang-btn[aria-pressed='true'] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--on-dark);
}

/* Первый экран */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--mint);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 72px;
  padding-bottom: clamp(170px, 24vw, 320px);
}

@media (min-width: 768px) {
  .hero-inner {
    padding-top: 96px;
  }
}

.hero-title {
  max-width: 11ch;
  font-size: clamp(2.6rem, 1.2rem + 5.2vw, 5.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero-lead {
  max-width: 36ch;
  margin-top: 20px;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.3rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-ridge {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: clamp(150px, 22vw, 300px);
}

.ridge-back {
  fill: #c5dfbf;
}

.ridge-mid {
  fill: #86bf8e;
}

.ridge-front {
  fill: var(--leaf);
}

@media (prefers-reduced-motion: no-preference) {
  html.is-loaded .hero-inner > *,
  html:not(.js) .hero-inner > * {
    animation: rise 0.7s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 90ms);
  }

  html.is-loaded .ridge-layer,
  html:not(.js) .ridge-layer {
    animation: ridge 1.1s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 120ms);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

@keyframes ridge {
  from {
    transform: translateY(40px);
  }
}

/* Секции */

.section {
  padding-block: 72px;
}

@media (min-width: 768px) {
  .section {
    padding-block: 104px;
  }
}

.section-title {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-lead {
  max-width: 60ch;
  margin-top: 14px;
  color: var(--muted);
}

/* Положение */

.regulation-grid {
  display: grid;
  gap: 40px;
}

@media (min-width: 960px) {
  .regulation-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    align-items: start;
    gap: 64px;
  }

  .regulation-aside {
    position: sticky;
    top: 100px;
  }
}

.regulation-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
}

.confirm {
  width: 100%;
}

.confirm > summary {
  list-style: none;
}

.confirm > summary::-webkit-details-marker {
  display: none;
}

.confirm-panel {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.confirm-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-messenger {
  background: var(--surface);
  border-color: var(--line);
  color: var(--forest);
}

.btn-messenger:hover {
  border-color: var(--leaf);
}

.soon {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--mint);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.confirm-phone {
  color: var(--muted);
  font-size: 0.9375rem;
}

.accordion {
  display: grid;
  gap: 12px;
}

.acc-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.acc-item > summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  color: var(--forest);
  font-size: 1.125rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.acc-item > summary::-webkit-details-marker {
  display: none;
}

.acc-num {
  min-width: 1.5em;
  color: var(--leaf);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.acc-caret {
  margin-left: auto;
  font-size: 1.25rem;
  transition: transform 0.25s ease;
}

.acc-item[open] .acc-caret {
  transform: rotate(180deg);
}

.acc-body {
  display: grid;
  gap: 14px;
  max-width: 72ch;
  padding: 0 22px 24px 22px;
}

@media (min-width: 600px) {
  .acc-body {
    padding-left: calc(22px + 1.5em + 16px);
  }
}

.acc-body h3 {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
}

.acc-body ul,
.acc-body ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.25em;
}

.acc-body li::marker {
  color: var(--leaf);
}

/* Рейтинг */

.rating-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--radius-m);
  background: var(--mint);
  color: var(--forest);
  font-weight: 500;
}

.notice .ph {
  font-size: 1.25rem;
}

.notice-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.rating-skeleton {
  height: 420px;
  margin-top: 32px;
  border-radius: var(--radius-m);
  background: linear-gradient(90deg, var(--mint) 0%, #eef6ec 50%, var(--mint) 100%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .rating-skeleton {
    animation: shimmer 1.4s linear infinite;
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.table-scroll {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.rating-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.rating-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
}

.rating-row.is-leader {
  background: #eff7ed;
}

.rating-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  min-height: 44px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.rating-summary::-webkit-details-marker {
  display: none;
}

.rating-summary::marker {
  content: '';
}

.rating-summary:hover {
  background: var(--mint);
}

.rating-summary:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: -2px;
}

.rating-place {
  order: 1;
  min-width: 1.75em;
  color: var(--leaf);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
}

.rating-name {
  order: 2;
  color: var(--forest);
  font-size: 1rem;
  font-weight: 600;
}

.rating-summary .leader-badge {
  order: 2;
}

.rating-total-bar {
  order: 5;
  flex: 1 1 100%;
  height: 8px;
}

.rating-total {
  order: 3;
  margin-left: auto;
  color: var(--forest);
  font-family: var(--font-display);
  font-weight: 600;
}

.rating-caret {
  order: 4;
  color: var(--leaf);
  font-size: 1.1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .rating-caret {
    transition: transform 0.25s var(--ease-out);
  }
}

.rating-row details[open] .rating-caret {
  transform: rotate(180deg);
}

@media (min-width: 640px) {
  .rating-total-bar {
    order: 3;
    flex: 1 1 160px;
  }

  .rating-total {
    order: 4;
    margin-left: 0;
  }

  .rating-caret {
    order: 5;
  }
}

.rating-criteria {
  display: grid;
  gap: 16px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

@media (min-width: 640px) {
  .rating-criteria {
    grid-template-columns: 1fr 1fr;
  }
}

.rating-criterion-name {
  margin: 0 0 8px;
  color: var(--forest);
  font-size: 0.9375rem;
  font-weight: 600;
}

.leader-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--gold-bg);
  color: var(--gold-ink);
  font-size: 0.75rem;
  font-weight: 600;
}

.metric {
  display: grid;
  gap: 8px;
}

.metric-percent {
  color: var(--forest);
  font-weight: 600;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--mint);
}

.bar-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--leaf);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

@media (prefers-reduced-motion: no-preference) {
  .bar-fill {
    transition: transform 0.9s var(--ease-out);
    transition-delay: calc(var(--c, 0) * 60ms);
  }
}

.rating-list.is-waiting .bar-fill {
  transform: scaleX(0);
}

.metric-details {
  display: grid;
  gap: 2px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.metric-details div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.metric-details dt,
.metric-details dd {
  margin: 0;
}

.metric-details dd {
  color: var(--ink);
  font-weight: 600;
}

/* Голосование */

.vote-grid {
  display: grid;
  gap: 36px;
}

@media (min-width: 960px) {
  .vote-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: start;
    gap: 64px;
  }
}

.vote-window {
  margin-top: 18px;
  color: var(--forest);
  font-weight: 500;
}

.vote-form {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}

@media (min-width: 768px) {
  .vote-form {
    padding: 28px;
  }
}

.vote-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.district-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .district-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.district-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--mist);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.district-option:hover {
  border-color: var(--sprout);
}

.district-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.district-dot {
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.district-option:has(input:checked) {
  border-color: var(--leaf);
  background: var(--mint);
}

.district-option:has(input:checked) .district-dot {
  border-color: var(--leaf);
  background: var(--leaf);
  box-shadow: inset 0 0 0 4px var(--mint);
}

.district-option:has(input:focus-visible) {
  outline: 3px solid var(--forest);
  outline-offset: 2px;
}

.vote-form fieldset:disabled .district-option {
  cursor: default;
}

.vote-form fieldset:disabled .district-option:not(:has(input:checked)) {
  opacity: 0.6;
}

.turnstile:empty {
  display: none;
}

.vote-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 1.55em;
  font-weight: 500;
}

.vote-status .ph {
  flex: none;
  margin-top: 0.15em;
  font-size: 1.2rem;
}

.vote-status.is-success {
  color: var(--leaf);
}

.vote-status.is-error {
  color: var(--danger);
}

.vote-status.is-info {
  color: var(--muted);
}

/* Подвал */

.site-footer {
  padding-block: 48px;
  background: var(--forest);
  color: #dcebd8;
}

.site-footer :focus-visible {
  outline-color: var(--on-dark);
}

.footer-grid {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 48px;
  }
}

.logo-light {
  color: var(--on-dark);
}

.logo-light .logo-mark {
  background: var(--on-dark);
  color: var(--forest);
}

.footer-phone {
  color: var(--on-dark);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-phone:hover {
  text-decoration: underline;
}

.footer-note {
  color: #b9d1b4;
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Страница результатов */

.results-main {
  display: grid;
  gap: 16px;
  max-width: 760px;
  padding-block: 56px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.results-table th,
.results-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.results-table thead th {
  color: var(--forest);
  font-size: 0.9375rem;
}

.results-table tbody th {
  font-weight: 500;
}

.results-table .num {
  text-align: right;
}

.results-table tfoot th,
.results-table tfoot td {
  border-bottom: 0;
  background: var(--mint);
  font-weight: 700;
}

/* Маскот */

.hero-mascot {
  position: absolute;
  right: max(20px, calc((100% - 1240px) / 2 + 32px));
  bottom: calc(clamp(150px, 22vw, 300px) * 0.1);
  width: auto;
  height: clamp(150px, 38vw, 540px);
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: no-preference) {
  html.is-loaded .hero-mascot,
  html:not(.js) .hero-mascot {
    animation: mascot-rise 0.9s var(--ease-out) 0.25s both;
  }
}

@keyframes mascot-rise {
  from {
    opacity: 0;
    transform: translateY(48px);
  }
}

/* Переключатель языка */

.lang-btn:disabled {
  border-style: dashed;
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 419px) {
  .header-row {
    gap: 12px;
  }

  .site-header .logo-text {
    display: none;
  }
}

/* Капча */

.turnstile {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Экран загрузки */

.logo-icon {
  display: block;
  width: 20px;
  height: 20px;
}

.preloader {
  display: none;
}

html.js .preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--mint);
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  html.js .preloader {
    transition: opacity 0.4s var(--ease-out);
  }
}

html.is-loaded .preloader {
  opacity: 0;
  pointer-events: none;
}

.preloader-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.preloader .logo-mark {
  width: 64px;
  height: 64px;
}

.preloader .logo-icon {
  width: 32px;
  height: 32px;
}

.preloader-brand-text {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.preloader-mascot {
  width: auto;
  height: clamp(160px, 32vh, 280px);
  object-fit: contain;
}

.preloader-dots {
  display: flex;
  gap: 10px;
}

.preloader-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--leaf);
  opacity: 0.35;
}

@media (prefers-reduced-motion: no-preference) {
  .preloader-dots span {
    animation: preloader-pulse 1.2s ease-in-out infinite;
  }

  .preloader-dots span:nth-child(2) {
    animation-delay: 0.15s;
  }

  .preloader-dots span:nth-child(3) {
    animation-delay: 0.3s;
  }
}

@keyframes preloader-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }

  40% {
    opacity: 1;
    transform: scale(1.15);
  }
}
