:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c232c;
  --border: #2a323d;
  --text: #e6edf3;
  --muted: #8b97a6;
  --accent: #4ade80;
  --accent-2: #38bdf8;
  --warn: #fbbf24;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* Muss vor allen display-Regeln greifen: sonst gewinnt z. B. .btn{display:inline-block}
   gegen das hidden-Attribut und Elemente bleiben sichtbar. */
[hidden] { display: none !important; }

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

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
  background: rgba(14, 17, 22, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .3px; }
.brand span { color: var(--accent); }

nav.top { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
nav.top a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
}
nav.top a:hover, nav.top a.active {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
  text-decoration: none;
}

main { max-width: 1060px; margin: 0 auto; padding: 32px 24px 80px; }

.hero { padding: 28px 0 12px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 10px; }
.hero p { color: var(--muted); max-width: 62ch; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: .95rem; }

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #06210f;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

section + section { margin-top: 44px; }
h2 { font-size: 1.35rem; margin: 0 0 14px; }
h2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: middle; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 52px;
  border-left: 2px solid var(--border);
  margin-left: 16px;
}
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -17px;
  top: -4px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: .9rem;
  color: var(--accent);
}
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0 0 8px; color: var(--muted); }

code, pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88rem;
}
code { background: var(--panel-2); padding: 2px 6px; border-radius: 5px; }
pre {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}

.notice {
  border-left: 3px solid var(--warn);
  background: rgba(251, 191, 36, .07);
  padding: 12px 16px;
  border-radius: 8px;
  color: #e8d6a8;
  font-size: .93rem;
}

.map-frame {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .85rem;
  padding: 20px 24px;
  text-align: center;
}

.badge {
  display: inline-block;
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.ok { color: var(--accent); border-color: rgba(74, 222, 128, .4); }
.badge.off { color: #f87171; border-color: rgba(248, 113, 113, .4); }

/* ---------- Toasts: kurze Meldungen unten mittig ---------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 200;
  width: min(430px, 92vw);
  pointer-events: none;
}
.toast {
  position: relative;
  width: 100%;
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
  padding: 12px 38px 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  font-size: .92rem;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .18s, transform .18s;
}
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateY(10px); }
.toast.ok { border-left-color: var(--accent); }
.toast.err { border-left-color: #f87171; }
.toast-x {
  position: absolute;
  top: 5px;
  right: 7px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 2px 5px;
  cursor: pointer;
}
.toast-x:hover { color: var(--text); }
.toast-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Anmeldefenster unter dem Admin-Button ---------- */
.admin-anchor { position: relative; display: inline-block; }
.admin-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 250px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  z-index: 60;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  white-space: normal;
}
.admin-pop.hidden { display: none; }
.admin-pop label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.admin-pop input {
  width: 100%;
  box-sizing: border-box;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: .9rem;
}
.admin-pop .err { color: #f87171; font-size: .82rem; min-height: 1.1em; margin: 6px 0 0; }
.admin-pop .btn { width: 100%; margin-top: 10px; padding: 8px; font-size: .92rem; }
.admin-pop .arrow {
  position: absolute;
  top: -6px;
  right: 18px;
  width: 11px;
  height: 11px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

/* Fokus statt hartem Browser-Rahmen */
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .12);
}
