/* === NEW for cleaner layout === */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.flex-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.county-district {
  flex: 1 1 48%;
  display: flex;
  flex-direction: column;
}

.flex-item {
  flex: 1 1 50%;
  min-width: 0;
}

/* Existing styles — keep these */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #D8E4DA;
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.container {
  background-color: white;
  width: 100%;
  max-width: 700px;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 0 30px;
}

.form-header h2 {
  margin: 0;
}

.header-right .logo {
  max-height: 60px;
  width: auto;
}

label {
  font-weight: bold;
}

.hint {
  font-size: 0.9em;
  font-style: italic;
  color: #555;
  margin-top: 2px;
  margin-bottom: 8px;
}

.hint-inline {
  font-weight: normal;
  font-style: italic;
  font-size: 0.9em;
  color: #555;
  margin-left: 8px;
}

.location-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.location-buttons button {
  flex: 1 1 30%;
  white-space: nowrap;
}

#reset-location-fallback {
  margin-top: 15px;
  background-color: red;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 5px;
}

input,
select,
textarea {
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 1rem;
  width: 100%;
}

#county-list li.highlighted {
  background-color: #cce5ff;
}

#map {
  height: 300px;
  width: 100%;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

#preview-container {
  margin-top: 10px;
  display: none;
}

#preview-image {
  max-width: 100%;
  max-height: 200px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-top: 10px;
}

.county-search {
  position: relative;
}

#county-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-top: none;
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  padding: 0;
  margin: 0;
  list-style: none;
}

#county-list li {
  padding: 8px 12px;
  cursor: pointer;
}

#county-list li:hover {
  background-color: #eee;
}

.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.latlon-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.latlon-group>div {
  flex: 1 1 45%;
}

button {
  background-color: #228B22;
  color: white;
  padding: 12px;
  font-size: 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

/* Spinner Styles */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #228B22;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

#error-message {
  color: red;
  font-size: 0.9em;
}

#summary {
  display: none;
  margin-top: 30px;
  background-color: #f0fdf0;
  padding: 20px;
  border-left: 5px solid #228B22;
}

@media (max-width: 450px) {
  .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 0 20px;
  }

  .container {
    padding: 20px;
  }

  button {
    width: 100%;
  }

  .radio-group {
    flex-direction: column;
  }

  .latlon-group {
    flex-direction: column;
  }

  .flex-row {
    flex-direction: column;
  }

    .fade-hint {
      display: block;
      font-size: 0.9em;
      color: #555;
      margin-top: 5px;
      opacity: 1;
      transition: opacity 1.5s ease-out;
    }

    .fade-hint.hidden {
      display: none;
      opacity: 0;
    }
}
