/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a2e;
  background: #f8f9fa;
  -webkit-font-smoothing: antialiased;
}

/* === Utilities === */
.hidden { display: none !important; }

/* === Navigation === */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #16a34a;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-nav .logo:hover { color: #15803d; }
.site-nav .nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.site-nav .nav-links a {
  font-size: 0.875rem;
  color: #4b5563;
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.site-nav .nav-links a:hover {
  color: #1a1a2e;
  background: rgba(0,0,0,0.04);
}
.site-nav .nav-links a.cta {
  background: #16a34a;
  color: white;
  font-weight: 500;
}
.site-nav .nav-links a.cta:hover {
  background: #15803d;
}

/* === Map Page === */
.map-container {
  position: fixed;
  top: 56px; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: calc(100vh - 56px);
}
#map { width: 100%; height: 100%; }

/* Filter panel */
#filter-panel {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  padding: 1rem 1.25rem;
  min-width: 180px;
  z-index: 10;
}
#filter-panel h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
#filter-panel label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  color: #4b5563;
  cursor: pointer;
  transition: color 0.15s;
}
#filter-panel label:hover { color: #1a1a2e; }
#filter-panel input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: #16a34a;
  cursor: pointer;
}

/* Map popup */
.maplibregl-popup-content {
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  min-width: 220px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: none;
}
.maplibregl-popup-content h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
}
.maplibregl-popup-content .category {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.maplibregl-popup-content .category[data-cat="Restaurant"] { background: #fee2e2; color: #991b1b; }
.maplibregl-popup-content .category[data-cat="Bar"] { background: #ede9fe; color: #5b21b6; }
.maplibregl-popup-content .category[data-cat="Café"] { background: #fef3c7; color: #92400e; }
.maplibregl-popup-content .category[data-cat="Beisl/Gasthaus"] { background: #fce7f3; color: #9d174d; }
.maplibregl-popup-content .category[data-cat="Kulturort"] { background: #dbeafe; color: #1e40af; }
.maplibregl-popup-content .category[data-cat="Sonstiges"] { background: #f3f4f6; color: #374151; }
.maplibregl-popup-content .address {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
}
.maplibregl-popup-content .note {
  margin-top: 6px;
  font-style: italic;
  color: #4b5563;
  border-top: 1px solid #f3f4f6;
  padding-top: 6px;
}

/* === Form Page === */
.form-page {
  min-height: 100vh;
  padding-top: 56px;
  background: linear-gradient(180deg, #f0fdf4 0%, #f8f9fa 100%);
}
.form-container {
  max-width: 520px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.form-header {
  text-align: center;
  margin-bottom: 2rem;
}
.form-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.form-header p {
  font-size: 0.9375rem;
  color: #6b7280;
  line-height: 1.5;
}

/* Form card */
.form-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 24px rgba(0,0,0,0.04);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

/* Form fields */
.form-field {
  margin-bottom: 1.25rem;
}
.form-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}
.form-field input[type="text"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.6rem 0.875rem;
  font-size: 0.9375rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  color: #1a1a2e;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-field input[type="text"]:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
.form-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2rem;
}
.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* OSM autocomplete */
#osm-results {
  position: absolute;
  left: 0; right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  margin-top: 4px;
}
.osm-result {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.875rem;
  color: #374151;
  transition: background 0.1s;
  line-height: 1.4;
}
.osm-result:last-child { border-bottom: none; }
.osm-result:hover { background: #f0fdf4; }
.osm-result .osm-type {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #e5e7eb;
  color: #374151;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
}
.osm-result .osm-address {
  margin-top: 3px;
  padding-left: 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.35;
}

/* Selected place */
#selected-place {
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
#selected-place p {
  margin: 0;
}
#selected-place #selected-name {
  font-weight: 600;
  color: #15803d;
  font-size: 0.9375rem;
}
#selected-place #selected-address {
  font-size: 0.8125rem;
  color: #16a34a;
  margin-top: 2px;
}
#clear-selection {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
}
#clear-selection:hover { color: #991b1b; text-decoration: underline; }

/* Checkbox confirmation */
.form-confirm {
  margin-bottom: 1.5rem;
}
.form-confirm label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #4b5563;
  line-height: 1.5;
}
.form-confirm input[type="checkbox"] {
  margin-top: 2px;
  width: 16px; height: 16px;
  accent-color: #16a34a;
  flex-shrink: 0;
}

/* Submit button */
.btn-submit {
  width: 100%;
  background: #16a34a;
  color: white;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-submit:hover { background: #15803d; }
.btn-submit:active { transform: scale(0.98); }

/* Success state */
.success-card {
  text-align: center;
  padding: 3rem 1.5rem;
}
.success-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #16a34a;
  margin-bottom: 0.75rem;
}
.success-card p {
  color: #6b7280;
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}
.success-card a {
  display: inline-block;
  color: #16a34a;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.success-card a:hover { color: #15803d; }

/* Disclaimer */
.form-disclaimer {
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.5;
}

/* === Map intro overlay === */
.map-intro {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  max-width: 400px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  z-index: 10;
  pointer-events: none;
}
.map-intro h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 0.25rem;
}
.map-intro p {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.4;
}
.map-intro a {
  pointer-events: auto;
  color: #16a34a;
  font-weight: 500;
  text-decoration: none;
}
.map-intro a:hover { text-decoration: underline; }

/* === Responsive === */
@media (max-width: 640px) {
  .site-nav {
    padding: 0 1rem;
    height: 48px;
  }
  .site-nav .logo { font-size: 1.1rem; }
  .site-nav .nav-links a { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
  .map-container { top: 48px; height: calc(100vh - 48px); }
  #filter-panel {
    top: 0.75rem; left: 0.75rem;
    min-width: 160px;
    padding: 0.75rem 1rem;
  }
  .map-intro { display: none; }
  .form-container { padding: 1.5rem 1rem; }
  .form-header h1 { font-size: 1.5rem; }
  .form-card { padding: 1.25rem; }
}
