/* PanoClub */
:root {
  --cream: #f4efe3;
  --paper: #fffdf8;
  --navy: #1b3358;
  --red: #c9382c;
  --ink: #1d2433;
  --muted: #6b7280;
  --line: #e4dccb;
  --green: #2f7d4f;
  --amber: #b7791f;
  --radius: 16px;
  --serif: Rockwell, "Roboto Slab", "Zilla Slab", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
#view { flex: 1; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 16px; }

#top {
  position: sticky; top: 0; z-index: 5;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  text-align: center;
}
#top img { height: 34px; display: block; margin: 0 auto; }

#tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
#tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
#tabs a.on { color: var(--navy); background: #ece5d3; }
#tabs a[data-tab="photo"] { color: var(--red); }
#tabs a[data-tab="photo"].on { background: var(--red); color: #fff; }
[hidden] { display: none !important; }

/* Blocs */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .82rem; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px;
  border: 2px solid var(--navy); border-radius: 999px;
  background: var(--navy); color: #fff;
  font: 600 1rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn.red { background: var(--red); border-color: var(--red); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.sm { width: auto; padding: 8px 14px; font-size: .88rem; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; text-decoration: underline; cursor: pointer; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--navy); }
input[type=text], input[type=email] {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font: 1rem var(--sans);
}
input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.pill.ok { background: #e2f1e7; color: var(--green); }
.pill.wait { background: #f8ecd2; color: var(--amber); }
.pill.perso { background: #e6ebf3; color: var(--navy); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #e9e2d0; border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; padding: 9px 8px; border-radius: 999px; font: 600 .88rem var(--sans); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Accueil */
.hero { text-align: center; padding-top: 24px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.hero img { width: 100%; max-width: 380px; }
.hero h1 { font-size: 1.75rem; }
.steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step b { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-family: var(--serif); }

/* Panneau (photo de démo dessinée) */
.sign {
  display: inline-block; max-width: 100%;
  background: #fbf8f0; color: #151515;
  border: 4px solid var(--red); border-radius: 8px;
  outline: 2px solid #fbf8f0;
  padding: 4px 12px;
  font: 800 .95rem/1.2 "Arial Narrow", Arial, sans-serif; text-transform: uppercase; letter-spacing: .03em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot {
  position: relative; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; padding: 10px;
  background: linear-gradient(#bcd6ea 0 55%, #7f9a5d 55% 100%);
}
.shot.b { background: linear-gradient(#e6cfae 0 50%, #8a8f6a 50% 100%); }
.shot.c { background: linear-gradient(#c9d3dc 0 60%, #6f7f73 60% 100%); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .pill { position: absolute; left: 6px; bottom: 6px; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shots .sign { font-size: .62rem; border-width: 3px; padding: 2px 6px; }

/* Carte */
.map { background: #dfeaf2; border-radius: 12px; overflow: hidden; }
.map svg { display: block; width: 100%; height: auto; }
.map .dep { fill: #fbf8f0; stroke: #cfc6b2; stroke-width: 1; }
.map .trace { fill: none; stroke: var(--red); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2 9; }
.map .pt { fill: var(--navy); stroke: #fff; stroke-width: 3; }
.map .pt.wait { fill: var(--amber); }
.map .pt.perso { fill: #8b97ab; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; }
.stats b { display: block; font: 700 1.35rem var(--serif); color: var(--navy); }
.stats span { font-size: .75rem; color: var(--muted); }

.list { display: flex; flex-direction: column; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.list > *:first-child { border-top: 0; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #ece5d3; color: var(--navy); display: grid; place-items: center; font: 700 .8rem var(--sans); }
.me { background: #f1ead9; margin: 0 -16px; padding-left: 16px !important; padding-right: 16px !important; }
.emoji { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #ece5d3; display: grid; place-items: center; font-size: 1.4rem; }
.chev { color: var(--muted); font-size: 1.3rem; }

.bar { height: 8px; background: #ece5d3; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
.alpha { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.alpha span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; background: #ece5d3; color: var(--muted); font: 700 .85rem var(--serif); }
.alpha span.on { background: var(--navy); color: #fff; }

/* Capture */
.drop { border: 2px dashed #cfc6b2; border-radius: var(--radius); padding: 28px 16px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.checks li { list-style: none; display: flex; gap: 10px; align-items: flex-start; opacity: .35; transition: opacity .3s; }
.checks li.done { opacity: 1; }
.checks { margin: 0; padding: 0; }
.tick { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.tick.warn { background: var(--amber); }

.code { font: 700 1.4rem ui-monospace, Consolas, monospace; letter-spacing: .08em; color: var(--navy); background: #ece5d3; border-radius: 12px; padding: 12px; text-align: center; }
.charte li { margin-bottom: 8px; }
.charte ul { margin: 0; padding-left: 20px; }
.back { align-self: flex-start; }

#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 20;
  max-width: 420px; width: calc(100% - 32px);
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: .9rem; text-align: center;
}

/* Périple cliquable */
.mapwrap { position: relative; display: flex; flex-direction: column; gap: 10px; }
.mapwrap.big { position: fixed; inset: 0; z-index: 30; background: var(--cream); padding: 12px; }
.mapwrap.big .map { flex: 1; min-height: 0; }
.mapwrap.big .map svg { height: 100%; }
.zoom { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--navy); font-size: 1.15rem; cursor: pointer; }
.mapwrap.big .zoom { top: 20px; right: 20px; }
.map .hit { fill: transparent; }
.map .sel .pt { stroke: var(--red); stroke-width: 6; }
[data-sel] { cursor: pointer; }
.fiche { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.fiche .shot { width: 120px; flex: none; }
.who { position: absolute; right: 6px; bottom: 0; font-size: 1.5rem; line-height: 1.2; }
.apercu img { width: 70%; margin: 0 auto; display: block; }

/* Ville choisie : le nom se tronque, le département et « Changer » gardent leur place */
.row > .sign { flex: 0 1 auto; min-width: 0; }
.dept { flex: none; margin-right: auto; }

/* Partage, amis */
.carteimg { width: 100%; aspect-ratio: 4/5; border-radius: 12px; border: 1px solid var(--line); background: var(--cream); display: block; }
.emoji.off { filter: grayscale(1); opacity: .45; }
.score { font: 700 1.25rem var(--serif); color: var(--navy); }
#carte { position: fixed; inset: 0; z-index: 40; background: rgba(15, 20, 30, .92); display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; padding: 16px; }
#carte img { max-width: 100%; max-height: calc(100% - 140px); border-radius: 12px; }
#carte .btn { max-width: 340px; }
#carte .btn.ghost { color: #fff; border-color: #fff; }

/* Backoffice */
.admin #app { max-width: 960px; }
.admin #top { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--navy); font-family: var(--serif); }
.admin #top img { margin: 0; }
.admin #view { padding-bottom: 40px; }
.admin .entree { max-width: 440px; width: 100%; margin: 0 auto; }
.stats.quatre { grid-template-columns: repeat(4, 1fr); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.modere .shot { display: block; cursor: zoom-in; }
.modere .sign { vertical-align: middle; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger { color: var(--red); border-color: var(--red); }

/* Hors de France */
.switchrow { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.switch { flex: none; width: 52px; height: 30px; border-radius: 999px; border: 0; background: #cfc6b2; position: relative; cursor: pointer; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch.on { background: var(--green); }
.switch.on i { left: 25px; }
.seg.carte { align-self: center; min-width: 220px; }
.map.w * { vector-effect: non-scaling-stroke; }
.map.w .dep { stroke-width: .6; }
.map.w .dep.vu { fill: #f1d9b8; }
.map.w .trace { stroke-width: 2.5; stroke-dasharray: 1 6; }
.map.w .pt { stroke-width: 2; }
.map.w .sel .pt { stroke-width: 3; }

/* Formulaire photo, visionneuse */
select, input[type=date] { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 1rem var(--sans); }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sugg p { width: 100%; }
.sugg .chip { cursor: pointer; }
label.link { cursor: pointer; }
.note { background: #f8ecd2; color: #7a5210; border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.fiche [data-act=voir] { cursor: zoom-in; }
#lb { position: fixed; inset: 0; z-index: 40; background: rgba(15, 20, 30, .92); display: grid; place-items: center; padding: 12px; cursor: zoom-out; }
#lb img { max-width: 100%; max-height: 100%; border-radius: 8px; }
#lb button { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--paper); color: var(--navy); font-size: 1.1rem; cursor: pointer; }
