@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #1B211D;
  --ink-soft: #4C554E;
  --paper: #F5F7F3;
  --card: #FFFFFF;
  --line: #DDE3DA;
  --forest: #1F6F5C;
  --forest-dark: #16503F;
  --amber: #E2A63B;
  --coral: #D8593C;
  --danger-bg: #FBEAE5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--line);
}

.topbar .brand {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--forest-dark);
}

.topbar .back {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
}

main { flex: 1; padding: 16px 20px; }

h1 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 21px;
  margin: 0 0 4px;
}

p.lead {
  color: var(--ink-soft);
  margin: 0 0 12px;
  max-width: 34ch;
  font-size: 13px;
}

.photo-box {
  border: 2px dashed var(--line);
  border-radius: 16px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  background: var(--paper);
  overflow: hidden;
  position: relative;
}

.photo-box img { width: 100%; height: 100%; object-fit: cover; }

.pill-location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #E7F1EE;
  color: var(--forest-dark);
  font-size: 13.5px;
}

.field { margin-top: 10px; }

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.field input, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font: inherit;
  font-size: 14px;
  background: var(--paper);
}

.privacy-note {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--paper);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}

.btn-primary { background: var(--forest); color: white; margin-top: 14px; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }

.link-center {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--forest-dark);
  cursor: pointer;
  text-decoration: underline;
}

.error-text { color: var(--coral); font-size: 12.5px; margin-top: 6px; display: none; }

/* Carte */
#map { height: 340px; background: #E9EDE7; position: relative; overflow: hidden; }
.legend { display: flex; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--ink-soft); }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* Barre de filtres par catégorie (carte du quartier) */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.filter-chip .chip-icon { font-size: 14px; line-height: 1; }
.filter-chip.active {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}
.filter-chip:active { transform: scale(0.96); }

.filter-note {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0;
  padding: 8px 16px 0;
}

.report-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.report-thumb-wrap { position: relative; width: 44px; height: 44px; flex: 0 0 auto; }
.report-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--paper); }
.cat-dot-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}
.report-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.confirm-btn { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 4px 8px; font-size: 12px; cursor: pointer; }

/* Code de signalement */
.code-box {
  text-align: center;
  padding: 26px 16px;
  border-radius: 14px;
  background: #E7F1EE;
  margin-top: 10px;
}
.code-value {
  font-family: 'Baloo 2', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--forest-dark);
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--danger-bg);
  color: var(--coral);
}

/* Contenu d'article de blog */
article h2 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  color: var(--forest-dark);
  margin: 26px 0 10px;
}
article h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 15.5px;
  color: var(--ink);
  margin: 20px 0 8px;
}
article p { margin: 0 0 14px; }

/* Sélecteur de catégorie (signalement) */
.cat-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 14px 0 8px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font: inherit;
  color: var(--ink-soft);
  position: relative;
}
.cat-btn .cat-icon { font-size: 20px; line-height: 1; }
.cat-btn .cat-text { font-size: 10.5px; font-weight: 600; text-align: center; }
.cat-btn.active {
  border-color: var(--forest);
  background: #E7F1EE;
  color: var(--forest-dark);
}
.cat-btn:active { transform: scale(0.97); }

.cat-more-wrap {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
}
.cat-more-wrap.open { max-height: 160px; }
.cat-more {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: var(--paper);
  border-radius: 12px;
}
.cat-more .cat-btn { background: var(--card); }
.cat-chevron { transition: transform 0.2s ease; display: inline-block; }
.cat-chevron.open { transform: rotate(180deg); }
