*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7f7f7;
  --bg-alt: #efefef;
  --surface: #ffffff;
  --header-bg: #1a1a2e;
  --accent: #c0392b;
  --accent-hover: #a93226;
  --text: #222222;
  --text-muted: #666666;
  --border: #ddd;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 560px; }

/* ── Header ── */
header {
  background: var(--header-bg);
  color: #fff;
  padding: 36px 0 32px;
}
header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.tagline {
  margin-top: 6px;
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
}

/* ── Sections ── */
.section { padding: 48px 0; }
.bg-alt { background: var(--bg-alt); }

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-title-row h2 { margin-bottom: 0; }

h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

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

.section-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.97rem;
}

/* ── Map ── */
#map {
  height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #e8e8e8;
}

.map-note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Camera grid ── */
.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.camera-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.camera-card .cam-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.cam-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 99px;
  margin-top: 6px;
}

.badge-speed       { background: #fde8e8; color: #c0392b; }
.badge-school_zone { background: #fff3cd; color: #856404; }
.badge-red_light   { background: #f8d7da; color: #842029; }

.cam-direction {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.loading-text { color: var(--text-muted); font-size: 0.95rem; }

/* ── Sign-up card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

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

input[type="tel"],
input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
input:focus { border-color: var(--accent); }

.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.input-row input { min-width: 0; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-top: 12px;
  text-decoration: underline;
}
.btn-link:hover { color: var(--text); }

.field-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field-error {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.verify-intro {
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Success card ── */
.success-card {
  text-align: center;
  border-color: #b7e4c7;
  background: #f0fdf4;
}
.success-card h3 {
  font-size: 1.2rem;
  margin: 12px 0 8px;
  color: #166534;
}
.success-card p { color: #4a7c5e; font-size: 0.92rem; }

.check-icon {
  width: 48px;
  height: 48px;
  color: #22c55e;
}

/* ── Info grid ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.info-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Footer ── */
footer {
  background: var(--header-bg);
  color: rgba(255,255,255,0.5);
  padding: 28px 0;
  font-size: 0.83rem;
  text-align: center;
  line-height: 1.8;
}
footer a { color: rgba(255,255,255,0.7); }

/* ── Leaflet popup tweaks ── */
.leaflet-popup-content { font-size: 0.88rem; line-height: 1.5; }
.popup-name { font-weight: 600; margin-bottom: 4px; }
.popup-type { color: var(--text-muted); font-size: 0.8rem; }

/* ── Legal pages ── */
.legal-page { padding: 48px 0 64px; }
.legal-page h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.legal-page .updated { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 36px; }
.legal-page h2 { font-size: 1.05rem; margin-top: 32px; margin-bottom: 8px; }
.legal-page p, .legal-page ul { font-size: 0.95rem; color: var(--text-muted); line-height: 1.75; margin-top: 8px; }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin-top: 4px; }
.legal-page a { color: var(--accent); }
.legal-back { display: inline-block; margin-bottom: 32px; font-size: 0.88rem; color: var(--text-muted); text-decoration: none; }
.legal-back:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 540px) {
  header h1 { font-size: 1.5rem; }
  #map { height: 300px; }
  .input-row { flex-direction: column; }
  .btn-primary { width: 100%; }
  .card { padding: 20px; }
}
