/* Petition site styles: one column, system fonts, no images, light and dark. */

:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5b6067;        /* 5.8:1 on --bg */
  --border: #d9d9d4;
  --accent: #176b4c;       /* 6.4:1 with white text */
  --accent-text: #ffffff;
  --track: #e3e5e1;
  --reached: #c47f12;
  --error: #b3261e;        /* 6.5:1 on white */
  --banner-bg: #fff4d6;
  --banner-text: #5c4300;
  --banner-border: #e6c15c;
  --panel-bg: #eaf7f0;
  --panel-border: #b7dfc9;
  --focus: #1a5fb4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --card: #1d2024;
    --text: #e8eaed;
    --muted: #a1a7ae;      /* 7.4:1 on --bg */
    --border: #33373d;
    --accent: #3ec08a;     /* 8:1 with dark text */
    --accent-text: #0f1512;
    --track: #2a2e33;
    --reached: #f2b84b;
    --error: #ff8a80;      /* 7.8:1 on --bg */
    --banner-bg: #3a2f10;
    --banner-text: #ffe08a;
    --banner-border: #8a6d1c;
    --panel-bg: #152a20;
    --panel-border: #2f5c45;
    --focus: #8ab4f8;
  }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { color-scheme: light dark; } /* native form controls follow the theme */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
header, main, footer { max-width: 42rem; margin: 0 auto; padding: 0 1rem; }
header { padding-top: 2rem; }
footer { padding: 2rem 1rem 3rem; color: var(--muted); }
footer p { margin: 0.25rem 0; }
h1 { font-size: clamp(1.75rem, 4vw + 1rem, 2.5rem); line-height: 1.15; margin: 0.25rem 0 0.75rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.75rem; }
a { color: var(--accent); }
[hidden] { display: none !important; } /* keep the hidden attribute winning over the display rules below */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- Header text ---- */
.eyebrow { margin: 0; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lede { margin: 0 0 0.5rem; font-size: 1.2rem; }
.byline, .small, .hint, .privacy, .when, .others, .empty, .goal-line { color: var(--muted); font-size: 0.9rem; }
.byline { margin: 0 0 1.5rem; }

/* ---- Progress ---- */
.progress { margin: 1.5rem 0; }
.count { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 700; }
.goal-line { margin: 0.5rem 0 0; }
progress {
  display: block;
  width: 100%;
  height: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--track);
  color: var(--accent); /* used by browsers that ignore the pseudo-elements below */
}
progress::-webkit-progress-bar { background: var(--track); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
/* Goal reached: the bar changes colour. Works whether the class is on <progress> or its section. */
progress.reached, .reached progress { color: var(--reached); }
progress.reached::-webkit-progress-value, .reached progress::-webkit-progress-value { background: var(--reached); }
progress.reached::-moz-progress-bar, .reached progress::-moz-progress-bar { background: var(--reached); }

/* ---- Petition body ---- */
.body p { margin: 0 0 1rem; }

/* ---- Sign card and form ---- */
.sign-card, .panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.sign-card { margin: 2rem 0; }
.panel { background: var(--panel-bg); border-color: var(--panel-border); }
label { display: block; margin: 1rem 0 0.35rem; font-weight: 600; }
input, textarea, button { font: inherit; font-size: 16px; } /* 16px stops iOS Safari zooming in on focus */
input:not([type="checkbox"]), textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}
textarea { min-height: 6rem; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
input[type="checkbox"] { width: 1.35rem; height: 1.35rem; margin: 0 0.6rem 0 0; vertical-align: middle; accent-color: var(--accent); }
label:has(> input[type="checkbox"]) { display: flex; align-items: center; min-height: 44px; font-weight: 500; }
label:has(> input[type="checkbox"]) input { flex: none; }
.hint { margin: 0.25rem 0 0; }
.error { margin: 0.35rem 0 0; color: var(--error); font-weight: 600; font-size: 0.95rem; }
.banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--banner-border);
  border-radius: 8px;
  background: var(--banner-bg);
  color: var(--banner-text);
}
.privacy { margin: 1rem 0 0; }

/* Honeypot: off screen but still in the DOM, so bots fill it and people never see it. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Buttons ---- */
button, .btn {
  display: inline-block;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button[type="submit"] { width: 100%; margin-top: 1.25rem; font-size: 1.1rem; }
button:disabled { opacity: 0.6; cursor: wait; }

/* ---- Share block (inside the thank-you / already-signed panel) ---- */
.share-url { margin: 0.25rem 0 0.75rem; }
.share { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share .btn, .share button {
  flex: 1 1 8rem;
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 479px) {
  .share .btn, .share button { flex-basis: 100%; width: 100%; }
}

/* ---- Recent signatures ---- */
.signers ol { list-style: none; margin: 0; padding: 0; }
.signers li { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.signers li:last-child { border-bottom: 1px solid var(--border); }
.signers blockquote {
  margin: 0.35rem 0 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-style: italic;
}
.others { margin-top: 0.75rem; }

/* No animations are used; this makes that explicit for people who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
