* {
  box-sizing: border-box;
}

:root {
  --forest-900: #1f3a2b;
  --forest-700: #2f5a42;
  --forest-100: #e9f3ec;
  --bark-700: #6e4a2e;
  --bark-100: #f4ede6;
  --snow-50: #f8faf8;
  --snow-100: #ffffff;
  --text-900: #1d2220;
  --text-700: #48514d;
  --line-200: #d8dfd9;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, var(--forest-100) 0%, var(--snow-50) 45%);
  color: var(--text-900);
  line-height: 1.4;
}

.container {
  max-width: 840px;
  margin: 0 auto;
  padding: 0.8rem;
}

.page-header {
  background: linear-gradient(120deg, var(--forest-900) 0%, var(--forest-700) 55%, var(--bark-700) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.page-header p {
  margin: 0.35rem 0 0;
  color: #edf4ef;
}

.stepper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.step-pill {
  background: #fff;
  border: 1px solid var(--line-200);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-700);
  text-align: center;
}

.step-pill.is-active {
  background: var(--forest-700);
  border-color: var(--forest-700);
  color: #fff;
}

.card {
  background: var(--snow-100);
  border: 1px solid var(--line-200);
  border-radius: 12px;
  padding: 0.95rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 0 rgba(20, 30, 24, 0.04);
}

.form-step {
  display: none;
}

.form-step.is-active {
  display: block;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  font-size: 1.32rem;
  margin-bottom: 0;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
  color: var(--forest-900);
}

h3 {
  font-size: 0.98rem;
  margin-bottom: 0.45rem;
  color: var(--bark-700);
}

form label,
fieldset label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

input,
select,
textarea,
button {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.78rem;
  border: 1px solid #bec9c0;
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid #9fc8ac;
  outline-offset: 1px;
  border-color: var(--forest-700);
}

fieldset {
  border: 1px solid #d2ddd3;
  background: #fcfefd;
  border-radius: 10px;
  margin: 0.8rem 0;
  padding: 0.65rem;
}

fieldset legend {
  color: var(--bark-700);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  padding: 0.56rem 0.62rem;
  border: 1px solid #e1e8e2;
  border-radius: 8px;
  background: #ffffff;
}

fieldset label input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
}

button {
  background: var(--forest-700);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.secondary {
  background: var(--bark-100);
  color: var(--bark-700);
  border: 1px solid #d7c6b8;
}

button[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

#map {
  width: 100%;
  height: 240px;
  border-radius: 8px;
  border: 1px solid #bdcabc;
}

.muted {
  color: var(--text-700);
}

.submit-bar {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.55rem;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(248, 250, 248, 0.75) 0%, rgba(248, 250, 248, 1) 34%);
  padding: 0.65rem 0 calc(0.65rem + env(safe-area-inset-bottom));
  margin-top: 0.45rem;
}

#submitBtn {
  min-height: 3rem;
  font-size: 1.05rem;
}

#status {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
}

.step-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

footer {
  text-align: center;
  margin: 1rem 0;
}

footer a {
  color: var(--forest-700);
}

@media (min-width: 700px) {
  .container {
    padding: 1rem 1rem 1.25rem;
  }

  .stepper {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .step-pill {
    font-size: 0.84rem;
  }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  #map {
    height: 300px;
  }

  fieldset {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  fieldset legend {
    grid-column: 1 / -1;
  }
}

/* Admin dashboard */
.admin-hint {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.admin-event-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-200);
  border-radius: 10px;
  background: #fff;
}

.admin-event-row.is-selected {
  border-color: var(--forest-700);
  box-shadow: 0 0 0 1px var(--forest-700);
}

.admin-event-summary {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
}

.admin-event-summary strong {
  display: block;
  color: var(--forest-900);
}

.admin-event-meta {
  color: var(--text-700);
  font-size: 0.82rem;
}

.admin-detail-card {
  margin-top: 1rem;
}

.admin-detail-card h3 {
  margin-top: 0;
  color: var(--forest-900);
}

.admin-detail-dl {
  margin: 0;
}

.admin-detail-dl dt {
  font-weight: 600;
  color: var(--bark-700);
  margin-top: 0.65rem;
  font-size: 0.85rem;
}

.admin-detail-dl dt:first-child {
  margin-top: 0;
}

.admin-detail-dl dd {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.admin-photo-item {
  border: 1px solid var(--line-200);
  border-radius: 8px;
  overflow: hidden;
  background: #f5f7f5;
}

.admin-photo-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.admin-photo-caption {
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
  color: var(--text-700);
}

.admin-photo-error {
  padding: 0.5rem;
  font-size: 0.78rem;
  color: #8b2942;
}

.admin-detail-actions {
  margin-top: 0.75rem;
}

.admin-detail-actions a {
  color: var(--forest-700);
  font-weight: 600;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.admin-toolbar .secondary {
  width: auto;
  padding: 0.55rem 0.85rem;
}

.admin-sheet-link {
  color: var(--forest-700);
  font-weight: 600;
  font-size: 0.92rem;
}
