:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #6d28d9;
  --primary-hover: #5b21b6;
  --accent: #f59e0b;
  --danger: #dc2626;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--text);
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(245, 158, 11, 0.25), transparent 70%),
    radial-gradient(800px 400px at -10% 10%, rgba(109, 40, 217, 0.45), transparent 70%),
    linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: white;
  padding: 0 0 56px;
}

.hero-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
}

.hero-content {
  max-width: 900px;
  margin: 24px auto 0;
  padding: 0 32px;
}

.hero-content h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0 0 12px;
  line-height: 1.15;
}

.hero-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
}

.container {
  max-width: 1100px;
  margin: -36px auto 48px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

@media (max-width: 860px) {
  .container { grid-template-columns: 1fr; }
}

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

.card h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.15);
}

.location-tools {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 10px;
}

.search-wrap {
  position: relative;
  flex: 1;
}

.search-wrap input {
  padding-left: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 18px;
}

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 1000;
}

.suggestions li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.suggestions li:hover,
.suggestions li.active {
  background: rgba(109, 40, 217, 0.08);
  color: var(--primary);
}

.map {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 0;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 8px 0 0;
}

.primary-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.primary-btn:hover { background: var(--primary-hover); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: 0.6; cursor: wait; }

.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.ghost-btn:hover { background: rgba(255, 255, 255, 0.16); }

.card .ghost-btn {
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}

.card .ghost-btn:hover { background: #f1f5f9; }

.msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
}

.msg.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.msg.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.info ol { padding-left: 20px; line-height: 1.7; color: var(--muted); }
.info li { margin-bottom: 6px; }

.footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Admin ---------- */
.admin-body {
  background: #f1f5f9;
  min-height: 100vh;
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1000px 500px at 70% -10%, rgba(109, 40, 217, 0.25), transparent 70%),
    radial-gradient(800px 500px at -10% 110%, rgba(245, 158, 11, 0.18), transparent 70%),
    #0f172a;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card .logo {
  margin-bottom: 12px;
  color: var(--primary);
}

.login-card h2 {
  margin: 0 0 16px;
}

.admin-header {
  background: white;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  position: sticky;
  top: 0;
  z-index: 500;
}

.admin-header .logo { color: var(--primary); }

.admin-stats {
  display: flex;
  gap: 28px;
  justify-content: center;
}

.stat {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat span {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--primary);
  line-height: 1.1;
}

.stat small {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-actions { display: flex; gap: 8px; }
.admin-actions .ghost-btn { background: white; border: 1px solid var(--border); color: var(--text); }
.admin-actions .ghost-btn:hover { background: #f1f5f9; }

.admin-main {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  padding: 20px 28px;
  max-width: 1500px;
  margin: 0 auto;
}

@media (max-width: 1000px) {
  .admin-main { grid-template-columns: 1fr; }
  .admin-header {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .admin-stats { flex-wrap: wrap; }
}

.admin-map-wrap {
  padding: 0;
  position: relative;
  overflow: hidden;
}

.admin-map {
  width: 100%;
  height: 70vh;
  min-height: 480px;
}

.legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: center;
  z-index: 400;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.dot-user { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.dot-center { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }

.list-card { padding: 20px; }
.list-card h2 { margin: 0 0 12px; }

.list-scroll { max-height: 70vh; overflow-y: auto; }

#regTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

#regTable th, #regTable td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

#regTable th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: #f8fafc;
  position: sticky;
  top: 0;
}

#regTable tbody tr:hover { background: #faf5ff; }

.del-btn {
  background: transparent;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.8rem;
}
.del-btn:hover { background: #fef2f2; }

/* ---------- Karten-Marker (modern, animiert) ---------- */
.user-marker {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
}

.user-marker .pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(109, 40, 217, 0.35);
  animation: pulseRing 2s ease-out infinite;
  pointer-events: none;
}

.user-marker .pin {
  position: relative;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid white;
  box-shadow: 0 6px 14px rgba(109, 40, 217, 0.45), 0 2px 4px rgba(0,0,0,0.2);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}

.user-marker .pin:hover { transform: rotate(-45deg) scale(1.12); }

.user-marker .pin span {
  transform: rotate(45deg);
  color: white;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes pulseRing {
  0%   { transform: scale(0.7); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

.center-marker {
  position: relative;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
}

.center-marker .glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.55) 0%, rgba(245,158,11,0) 70%);
  animation: centerPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.center-marker .star {
  position: relative;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.35), 0 8px 18px rgba(0,0,0,0.25);
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.15rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes centerPulse {
  0%, 100% { transform: scale(1);   opacity: 0.7; }
  50%      { transform: scale(1.35); opacity: 0.25; }
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.18);
}
.leaflet-popup-content {
  font-family: inherit;
  margin: 12px 16px;
  line-height: 1.5;
}
.leaflet-popup-content small { color: var(--muted); }
