* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --fresh-ink: #17251c;
  --fresh-muted: #657168;
  --fresh-line: #dce5dc;
  --fresh-paper: #ffffff;
  --fresh-bg: #f3f7f1;
  --fresh-green: #246b3c;
  --fresh-lime: #d8f36a;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--fresh-ink);
  background:
    radial-gradient(ellipse at top right, #e5f2d9 0, transparent 42%),
    var(--fresh-bg);
}

.location-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(12px, 4vw, 40px);
}

.location-card {
  width: 100%;
  max-width: 650px;
  padding: clamp(18px, 5vw, 36px);
  background: var(--fresh-paper);
  border: 1px solid rgba(31, 64, 39, .08);
  border-radius: 26px;
  box-shadow: 0 18px 55px rgba(26, 53, 31, .09);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.3px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  color: var(--fresh-lime);
  background: var(--fresh-ink);
  font-size: 21px;
}

.intro {
  margin: 30px 0 25px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--fresh-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(29px, 7vw, 42px);
  line-height: 1.08;
  letter-spacing: -1.3px;
}

.intro p:last-child {
  margin: 14px 0 0;
  max-width: 490px;
  color: var(--fresh-muted);
  font-size: 15px;
  line-height: 1.65;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea,
button {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--fresh-line);
  padding: 12px 14px;
  color: var(--fresh-ink);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(75, 143, 81, .24);
  outline-offset: 2px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button {
  margin-top: 12px;
  padding: 13px 16px;
  border: 0;
  background: var(--fresh-ink);
  color: var(--fresh-lime);
  font-weight: 800;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease;
}

button:active:not(:disabled) {
  transform: scale(.99);
}

button:disabled {
  opacity: .58;
  cursor: wait;
}

button.secondary-button {
  margin-top: 8px;
  color: #fff;
  background: var(--fresh-green);
}

.gps-panel,
.evidence-panel {
  margin: 14px 0 6px;
  padding: clamp(15px, 4vw, 21px);
  border: 1px solid var(--fresh-line);
  border-radius: 18px;
  background: #fbfdf9;
}

.gps-panel h2,
.evidence-panel h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.25px;
}

.gps-panel p,
.evidence-panel p {
  margin: 10px 0;
  color: var(--fresh-muted);
  font-size: 14px;
  line-height: 1.6;
}

#gps-status {
  overflow-wrap: anywhere;
  padding: 11px 12px;
  border-radius: 10px;
  background: #f0f4ed;
  color: #435247;
}

#gps-status.gps-valid {
  color: #176b32;
  background: #e8f6e9;
}

#gps-status.gps-invalid {
  color: #9a2929;
  background: #fff0ee;
}

.evidence-panel input[type="file"] {
  min-height: auto;
  padding: 12px;
  font-size: 13px;
}

#map {
  width: 100%;
  height: 300px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--fresh-line);
  border-radius: 16px;
}

.leaflet-container {
  font-family: inherit;
}

.coordinates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#saved-address-fields {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

#saved-address-fields[hidden] {
  display: none;
}

.default-address-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.default-address-option input {
  width: 19px;
  min-height: 19px;
}

.result {
  margin-top: 20px;
  padding: 15px 16px;
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.result.success {
  color: #176b32;
  background: #e8f6e9;
}

.result.warning {
  color: #77520b;
  background: #fff6d9;
}

.result.error {
  color: #9a2929;
  background: #fff0ee;
}

small {
  color: var(--fresh-muted);
  line-height: 1.5;
}

@media (max-width: 560px) {
  .location-page {
    padding: 10px;
  }

  .location-card {
    padding: 20px 16px;
    border-radius: 21px;
  }

  .intro {
    margin-top: 26px;
  }

  .coordinates {
    grid-template-columns: 1fr;
  }

  #map {
    height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}


/* Live GPS accuracy window */
.gps-live-panel {
  margin: 14px 0;
  padding: 15px;
  border: 1px solid var(--fresh-line);
  border-radius: 14px;
  background: #fff;
}
.gps-live-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}
.gps-reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.gps-reading {
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f0f4ed;
}
.gps-reading span {
  display: block;
  margin-bottom: 6px;
  color: var(--fresh-muted);
  font-size: 12px;
}
.gps-reading strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 21px;
  color: #26352b;
}
.gps-meter-track {
  height: 10px;
  margin: 14px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e9e2;
}
.gps-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #d58a24;
  transition: width .25s ease, background .25s ease;
}
.gps-meter-fill.gps-meter-good {
  background: #168342;
}
#gps-accuracy-guidance {
  margin: 8px 0 12px;
}
#use-best-gps {
  width: 100%;
}
#use-best-gps:disabled {
  opacity: .55;
  cursor: not-allowed;
}
@media (max-width: 360px) {
  .gps-reading strong { font-size: 18px; }
  .gps-reading-grid { gap: 7px; }
}
