/* Nunito (SIL Open Font License 1.1), хостван локално — без заявки към Google Fonts. */
@font-face {
  font-family: Nunito; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/nunito-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Nunito; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/nunito-latin.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;
}

:root {
  --bg: #fbf7f0;
  --bg-2: #f3efe6;
  --surface: #ffffff;
  --surface-2: #f6f3ec;
  --text: #2a2f36;
  --muted: #6b7280;
  --border: #ebe5d9;
  --accent: #14936b;
  --accent-hover: #0f7d5a;
  --accent-soft: #e3f4ec;
  --accent-text: #ffffff;
  --coral: #e5604f;
  --coral-soft: #fdebe7;
  --sun: #f4b63f;
  --sun-soft: #fdf3dc;
  --warn: #a86a00;
  --bar-bg: #ece7dc;
  --shadow: 0 1px 2px rgba(60, 50, 30, .04), 0 8px 24px rgba(60, 50, 30, .06);
  --shadow-lift: 0 2px 4px rgba(60, 50, 30, .05), 0 12px 32px rgba(60, 50, 30, .10);
  --radius: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, #e6f5ee 0%, transparent 60%),
    radial-gradient(900px 420px at -10% 0%, #fdeee4 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font: 17px/1.6 Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 5.5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3.8vw, 1.75rem); }
h3 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Горна лента с трикольор */
.tricolor { display: flex; height: 6px; }
.tricolor i { flex: 1; }
.tricolor i:nth-child(1) { background: #ffffff; }
.tricolor i:nth-child(2) { background: #00966e; }
.tricolor i:nth-child(3) { background: #d62612; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 820px; width: 100%; margin: 0 auto; padding: 18px 16px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 1.1rem;
}
.brand .year { color: var(--accent); }

main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 8px 16px 48px; }
.footer { max-width: 820px; margin: 0 auto; padding: 16px 16px 32px; color: var(--muted); font-size: .82rem; text-align: center; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(20px, 4.5vw, 36px); box-shadow: var(--shadow);
}
.stack > * + * { margin-top: 16px; }

button, .btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); padding: 11px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
button:hover { border-color: #d8d0c0; transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:focus-visible, .option:focus-within { outline: 3px solid #9fdcc3; outline-offset: 2px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 6px 16px rgba(20, 147, 107, .25); }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
button.big { padding: 14px 30px; font-size: 1.08rem; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: var(--surface-2); color: var(--text); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }

/* Начален екран */
.hero { text-align: center; }
.hero .wave { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.hero p.lead { font-size: 1.1rem; color: #4b5260; max-width: 600px; margin: 0 auto; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 26px 0; }
.fact { border-radius: 16px; padding: 14px 12px; text-align: center; }
.fact:nth-child(1) { background: var(--accent-soft); }
.fact:nth-child(2) { background: var(--sun-soft); }
.fact:nth-child(3) { background: var(--coral-soft); }
.fact:nth-child(4) { background: #e8eefc; }
.fact b { display: block; font-size: 1.5rem; font-weight: 800; }
.fact span { font-size: .85rem; color: #555b66; }
.notice { background: var(--surface-2); border-radius: 14px; padding: 12px 16px; font-size: .9rem; color: #555b66; text-align: left; }
.hero .row { justify-content: center; margin-top: 22px; }

/* Въпроси */
.progress-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.progress { flex: 1; height: 10px; background: var(--bar-bg); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #36b98a, var(--accent)); border-radius: 99px; transition: width .3s ease; }
.step { font-weight: 800; color: var(--accent); font-size: .95rem; white-space: nowrap; }
.topic {
  display: inline-block; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 800;
  color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px;
}
.options { display: grid; gap: 10px; margin: 20px 0; }
.option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 16px;
  border: 2px solid var(--border); background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s, box-shadow .15s;
}
.option:hover { border-color: #bfe3d3; transform: translateY(-1px); box-shadow: var(--shadow); }
.option input { margin-top: 5px; accent-color: var(--accent); flex: none; width: 18px; height: 18px; }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option.skip { border-style: dashed; color: var(--muted); background: transparent; }
.option.skip.selected { background: var(--surface-2); border-color: #cfc7b6; }
.important { display: inline-flex; gap: 8px; align-items: center; font-size: .95rem; cursor: pointer; user-select: none;
  padding: 8px 14px; border-radius: 999px; background: var(--sun-soft); }
.important input { accent-color: var(--sun); width: 18px; height: 18px; }

/* Резултати */
.winner { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.ring { --p: 0; width: 140px; height: 140px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--bar-bg) 0);
  display: grid; place-items: center; }
.ring > span { width: 112px; height: 112px; border-radius: 50%; background: var(--surface); display: grid; place-items: center;
  font-weight: 800; font-size: 2rem; color: var(--accent); }
.result-card { background: linear-gradient(135deg, #ffffff 0%, #f1faf5 100%); }
.ballot { display: inline-block; min-width: 2.2em; text-align: center; padding: 1px 9px; border-radius: 8px;
  background: var(--sun-soft); color: #8a5a00; font-weight: 800; font-size: .85rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge.warn { background: var(--sun-soft); color: var(--warn); }
.badge.ok { background: var(--accent-soft); color: var(--accent); }

.cand-list { display: grid; gap: 10px; }
.cand { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.cand > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: grid; grid-template-columns: 2.2em 1fr auto; gap: 12px; align-items: center; }
.cand > summary:hover { background: #fdfcf9; }
.cand > summary::-webkit-details-marker { display: none; }
.cand[open] > summary { border-bottom: 1px solid var(--border); background: #fdfcf9; }
.cand .rank { font-weight: 800; color: #b5ab98; text-align: right; }
.cand .name { font-weight: 800; }
.cand .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.cand .pct { font-weight: 800; font-size: 1.25rem; text-align: right; color: var(--accent); }
.bar { height: 8px; background: var(--bar-bg); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, #36b98a, var(--accent)); border-radius: 99px; }
.cand-body { padding: 18px; }

.cmp { display: grid; gap: 12px; margin-top: 12px; }
.cmp-item { border-radius: 14px; padding: 12px 14px; background: var(--surface-2); border-left: 5px solid var(--border); }
.cmp-item.m-full { border-color: var(--accent); background: #f1faf6; }
.cmp-item.m-part { border-color: var(--sun); background: #fefaf0; }
.cmp-item.m-none { border-color: var(--coral); background: #fef5f3; }
.cmp-item.m-na { border-color: var(--border); }
.cmp-q { font-weight: 800; font-size: .95rem; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: .9rem; margin-top: 6px; }
.cmp-grid .lbl { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.evidence { font-size: .87rem; color: #555b66; margin-top: 8px; }
.sources { font-size: .83rem; margin: 6px 0 0; padding-left: 18px; }
.sources li { word-break: break-word; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .winner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cmp-grid { grid-template-columns: 1fr; }
  .cand > summary { grid-template-columns: 1.6em 1fr auto; gap: 8px; padding: 12px 14px; }
}

/* Банер за съгласие */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lift);
  padding: 16px 18px; font-size: .92rem;
}
.consent p { margin: 0 0 12px; }
.consent .row button { padding: 9px 20px; }

.footer .links a { color: var(--muted); }
.silence { max-width: 820px; margin: 0 auto 8px; padding: 8px 16px; text-align: center; font-size: .9rem;
  background: var(--sun-soft); color: #7a5300; border-radius: 12px; }
.page p { margin: 0 0 12px; }
