/* Nationaler Abfallkalender — mobile-first, ein File, System-Fonts, kein Build. */

/* Farbrichtung «Fahrplan»: Anthrazit-Interface, Schweizrot nur für die
   Entsorgungs-Anfrage (Lead-CTA). Aus dem App-Icon V3b abgeleitet. */
:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef0f2;
  --text: #1b1e21;
  --muted: #555c63;
  --border: #e2e5e8;
  --primary: #24282c;
  --primary-hover: #3a4046;
  --primary-ink: #ffffff;
  --primary-tint: #eaecee;
  --accent: #c8102e;
  --accent-hover: #a30d26;
  --accent-ink: #ffffff;
  --banner-bg: #fff5e6;
  --banner-border: #eaa32a;
  --banner-text: #7a4c00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 26, 29, .05), 0 6px 20px rgba(23, 26, 29, .06);
  /* Fraktions-Farbcode */
  --f-kehricht: #52606d;
  --f-papier: #2f6df6;
  --f-karton: #b4530a;
  --f-gruengut: #2fa84f;
  --f-metall: #7c5cff;
  --f-glas: #14a0a0;
  --f-default: #64748b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131518;
    --surface: #1b1e22;
    --surface-2: #24282d;
    --text: #e9ebee;
    --muted: #a2a9b1;
    --border: #2e3339;
    --primary: #e9ebee;
    --primary-hover: #ffffff;
    --primary-ink: #16181b;
    --primary-tint: #24282d;
    --accent: #d92440;
    --accent-hover: #e5324b;
    --accent-ink: #ffffff;
    --banner-bg: #2a2213;
    --banner-border: #8f6d22;
    --banner-text: #f3d69c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35);
    --f-kehricht: #94a3b0;
    --f-papier: #6a9bff;
    --f-karton: #e0863c;
    --f-gruengut: #57c96f;
    --f-metall: #a58cff;
    --f-glas: #3cc7c7;
    --f-default: #8a9aa4;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* Kopf / Wortmarke */
.masthead { padding-top: 8px; margin-bottom: 20px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
}
.brand__logo {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: block;
}

/* Push-Erinnerungen / Fraktions-Auswahl */
.frak-wahl {
  display: flex; flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 0 14px;
  padding: 0;
  list-style: none;
}
.frak-wahl label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .95rem;
}
.push-status { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }

h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
.lede { color: var(--muted); margin: 0 0 22px; }

/* Suche */
.search { margin-bottom: 20px; }
.search__row { display: flex; gap: 8px; }
.search input[type="search"],
.search input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.search input::placeholder { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); }
.btn--block { display: flex; width: 100%; padding: 16px; font-size: 1.05rem; }

/* Trefferliste */
.results { list-style: none; margin: 0; padding: 0; }
.results li + li { margin-top: 8px; }
.results a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.results a:hover { border-color: var(--primary); }
.results .kanton {
  flex: none;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: 999px;
}
.empty { color: var(--muted); }

/* Ausnahme-Banner */
.banner {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  margin: 0 0 20px;
  background: var(--banner-bg);
  border: 1px solid var(--banner-border);
  border-left-width: 5px;
  border-radius: 12px;
  color: var(--banner-text);
}
.banner__icon { flex: none; }
.banner p { margin: 0; }
.banner .zeitraum { display: block; font-size: .85rem; opacity: .85; margin-top: 2px; }

/* Zonen-Auswahl */
.zone-hint { color: var(--muted); }

/* Terminliste */
.termine { list-style: none; margin: 0 0 24px; padding: 0; }
.termine li { margin-top: 8px; }
.termin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--f, var(--f-default));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.termin__dot {
  flex: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--f, var(--f-default));
}
.termin__frak { font-weight: 600; }
.termin__date { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.frak--kehricht { --f: var(--f-kehricht); }
.frak--papier   { --f: var(--f-papier); }
.frak--karton   { --f: var(--f-karton); }
.frak--gruengut { --f: var(--f-gruengut); }
.frak--metall   { --f: var(--f-metall); }
.frak--glas     { --f: var(--f-glas); }

.section-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 10px;
}

.ics { margin: 0 0 24px; }
.ics .hint { margin: 8px 2px 0; font-size: .85rem; color: var(--muted); text-align: center; }

/* Footer / Ehrlichkeit */
footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
}
footer p { margin: 0; }

/* A11y: sichtbarer Fokus */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

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

/* Review-Queue */
.review { list-style: none; margin: 0; padding: 0; }
.review__item {
  padding: 16px;
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--banner-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.review__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.review__gemeinde { font-weight: 700; }
.review__date { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.review__befunde { margin: 0 0 14px; padding-left: 20px; color: var(--muted); }
.review__befunde li { margin-top: 2px; }
.review__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn--publish { background: var(--kehricht, #2f855a); }
.btn--ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.btn--ghost:hover { background: var(--surface); color: var(--ink, inherit); }

/* «Wohin mit X?» — Antwortkarte */
.answer {
  padding: 18px;
  margin: 4px 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.answer--empty { border-left-color: var(--banner-border); }
.answer__weg { font-weight: 700; font-size: 1.15rem; margin: 0 0 6px; }
.answer__hinweis { margin: 0; color: var(--muted); }
.answer__termin {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}
.answer__termin time { font-variant-numeric: tabular-nums; }
.answer__termin--none { font-weight: 400; color: var(--muted); }
.backlink { color: var(--primary); text-decoration: none; font-weight: 600; }
.backlink:hover { text-decoration: underline; }

/* Boxen auf der Gemeinde-Seite */
.wohin-box, .lead-box {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.wohin-box__lede, .lead-box__lede { color: var(--muted); margin: 0 0 12px; }

/* Lead-Formular — Schweizrot ist der Anfrage vorbehalten */
.lead-form { margin: 0; }
.lead-form .btn,
.lead-box .btn {
  background: var(--accent);
  color: var(--accent-ink);
}
.lead-form .btn:hover,
.lead-box .btn:hover { background: var(--accent-hover); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  font-size: 1rem;
  font-family: inherit;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.field textarea { resize: vertical; }
.field__hint { margin: 6px 2px 0; font-size: .85rem; color: var(--muted); }
.field__hint--dsg { margin-top: 12px; }
.field__error { margin: 6px 2px 0; font-size: .85rem; color: #c0392b; font-weight: 600; }
@media (prefers-color-scheme: dark) { .field__error { color: #ff8a7a; } }

/* Lead-Admin */
.lead-item--neu { border-left-color: var(--primary); }
.lead-beschreibung { margin: 0 0 10px; }
.lead-status {
  flex: none;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--surface-2);
  padding: 3px 9px;
  border-radius: 999px;
}
.lead-status--neu { color: var(--primary-ink); background: var(--primary); }

/* Statistik-Dashboard (/stats, Admin) */
.stats-table {
  width: 100%;
  margin: 0 0 28px;
  border-collapse: separate; /* collapse würde den border-radius schlucken */
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.stats-table th, .stats-table td {
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.stats-table th { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stats-table tr:last-child td { border-bottom: none; }
.stats-table .num { text-align: right; }

/* Ab Tablet: Suchknopf neben Feld bleibt, Container etwas luftiger */
@media (min-width: 560px) {
  .wrap { padding-top: 32px; }
  h1 { font-size: 2rem; }
}
