:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  color: #2f352d;
  background:
    radial-gradient(circle at top left, rgba(207, 155, 71, 0.18), transparent 30%),
    linear-gradient(180deg, #f6efe3 0%, #f1e8d8 100%);
  --text: #2f352d;
  --text-soft: #666c61;
  --surface: #fffaf2;
  --surface-soft: #f4ead8;
  --border: #dccfb8;
  --accent: #c8673c;
  --accent-hover: #ae5733;
  --accent-soft: #efdbc8;
  --focus: #c8673c;
  --success: #72816b;
  --error: #9a4326;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

.page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.card {
  width: 100%;
  max-width: 32rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(47, 53, 45, 0.05),
    0 12px 32px rgba(95, 83, 56, 0.08);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #372b24;
}

.lede {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  line-height: 1.5;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

input {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: #fffdf9;
  color: var(--text);
}

input::placeholder {
  color: #8d8377;
}

input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

button {
  width: 100%;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fffaf4;
  background: var(--accent);
  border: 0;
  border-radius: 0.6rem;
  cursor: pointer;
}

button:hover {
  background: var(--accent-hover);
}

.result {
  margin-top: 1.5rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--text-soft);
}

.demo-note {
  margin: 0.85rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.result:empty {
  margin-top: 0;
}

.result--loading,
.result--empty,
.result--error,
.result--success {
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
}

.result--loading,
.result--empty {
  background: var(--surface-soft);
}

.result--error {
  color: var(--error);
  background: #f2ddd3;
}

.result--success {
  background: #eef1ea;
}

.result__title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.areas {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.areas__item {
  display: grid;
  grid-template-columns: minmax(5.75rem, auto) minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid rgba(220, 207, 184, 0.9);
  border-radius: 0.75rem;
}

.areas__item--clickable {
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease,
    transform 120ms ease;
}

.areas__item--clickable:hover,
.areas__item--clickable:focus-visible {
  border-color: rgba(200, 103, 60, 0.65);
  box-shadow: 0 0 0 2px rgba(200, 103, 60, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.areas__item--active {
  border-color: rgba(200, 103, 60, 0.65);
  box-shadow: 0 0 0 2px rgba(200, 103, 60, 0.08);
}

.areas__item--selected {
  border-color: rgba(200, 103, 60, 0.8);
  box-shadow: 0 0 0 2px rgba(200, 103, 60, 0.16);
  background: rgba(255, 246, 238, 0.92);
}

.areas__item--general {
  background: rgba(114, 129, 107, 0.1);
  border-color: rgba(114, 129, 107, 0.22);
}

.areas__code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  background: var(--accent-soft);
  color: #6f3923;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.areas__item--general .areas__code {
  background: rgba(114, 129, 107, 0.2);
  color: #4f5d49;
}

.areas__address {
  color: var(--text);
}

.result__note {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--text-soft);
}

.brand-footer {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(220, 207, 184, 0.8);
}

.brand-footer__logo {
  display: block;
  width: min(100%, 14rem);
  height: auto;
}

.legal-note {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-soft);
  text-align: center;
}

#map {
  height: 320px;
  margin-top: 1rem;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

#map[hidden] {
  display: none;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #fffaf2;
}

.leaflet-control-zoom a {
  color: var(--text);
}

.env-banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  padding: 0.55rem 1rem;
  background: #5f7256;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

@media (min-width: 30rem) {
  .page {
    padding: 2rem;
  }

  .card {
    padding: 2rem;
  }
}

@media (min-width: 48rem) {
  .row {
    flex-direction: row;
  }

  input {
    flex: 1 1 auto;
  }

  button {
    flex: 0 0 auto;
    width: auto;
  }
}

@media (max-width: 29.99rem) {
  .areas__item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}
