/* ===== Identité : "carnet de repérage" — on collectionne les
   apparitions d'une tête placardée dans toute la métropole.
   Accent signature : rose vif (monde de la mode / pub).
   Les épingles montrent la vraie photo → la carte devient une
   collection de visages semés dans Lille.                         ===== */

:root {
  --ink: #16181d;
  --ink-soft: #2a2d36;
  --paper: #ffffff;
  --accent: #ff2e7e;   /* rose signature */
  --accent-2: #ffc400; /* jaune "repéré" */
  --text: #16181d;
  --muted: #6b7280;
  --line: #e6e7ea;
  --shadow: 0 8px 30px rgba(16, 18, 24, 0.18);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

/* ---------- En-tête ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-top));
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(22,24,29,0.96), rgba(22,24,29,0.82) 70%, transparent);
  color: #fff;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.brand__mark {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text strong {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand__text small { font-size: 11px; color: #b9bcc4; margin-top: 2px; }

.count {
  pointer-events: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 15px;
}

/* ---------- Carte ---------- */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: #dfe3e8;
}

/* Épingle-photo : miniature ronde cerclée de rose = la signature */
.photo-pin { background: none; border: none; }
.photo-pin__img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.photo-pin__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-pin__tip {
  width: 0; height: 0; margin: -2px auto 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--accent);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.2));
}

/* Épingle provisoire (pendant le placement) */
.drop-pin { background: none; border: none; }
.drop-pin__dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-2);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  animation: pulse 1.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,196,0,.55); }
  100% { box-shadow: 0 0 0 16px rgba(255,196,0,0); }
}

/* Popup */
.leaflet-popup-content-wrap { border-radius: 14px; }
.leaflet-popup-content { margin: 10px 12px; }
.pop img { width: 220px; max-width: 62vw; border-radius: 10px; display: block; }
.pop__cap { font-size: 14px; margin: 8px 0 2px; }
.pop__by { font-size: 12px; color: var(--muted); }

/* ---------- Bandeau d'aide ---------- */
.hint {
  position: fixed;
  left: 50%; top: 74px;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink);
  color: #fff;
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 10px;
  max-width: calc(100vw - 24px);
}
.hint__cancel {
  border: none; background: rgba(255,255,255,.14); color: #fff;
  padding: 6px 12px; border-radius: 999px; font: inherit; cursor: pointer;
}

/* ---------- Bouton d'action ---------- */
.fab {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.fab:active { transform: translateX(-50%) scale(0.97); }
.fab__plus { font-size: 20px; line-height: 1; margin-top: -2px; }

/* ---------- Feuille du bas ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(16,18,24,.45);
}
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1600;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.sheet__grip {
  width: 42px; height: 5px; border-radius: 999px;
  background: var(--line); margin: 0 auto 12px;
}
.sheet__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px; margin: 0 0 16px;
}

.field { display: block; margin-bottom: 14px; }
.field__label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px;
}
.field input[type="text"],
.field input[type="file"] {
  width: 100%; font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafb;
}
.field input[type="text"]:focus,
.field input[type="file"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.preview {
  width: 100%; max-height: 240px; object-fit: cover;
  border-radius: 12px; margin-bottom: 14px;
}

.loc {
  font-size: 13px; color: var(--muted);
  background: #fafafb; border: 1px dashed var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 4px 0 14px;
}
.loc.loc--missing { color: var(--accent); border-color: var(--accent); }

.msg { font-size: 14px; margin: 0 0 12px; }
.msg--err { color: var(--accent); }
.msg--ok { color: #1a7f4b; }

.sheet__actions { display: flex; gap: 10px; }
.btn {
  flex: 1; padding: 14px; border-radius: 12px;
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 15px;
  cursor: pointer; border: none;
}
.btn--ghost { background: #f0f1f3; color: var(--ink); }
.btn--primary { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .drop-pin__dot { animation: none; }
}
