*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f5f5f5;
}

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.header {
  text-align: center;
}

.header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 700;
}

.tagline {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

.search {
  background: #fff;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.autocomplete {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.input-row .autocomplete input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.input-row .autocomplete input:focus {
  outline: none;
  border-color: #0a6ebd;
  box-shadow: 0 0 0 2px rgba(10, 110, 189, 0.2);
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}

.autocomplete-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: #e8f4fc;
  color: #0a6ebd;
}

.input-row button {
  padding: 0.6rem 1.25rem;
  background: #0a6ebd;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.input-row button:hover {
  background: #084d8a;
}

.input-row button:disabled {
  background: #888;
  cursor: not-allowed;
}

.message {
  margin: 1rem 0 0;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.95rem;
  min-height: 2.5rem;
}

.message.empty {
  visibility: hidden;
}

.message.info {
  background: #e8f4fc;
  color: #0a6ebd;
  border: 1px solid #b3d9f5;
}

.message.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.message.warning {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.disclaimer {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: #666;
}

.map-section {
  flex: 1;
  min-height: 400px;
  position: relative;
  background: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.result-address {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #333;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.result-address-note {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #555;
  background: #f5f5f5;
  border-radius: 6px;
  border: 1px solid #eee;
}

.map {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.legend {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-item::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 2px;
}

.legend-utsatt::before {
  background: #f9a825;
  border: 1px solid #e65100;
}

.legend-sarskilt::before {
  background: #c62828;
  border: 1px solid #8e0000;
}

/* Remove focus outline when clicking vulnerable area polygons on the map */
#map .leaflet-interactive:focus {
  outline: none;
}
