:root {
  --bg: #f3f8fa;
  --surface: #ffffff;
  --text: #0d2433;
  --muted: #4a6272;
  --line: #d3e0e7;
  --accent: #0a5c8a;
  --accent-text: #ffffff;
  --sea: #06304d;
  --sea-text: #ffffff;
  --sea-muted: #b9d6e6;
  --aqua: #1397a8;
  --tint: #e3f2f6;
  --cta: #c2410c;
  --cta-text: #ffffff;
  --danger: #a32a1c;
  --warn-bg: #fff4c2;
  --error: #a32a1c;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1820;
    --surface: #13252f;
    --text: #e6eef1;
    --muted: #a3b6bf;
    --line: #2a424f;
    --accent: #6cc4e0;
    --accent-text: #06222c;
    --sea: #04263d;
    --sea-text: #ffffff;
    --sea-muted: #b9d6e6;
    --aqua: #4fc3d1;
    --tint: #10303c;
    --cta: #ff9466;
    --cta-text: #2a0f02;
    --danger: #ff9a8a;
    --warn-bg: #4a4010;
    --error: #ff9a8a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: clip;
}

main, header.site, footer.site { max-width: 46rem; margin: 0 auto; padding: 0 16px; }
main { padding-bottom: 3rem; }

/* Zaglavlje i podnožje preko cijele širine, sadržaj poravnat sa stupcem teksta. */
header.site, footer.site { max-width: none; padding-inline: max(16px, calc(50% - 23rem + 16px)); }
header.site { display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; align-items: center; padding-top: .8rem; padding-bottom: .8rem; background: var(--sea); color: var(--sea-text); }
header.site .brand { font-family: var(--display); font-size: 1.05rem; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; color: var(--sea-text); }
header.site nav { display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; font-size: .95rem; }
header.site nav a { color: var(--sea-muted); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
header.site nav a:hover { color: var(--sea-text); border-bottom-color: var(--aqua); }
header.site :focus-visible { outline-color: #fff; }
footer.site { margin-top: 2rem; padding-top: 1.5rem; padding-bottom: 2rem; background: var(--sea); color: var(--sea-muted); font-size: .9rem; }
footer.site a { color: var(--sea-text); }

a { color: var(--accent); text-underline-offset: .15em; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 5.2vw, 2.5rem); line-height: 1.15; margin: 1.75rem 0 1rem; }
h2 { font-size: clamp(1.4rem, 4vw, 1.75rem); line-height: 1.2; margin: 2.75rem 0 .9rem; }
h2::before { content: ""; display: block; width: 3rem; height: 4px; border-radius: 2px; margin-bottom: .7rem; background: var(--aqua); }
h3 { font-size: 1.12rem; line-height: 1.3; margin: 1.5rem 0 .5rem; }
li { margin-bottom: .4rem; }

.draft { margin: 0; padding: .6rem 16px; background: var(--warn-bg); text-align: center; font-weight: 600; }
.hint, .version, .small { color: var(--muted); font-size: .9rem; }
.src { font-size: .85rem; overflow-wrap: anywhere; }
.error { color: var(--error); font-weight: 600; margin: .25rem 0; }

.button, button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: .3rem .7rem;
}
.button {
  display: inline-block;
  background: var(--cta);
  border: 2px solid var(--cta);
  border-radius: 999px;
  color: var(--cta-text);
  font-weight: 700;
  font-size: 1.1rem;
  padding: .75rem 1.6rem;
  text-decoration: none;
  min-height: 48px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgb(6 48 77 / .22); }
.danger { color: var(--danger); border-color: var(--danger); }
.button.danger { background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } .button:hover { transform: none; } }

.counter { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 2rem 0 1rem; }
.counter div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem .9rem; text-align: center; }
.counter strong { display: block; font-family: var(--display); font-size: 2.6rem; line-height: 1.05; color: var(--accent); font-variant-numeric: tabular-nums; }
.counter span { color: var(--muted); font-size: .9rem; }
.counter p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }
.counter progress { grid-column: 1 / -1; width: 100%; height: 14px; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); accent-color: var(--aqua); }
.counter progress::-webkit-progress-bar { background: var(--line); }
.counter progress::-webkit-progress-value { background: var(--aqua); border-radius: 999px; }
.counter progress::-moz-progress-bar { background: var(--aqua); border-radius: 999px; }

.petition { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .5rem 1.1rem 1rem; }
.petition h2::before, .sheet h2::before, .mail h2::before { content: none; }

form { margin: 1rem 0; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field input {
  width: 100%;
  font: inherit;
  padding: .65rem .7rem;
  min-height: 48px;
  border: 1px solid var(--muted);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.field input[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.check { display: grid; grid-template-columns: 1.6rem 1fr; gap: .2rem .6rem; margin-bottom: .9rem; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: .2rem; accent-color: var(--accent); }
.check .error { grid-column: 2; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#potpis, #pristupnica { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--aqua); border-radius: 14px; padding: 0 1.1rem 1rem; margin-top: 2rem; }
#potpis h2, #pristupnica h2 { margin-top: 1.2rem; }
#potpis h2::before, #pristupnica h2::before { content: none; }

form.inline { display: inline; }
form.row { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
form.row .field { flex: 1 1 10rem; }
form.row .button { margin-bottom: 1rem; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border: 1px solid var(--line); padding: .35rem .5rem; text-align: left; vertical-align: top; }
tr.dup td { background: var(--warn-bg); }
td form { margin: 0; }

/* Stranice za ispis: uvijek svijetle, i na zaslonu, jer prikazuju papir. */
body.print { background: #fff; color: #000; }
body.print main { max-width: 190mm; }
body.print h1, body.print h2 { font-family: inherit; letter-spacing: 0; }
body.print h2::before { content: none; }
body.print .sheet, body.print .sheet-text { background: #fff; color: #000; border: 0; padding: 0; }
body.print .sheet { font-size: 10.5pt; line-height: 1.35; }
body.print .sheet h2 { font-size: 13pt; margin: 0 0 .4rem; }
body.print .sheet p { margin: .3rem 0; }
body.print .sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
body.print .sheet-no { font-weight: 700; white-space: nowrap; }
body.print .sheet table { margin: .5rem 0; font-size: 10pt; }
body.print .sheet th, body.print .sheet td { border: 1px solid #000; color: #000; }
body.print .sheet tbody td { height: 11mm; }
body.print .sheet th.n { width: 9mm; }
body.print .sheet th.oib { width: 30mm; }
body.print .sheet th.d { width: 20mm; }
body.print .small { font-size: 8pt; line-height: 1.25; color: #000; }
body.print .version { color: #000; }

@media print {
  @page { size: A4; margin: 12mm; }
  header.site, footer.site, .noprint, .draft { display: none; }
  body.print main { max-width: none; padding: 0; }
  body.print .sheet-text { font-size: 10pt; line-height: 1.3; break-after: page; }
  body.print .sheet-text h2 { font-size: 12.5pt; margin: .4rem 0 .2rem; }
  body.print .sheet-text h3 { font-size: 11pt; margin: .6rem 0 .2rem; }
  body.print .sheet-text p, body.print .sheet-text li { margin: .15rem 0; }
  body.print .sheet-text ol, body.print .sheet-text ul { margin: .2rem 0; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
}

/* Stranice inicijative */
.bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.hero-img { display: block; height: auto; aspect-ratio: 2 / 1; object-fit: cover; max-height: 30rem; background: var(--sea); }
.hero h1 { margin-top: 1.5rem; }
.hero .lead { font-size: 1.15rem; }
.eyebrow { margin: 1.5rem 0 -1rem; color: var(--aqua); font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5rem 0 .75rem; }
.button.secondary { background: transparent; border-color: var(--accent); color: var(--accent); }

.stats { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stats li { margin: 0; padding: 1rem; border-radius: 14px; background: var(--sea); color: var(--sea-muted); font-size: .9rem; line-height: 1.35; }
.stats strong { display: block; font-family: var(--display); font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 1.1; color: var(--sea-text); margin-bottom: .25rem; font-variant-numeric: tabular-nums; }
.stats .src { color: var(--sea-muted); }
@media (min-width: 40rem) { .stats { grid-template-columns: repeat(4, 1fr); } }

.messages { list-style: none; padding: 0; display: grid; gap: 14px; counter-reset: msg; }
.messages li { counter-increment: msg; position: relative; margin: 0; padding: 1rem 1.1rem 1rem 4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.messages li::before { content: counter(msg); position: absolute; left: 1rem; top: 1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--accent); font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.messages h3 { margin: .15rem 0 .35rem; font-size: 1.2rem; }
.messages p { margin: .3rem 0; }
.messages a { font-weight: 600; }

.facts { padding-left: 1.2rem; }
.facts li::marker { color: var(--aqua); }

.asks { list-style: none; padding: 0; display: grid; gap: 8px; }
.asks li { margin: 0; padding: .7rem 1rem .7rem 2.9rem; position: relative; background: var(--tint); border-radius: 10px; font-weight: 600; }
.asks li::before { content: "✓"; position: absolute; left: 1rem; color: var(--aqua); font-weight: 700; }

.steps { list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { margin: 0; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--cta); border-radius: 14px; }
.steps strong { display: block; font-size: 1.1rem; margin-bottom: .2rem; }

.band { margin-top: 3rem; padding: 2.5rem 16px; background: var(--sea); color: var(--sea-muted); text-align: center; }
.band h2 { margin: 0 0 .5rem; color: var(--sea-text); }
.band h2::before { margin-inline: auto; }
.band p { max-width: 36rem; margin: .5rem auto; }
.band .actions { justify-content: center; }
.band .button.secondary { border-color: var(--sea-text); color: var(--sea-text); }
.band + .hint, .band + .counter { margin-top: 2rem; }

.sourced { padding-left: 1.2rem; }
.sourced li { margin-bottom: .9rem; }
.sourced li::marker { color: var(--aqua); }
.sources { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); }
.case, .gap { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--aqua); border-radius: 14px; padding: .2rem 1.1rem .8rem; margin: 1rem 0; }
.gap.flaw { border-left-color: var(--danger); }
.case h3, .gap h3 { margin-top: .8rem; font-size: 1.2rem; }
.meta, .kind { color: var(--muted); font-size: .85rem; margin: .7rem 0 0; }
.kind { display: inline-block; padding: .1rem .6rem; border-radius: 999px; background: var(--tint); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: .75rem; }
.gap.flaw .kind { color: var(--danger); }
.gap .kind + h3 { margin-top: .4rem; }

/* Poziv na potpis u zaglavlju i brojač s jednim brojem */
header.site .nav-cta { margin-left: auto; padding: .4rem 1rem; font-size: .95rem; }
.counter div { grid-column: 1 / -1; }
.hero .actions { margin-top: 1.2rem; }
@media (max-width: 40rem) { .hero-img { max-height: 11rem; } .hero h1 { margin-top: 1rem; } }
@media (max-width: 40rem) { header.site .nav-cta { order: 2; } header.site nav { order: 3; flex-basis: 100%; } }

/* Karta ispusta na početnoj stranici: na širem zaslonu karta i opis jedno uz drugo */
.mapgrid { display: grid; gap: 1rem 1.5rem; margin-top: 1rem; }
@media (min-width: 44rem) { .mapgrid { grid-template-columns: 3fr 2fr; align-items: start; } }
figure.map { margin: 0; min-width: 0; }
figure.map img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
figure.map figcaption { margin-top: .4rem; font-size: .8rem; color: var(--muted); }
.outfalls { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; min-width: 0; }
.outfalls li { margin: 0; border-top: 3px solid var(--cta); padding-top: .5rem; color: var(--muted); font-size: .93rem; }
.outfalls strong { display: block; font-family: var(--display); font-size: 1.1rem; color: var(--text); }
