/* Aufkleber-Karte Großheubach — light & playful theme (shared by both pages) */

/* ---- self-hosted font (no Google) ---- */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("font/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("font/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("font/inter-700.woff2") format("woff2");
}

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --text: #16202c;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --accent: #ff5d8f;
  --afd: #009ee0;        /* AfD-Blau — bewusst für "das Beobachtete" (Watch + Marker) */
  --afd-dark: #007cb0;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 6px 24px rgba(31, 41, 79, .12);
  --shadow-sm: 0 2px 8px rgba(31, 41, 79, .08);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 15px; line-height: 1.5;
  display: flex; flex-direction: column; min-height: 100%;
}
a { color: var(--brand); }

/* ---- header ---- */
.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; row-gap: 8px;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
  position: relative; z-index: 600;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; white-space: nowrap; }
.brand .logo { font-size: 1.5rem; }
.brand .accent { color: var(--afd); }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; letter-spacing: 0; white-space: normal; }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: .85rem; margin-right: 4px; }
.who b { color: var(--text); }

/* ---- buttons ---- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; padding: 9px 15px; border-radius: 999px;
  background: var(--brand); color: #fff; transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: #f1f5f9; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { filter: brightness(.95); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 11px; font-size: .82rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.pill {
  font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: #fff7ed; color: var(--warn); border: 1px solid #fed7aa;
}
.pill.ok { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.pill.no { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

/* ---- map ---- */
#map { position: absolute; inset: 0; top: 0; }
.map-wrap { position: relative; flex: 1; }

/* Muted/pastel OSM tiles: desaturated so the map recedes behind the markers
   while keeping gentle colour. Tune `saturate` (lower = greyer). */
.leaflet-tile { filter: saturate(0.45) brightness(1.06) contrast(0.92); }

/* playful teardrop pin */
.pin {
  width: 30px; height: 30px; position: relative;
  background: var(--afd); border: 3px solid #fff;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: var(--shadow-sm);
}
.pin::after {
  content: ""; position: absolute; inset: 6px; margin: auto;
  width: 8px; height: 8px; background: #fff; border-radius: 50%;
  top: 5px; left: 5px;
}
.pin.has-photo { background: var(--afd-dark); }

/* Leaflet popup restyle */
.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 0; width: 230px !important; }
.pop { overflow: hidden; border-radius: var(--radius); }
.pop img { width: 100%; height: 130px; object-fit: cover; display: block; cursor: zoom-in; background: #eef2f6; }
.pop .body { padding: 11px 13px 13px; }
.pop h3 { margin: 0 0 4px; font-size: 1rem; }
.pop p { margin: 0 0 8px; color: #334155; font-size: .86rem; white-space: pre-wrap; word-break: break-word; }
.pop .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .76rem; }
.pop .meta .del { color: var(--danger); cursor: pointer; font-weight: 600; }

/* ---- timeline ---- */
.timeline {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px;
  z-index: 500; width: min(560px, calc(100% - 28px));
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px;
}
.timeline .row { display: flex; align-items: center; gap: 12px; }
.timeline label { font-weight: 600; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.timeline .date { font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline input[type=range] { flex: 1; accent-color: var(--brand); }
.timeline .count { font-size: .75rem; color: var(--muted); margin-top: 6px; text-align: center; }

/* ---- modal ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  width: min(420px, 100%); max-height: 90vh; overflow: auto; padding: 22px;
}
.modal h2 { margin: 0 0 4px; font-size: 1.25rem; }
.modal .sub { margin: 0 0 16px; color: var(--muted); font-size: .88rem; }
.field { margin-bottom: 13px; }
.field label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; background: #fbfdff;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 70px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.switch { margin-top: 14px; font-size: .85rem; color: var(--muted); text-align: center; }
.switch a { font-weight: 600; cursor: pointer; }

/* legal self-attestation */
.legal { background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; }
.legal .agree { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.legal .agree input { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; flex: none; }
.legal ul { margin: 8px 0 0; padding-left: 26px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.legal li { margin-bottom: 3px; }

/* photo dropzone */
.drop {
  border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 16px;
  text-align: center; color: var(--muted); cursor: pointer; font-size: .85rem;
}
.drop:hover { border-color: var(--brand); color: var(--brand); }
.drop img { max-width: 100%; max-height: 150px; border-radius: 8px; margin-top: 8px; }

/* ---- lightbox ---- */
.lightbox {
  position: fixed; inset: 0; background: rgba(10, 14, 22, .9);
  display: none; align-items: center; justify-content: center; z-index: 1100; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow); }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #16202c; color: #fff; padding: 11px 18px; border-radius: 999px;
  box-shadow: var(--shadow); font-size: .88rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #b91c1c; }
.toast.ok { background: #15803d; }

/* helper to show/hide by auth state */
[data-show] { display: none; }

/* hint shown while placing a marker */
.placing-hint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 500;
  background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 999px;
  box-shadow: var(--shadow); font-weight: 600; font-size: .85rem; display: none;
}
.placing .placing-hint { display: block; }
.placing #map { cursor: crosshair; }

/* ---- admin page ---- */
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }
.tabs { display: flex; gap: 8px; margin: 18px 0; }
.tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600;
}
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab .badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; text-align: center;
}
.panel { display: none; }
.panel.active { display: block; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: .88rem; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
td .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
td input, td textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
td textarea { min-height: 38px; resize: vertical; }
.thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: #eef2f6; }
.bulkbar { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.bulkbar .selall { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); cursor: pointer; }
.bulkbar input[type=checkbox], td input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }
.empty { color: var(--muted); font-size: .88rem; padding: 6px 2px; }
.noaccess { max-width: 420px; margin: 80px auto; text-align: center; }
