/* KSC Ordnungsdienst – öffentlicher & Mitglieder-Bereich */

:root {
  --blue-900: #05204a;
  --blue-800: #0a2f66;
  --blue-700: #123a7a;
  --blue-600: #1d56b0;
  --blue-500: #2e6fdb;
  --blue-400: #5b93ea;
  --blue-100: #e8f0fd;
  --white: #ffffff;

  --bg: #f4f7fc;
  --surface: #ffffff;
  --text: #10192b;
  --muted: #55617a;
  --border: #dde4f0;
  --header-bg: var(--blue-900);
  --header-text: #ffffff;
  --shadow: 0 10px 30px rgba(10, 47, 102, 0.08);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0a1526;
  --surface: #101d33;
  --text: #eaf0fb;
  --muted: #93a3c2;
  --border: #1e2d4a;
  --header-bg: #071227;
  --header-text: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--header-text);
  font-weight: 700;
  font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }
.brand .brand-accent { color: var(--blue-400); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: #fff; }

.nav-cta { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: #fff; display: block; }

.theme-toggle {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .icon-sun { display: inline; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: inline; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue-500); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-outline { border-color: rgba(255,255,255,0.4); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-block { width: 100%; justify-content: center; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--blue-900), var(--blue-700));
  color: #fff;
  padding: 90px 0 70px;
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue-400);
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 14px 0;
  max-width: 720px;
}
.hero p {
  color: rgba(255,255,255,0.85);
  max-width: 640px;
  font-size: 1.05rem;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue-500);
}

.section { padding: 64px 0; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 8px 0 16px; }
.section-intro { max-width: 640px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.list-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list-check li { display: flex; gap: 10px; align-items: flex-start; }
.list-check li::before { content: "✔"; color: var(--blue-500); font-weight: 700; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 0.9rem; }
input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(46, 111, 219, 0.15);
}

.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 16px; }
.alert-error { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5b5b5; }
.alert-success { background: #e6f7ee; color: #14663c; border: 1px solid #a9e3c4; }
[data-theme="dark"] .alert-error { background: #3a1414; color: #ff9b9b; border-color: #5c1f1f; }
[data-theme="dark"] .alert-success { background: #10331f; color: #86e0b3; border-color: #1c5c3a; }

/* Login */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--blue-900), var(--blue-700));
  padding: 24px;
  position: relative;
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-card .brand { color: var(--text); }
.login-card .brand-accent { color: var(--blue-500); }

/* Footer */
.site-footer {
  background: var(--blue-900);
  color: rgba(255,255,255,0.75);
  padding: 50px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.footer-grid h4 { color: #fff; margin-bottom: 10px; font-size: 0.95rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-grid a { color: rgba(255,255,255,0.75); }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; margin-bottom: 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

/* Notice box (Markenrechte Hinweis etc.) */
.notice {
  border: 1px dashed #d9a441;
  background: #fff8e6;
  color: #6b4a05;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
}
[data-theme="dark"] .notice { background: #2e2408; color: #f0cf7c; border-color: #7a5c15; }

/* Member area */
.member-shell { display: flex; min-height: calc(100vh - 60px); }
.member-nav {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.member-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}
.member-nav a:hover, .member-nav a.active {
  background: var(--blue-100);
  color: var(--blue-700);
  text-decoration: none;
}
[data-theme="dark"] .member-nav a:hover, [data-theme="dark"] .member-nav a.active {
  background: rgba(46,111,219,0.18); color: var(--blue-400);
}
.member-nav .nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 18px 0 8px 14px;
}
.member-main { flex: 1; padding: 32px; max-width: 1000px; }

.kategorie-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.kategorie-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: block;
  color: var(--text);
}
.kategorie-card:hover { text-decoration: none; border-color: var(--blue-400); box-shadow: var(--shadow); }
.kategorie-card .icon { font-size: 2rem; margin-bottom: 10px; }

.entry-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.entry-list a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
}
.entry-list a:hover { text-decoration: none; border-color: var(--blue-400); }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.image-grid img { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* Positionsfinder */
.pf-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.pf-search { flex: 1; min-width: 220px; }
.pf-ebenen { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-ebenen button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.pf-ebenen button.active { background: var(--blue-500); color: #fff; border-color: var(--blue-500); }
.pf-bereiche { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pf-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}
.pf-chip.active { background: var(--blue-100); color: var(--blue-700); border-color: var(--blue-400); }
[data-theme="dark"] .pf-chip.active { background: rgba(46,111,219,0.2); color: var(--blue-400); }

.pf-map-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pf-map-wrap img { display: block; width: 100%; height: auto; }
.pf-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -26px;
  background: var(--blue-500);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.pf-marker.highlight { background: #e0762a; z-index: 5; }
.pf-marker-label {
  position: absolute;
  background: var(--text);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
  transform: translate(-50%, -140%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.pf-marker:hover + .pf-marker-label,
.pf-marker.highlight + .pf-marker-label { opacity: 1; }
.pf-empty-map {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--blue-100);
  color: var(--blue-700);
}
[data-theme="dark"] .badge { background: rgba(46,111,219,0.2); color: var(--blue-400); }
.badge-admin { background: #fde8e8; color: #9b1c1c; }
[data-theme="dark"] .badge-admin { background: #3a1414; color: #ff9b9b; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .member-shell { flex-direction: column; }
  .member-nav { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; gap: 4px; }
  .member-nav .nav-section-title { display: none; }
  .member-nav a { white-space: nowrap; }
}

@media (max-width: 780px) {
  .nav-links { position: fixed; top: 62px; left: 0; right: 0; background: var(--header-bg); flex-direction: column; padding: 16px 20px; display: none; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
}
