/* Grand Prairie Safety Action Plan — student survey
   Color palette pulled from the PDF: deep purple title, burgundy accent, teal labels, orange highlight. */
:root {
  --plum: #3a1c4f;
  --plum-dark: #2a0f3b;
  --burgundy: #8b1d3f;
  --teal: #2f8c9f;
  --orange: #e95a3a;
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #1f1b24;
  --muted: #6b6770;
  --border: #e3dfe6;
  --like: #2f8c9f;
  --avoid: #c4302b;
  --shadow: 0 2px 8px rgba(58, 28, 79, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  background: var(--plum);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  border-bottom: 4px solid var(--burgundy);
}
.brand { display: flex; flex-direction: column; }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: 0.5px; }
.brand-sub { font-size: 13px; opacity: 0.85; font-style: italic; }
.progress { flex: 1; min-width: 200px; max-width: 360px; margin-left: auto; }
.progress-bar { height: 8px; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--orange); transition: width 0.25s; width: 16%; }
.progress-label { font-size: 12px; opacity: 0.85; margin-top: 4px; text-align: right; }

/* Main */
main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.step { display: none; background: var(--card); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.step.active { display: block; }
h1, h2 { color: var(--plum); margin-top: 0; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
.lede { color: var(--muted); margin-bottom: 24px; }

/* Forms */
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--plum); }
select, textarea, input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}
select:focus, textarea:focus, input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 140, 159, 0.15);
}
textarea { resize: vertical; min-height: 120px; }
.char-count { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.grade-row { max-width: 220px; }

/* Actions */
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.05s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: var(--burgundy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--plum); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary { background: #efeaf3; color: var(--plum); }
.btn-secondary:hover { background: #e3dceb; }
.btn-primary:active, .btn-secondary:active { transform: translateY(1px); }

/* Checklist */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: #faf6fb;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.check-item:hover { background: #f3edf6; }
.check-item.checked { background: #efe2f0; border-color: var(--burgundy); }
.check-item input { margin: 4px 0 0 0; flex-shrink: 0; width: 20px; height: 20px; accent-color: var(--burgundy); }
.check-item .ci-title { font-weight: 600; color: var(--plum); font-size: 14px; }
.check-item .ci-body { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Travel modes */
.travel-modes {
  border: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.travel-modes label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: #faf6fb;
  font-size: 14px;
}
.travel-modes label:has(input:checked) { border-color: var(--burgundy); background: #efe2f0; }
.travel-modes input { accent-color: var(--burgundy); }

/* Map */
.map { height: 480px; width: 100%; border-radius: 10px; border: 1.5px solid var(--border); margin-top: 12px; }
@media (max-width: 600px) { .map { height: 360px; } }

.map-instructions { background: #fff7ed; border-left: 4px solid var(--orange); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 14px; margin: 12px 0; }
.map-instructions ol { margin: 6px 0 0; padding-left: 20px; }
.map-instructions li { margin-bottom: 4px; }

/* Place tools */
.place-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.place-tool {
  padding: 10px 14px;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.place-tool.active { border-color: var(--plum); background: var(--plum); color: #fff; }
.place-tool.place-like.active { border-color: var(--like); background: var(--like); }
.place-tool.place-avoid.active { border-color: var(--avoid); background: var(--avoid); }
.tool-icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; }
.tool-icon-like { background: var(--like); color: #fff; }
.tool-icon-avoid { background: var(--avoid); color: #fff; }

/* Place markers (custom Leaflet divIcons) */
.place-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #fff;
}
.place-marker-like { background: var(--like); }
.place-marker-avoid { background: var(--avoid); }
.place-marker-school { background: var(--orange); }
.place-marker-library { background: var(--plum); }

/* Summary */
.summary {
  background: #faf6fb;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  font-size: 14px;
}
.summary h3 { color: var(--plum); margin-top: 0; font-size: 16px; }
.summary dl { margin: 0; }
.summary dt { font-weight: 600; color: var(--plum); margin-top: 12px; }
.summary dd { margin: 4px 0 0; color: var(--ink); }
.summary .empty { color: var(--muted); font-style: italic; }

.submit-status { margin-top: 16px; font-size: 14px; }
.submit-status.error { color: var(--avoid); }
.submit-status.success { color: var(--like); }

/* Thank you */
.thanks { text-align: center; padding: 30px 10px; }
.thanks h1 { font-size: 36px; }

/* Footer */
.footbar { padding: 20px; text-align: center; font-size: 13px; color: var(--muted); }

/* Schools markers popup */
.leaflet-popup-content-wrapper { border-radius: 8px; }
.leaflet-popup-content { font-family: inherit; }
