/* stach.work – shared styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

:root, [data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-panel: #0d0d0d;
  --bg-topbar: rgba(10,10,10,0.75);
  --bg-card: #111214;
  --fg: #fafafa;
  --muted: #888;
  --muted2: #999;
  --muted3: #444;
  --border: #1a1a1a;
  --border2: #222;
  --accent: #3b82f6;
  --accent-rgb: 59,130,246;
  --hover-bg: rgba(255,255,255,0.05);
  --hover-bg2: rgba(255,255,255,0.06);
  --logo-from: #fff;
  --logo-to: #999;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-panel: #ffffff;
  --bg-topbar: rgba(255,255,255,0.8);
  --bg-card: #ffffff;
  --fg: #0f1115;
  --muted: #6b7280;
  --muted2: #4b5563;
  --muted3: #9ca3af;
  --border: #e6e8eb;
  --border2: #e2e4e8;
  --accent: #2563eb;
  --accent-rgb: 37,99,235;
  --hover-bg: rgba(0,0,0,0.035);
  --hover-bg2: rgba(0,0,0,0.05);
  --logo-from: #0f1115;
  --logo-to: #6b7280;
  --shadow: 0 10px 30px rgba(20,20,30,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.2s ease, color 0.2s ease;
}

/* ---------- decorative background glows ---------- */
.bg-glow {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.07;
  pointer-events: none;
}
[data-theme="light"] .bg-glow { opacity: 0.10; }
.glow1 { top: -200px; right: -100px; background: #3b82f6; }
.glow2 { bottom: -200px; left: -100px; background: #8b5cf6; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--bg-topbar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.topbar-logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: linear-gradient(135deg, var(--logo-from) 0%, var(--logo-to) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-logo .dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }

.topnav { display: flex; gap: 0.25rem; list-style: none; }
.topnav a {
  display: inline-block;
  color: var(--muted2);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.topnav a:hover { color: var(--fg); background: var(--hover-bg2); }
.topnav a.active { color: var(--accent); background: rgba(var(--accent-rgb),0.1); }

.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: transparent;
  color: var(--muted2);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed;
  top: 64px; left: 0; bottom: 0;
  width: 220px;
  padding: 1.5rem 0.75rem;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  z-index: 9;
  overflow-y: auto;
}
.sidebar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted3);
  padding: 0 0.75rem;
  margin-bottom: 0.75rem;
}
.sidenav { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.sidenav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted2);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  transition: all 0.2s ease;
}
.sidenav a svg { flex-shrink: 0; opacity: 0.8; }
.sidenav a:hover { color: var(--fg); background: var(--hover-bg); }
.sidenav a:hover svg { opacity: 1; color: var(--accent); }
.sidenav a.active { color: var(--accent); background: rgba(var(--accent-rgb),0.1); }
.sidenav a.active svg { color: var(--accent); opacity: 1; }

/* duplicated top-nav links, only shown inside the sidebar on mobile
   (where the real .topnav is hidden and unreachable otherwise) */
.sidebar-mainnav {
  display: none;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border2);
}

/* ---------- main content ---------- */
.main { margin-left: 220px; padding-top: 64px; min-height: 100vh; display: flex; flex-direction: column; }
.page {
  flex: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem;
  position: relative;
  z-index: 1;
}
.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.page-subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* hero (home page) */
.hero {
  text-align: center;
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.logo {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--logo-from) 0%, var(--logo-to) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}
.links { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* pill link / button */
.link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border2);
  border-radius: 999px;
  transition: all 0.3s ease;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.link:hover { border-color: var(--accent); background: rgba(var(--accent-rgb),0.08); }

/* cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon { color: var(--accent); margin-bottom: 0.75rem; }
.card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.card p { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.card .status {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-top: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status.online { color: #22c55e; background: rgba(34,197,94,0.12); }
.status.offline { color: #a1a1aa; background: rgba(161,161,170,0.12); }

/* app-link card (services page) */
.app-card { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit; }
.app-card .card-icon { margin-bottom: 0; }

/* settings rows */
.settings-list { display: flex; flex-direction: column; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border2);
}
.settings-row:last-child { border-bottom: none; }
.settings-row h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.settings-row p { font-size: 0.85rem; color: var(--muted); }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border2);
  border-radius: 999px;
  transition: 0.2s;
}
.switch-track::before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::before { transform: translateX(20px); }

/* theme choice pills */
.theme-pills { display: flex; gap: 0.5rem; }
.theme-pill {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border2);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted2);
  cursor: pointer;
  background: transparent;
  font-family: inherit;
}
.theme-pill.active { color: var(--accent); border-color: var(--accent); background: rgba(var(--accent-rgb),0.08); }

/* auth mode switch (Nutzer / Admin) on login pages */
.auth-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted2);
  text-decoration: none;
  transition: all 0.2s ease;
}
.auth-tab.active { color: #fff; background: var(--accent); }
.auth-tab:not(.active):hover { color: var(--fg); background: var(--hover-bg); }

/* password field with show/hide toggle */
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 2.75rem; }
.password-toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: var(--muted3);
  cursor: pointer;
  padding: 0;
}
.password-toggle:hover { color: var(--fg); }
.password-toggle .eye-off { display: none; }
.password-toggle.is-visible .eye-on { display: none; }
.password-toggle.is-visible .eye-off { display: block; }

/* simple form */
.form-row { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-row label { font-size: 0.85rem; color: var(--muted2); }
.form-row input, .form-row textarea {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-row textarea { resize: vertical; min-height: 100px; }

/* news / faq list */
.entry { padding: 1.25rem 0; border-bottom: 1px solid var(--border2); }
.entry:last-child { border-bottom: none; }
.entry .date { font-size: 0.78rem; color: var(--muted3); text-transform: uppercase; letter-spacing: 0.05em; }
.entry h3 { font-size: 1rem; margin: 0.35rem 0 0.4rem; }
.entry p { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  color: var(--muted3);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .topnav { display: none; }
  .menu-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }

  /* Weichzeichner-Effekte sind auf Smartphones (v.a. iOS Safari) oft teuer
     fürs Scrollen und wackeln/ruckeln. Auf schmalen Bildschirmen daher aus. */
  .bg-glow { display: none; }
  .topbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg);
  }

  /* Start/Leistungen/Über uns/Kontakt sind sonst auf dem Handy nicht
     erreichbar, da .topnav ausgeblendet ist – deshalb hier zusätzlich
     im aufklappbaren Menü anzeigen. */
  .sidebar-mainnav { display: flex; flex-direction: column; gap: 0.15rem; }

}
