/*
 * Spots — feuille de style
 *
 * Deux ambiances tirées de la lumière que cherchent les photographes :
 *   sombre = « heure bleue » (fond indigo), clair = « plein jour » (ciel pâle).
 * L'or de l'heure dorée est réservé aux actions principales et aux repères.
 * Une seule famille (Archivo) : large pour les noms, étroite pour les chiffres.
 */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2-variations"), url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2-variations"), url("../fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Couleurs ─────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;
  --bg: #0F1626;
  --surface: #172036;
  --surface-2: #1F2A44;
  --surface-hover: #273453;
  --line: rgba(160, 182, 240, 0.14);
  --line-strong: rgba(160, 182, 240, 0.28);
  --text: #E6EBF5;
  --text-2: #A3AEC7;
  --text-3: #707C99;
  --gold: #F3B33D;
  --gold-hover: #F7C462;
  --gold-tint: rgba(243, 179, 61, 0.13);
  --on-gold: #131B2E;
  --blue: #93A9F4;
  --blue-tint: rgba(110, 140, 240, 0.16);
  --danger: #F2777A;
  --danger-tint: rgba(242, 119, 122, 0.14);
  --glass: rgba(10, 15, 28, 0.58);
  --shadow: 0 24px 48px -24px rgba(2, 6, 18, 0.75);
  --backdrop: rgba(4, 8, 20, 0.62);

  /* Plages de lumière (barre « Lumière ») */
  --phase-night: #0A0F1F;
  --phase-twilight: #22306A;
  --phase-blue: #3D5AB8;
  --phase-golden: #F3B33D;
  --phase-day: #C9D8F2;

  --radius-photo: 14px;
  --radius-panel: 20px;
  --radius-field: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --topbar-h: 64px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #EEF2F8;
  --surface: #FFFFFF;
  --surface-2: #E7ECF5;
  --surface-hover: #DCE3F0;
  --line: rgba(20, 30, 62, 0.11);
  --line-strong: rgba(20, 30, 62, 0.22);
  --text: #131B2E;
  --text-2: #4D5874;
  --text-3: #7B86A0;
  --gold: #F2AC2E;
  --gold-hover: #F5BB52;
  --gold-tint: rgba(242, 172, 46, 0.16);
  --on-gold: #131B2E;
  --blue: #3150B5;
  --blue-tint: rgba(49, 80, 181, 0.1);
  --danger: #C63F3B;
  --danger-tint: rgba(198, 63, 59, 0.09);
  --glass: rgba(10, 15, 28, 0.5);
  --shadow: 0 24px 48px -26px rgba(20, 30, 62, 0.35);
  --backdrop: rgba(19, 27, 46, 0.4);
  --phase-day: #BDD0F0;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #EEF2F8;
    --surface: #FFFFFF;
    --surface-2: #E7ECF5;
    --surface-hover: #DCE3F0;
    --line: rgba(20, 30, 62, 0.11);
    --line-strong: rgba(20, 30, 62, 0.22);
    --text: #131B2E;
    --text-2: #4D5874;
    --text-3: #7B86A0;
    --gold: #F2AC2E;
    --gold-hover: #F5BB52;
    --gold-tint: rgba(242, 172, 46, 0.16);
    --on-gold: #131B2E;
    --blue: #3150B5;
    --blue-tint: rgba(49, 80, 181, 0.1);
    --danger: #C63F3B;
    --danger-tint: rgba(198, 63, 59, 0.09);
    --glass: rgba(10, 15, 28, 0.5);
    --shadow: 0 24px 48px -26px rgba(20, 30, 62, 0.35);
    --backdrop: rgba(19, 27, 46, 0.4);
    --phase-day: #BDD0F0;
  }
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  font-weight: 420;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
ul { margin: 0; padding: 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
::selection { background: var(--gold); color: var(--on-gold); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.i {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 650;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.num { font-variant-numeric: tabular-nums; }

/* ── Typographie ──────────────────────────────────────────────────────── */

.title-xl {
  font-size: clamp(2.2rem, 1.35rem + 3.4vw, 4.1rem);
  font-stretch: 125%;
  font-weight: 780;
  line-height: 0.96;
  letter-spacing: -0.028em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.title-lg {
  font-size: clamp(1.8rem, 1.35rem + 1.6vw, 2.5rem);
  font-stretch: 122%;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
.title-sm {
  font-size: 1.125rem;
  font-stretch: 112%;
  font-weight: 680;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.lead {
  color: var(--text-2);
  font-size: 1.0625rem;
  line-height: 1.6;
  max-width: 46ch;
}

/* ── Mise en page ─────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: 780px; }

/* ── Boutons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 620;
  font-stretch: 104%;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover:not(:disabled) { background: var(--gold-hover); }
.btn-soft { background: var(--surface-2); border-color: var(--line); }
.btn-soft:hover:not(:disabled) { background: var(--surface-hover); }
.btn-soft[aria-pressed="true"] { background: var(--gold-tint); border-color: var(--gold); }
.btn-quiet { color: var(--text-2); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 0.8125rem; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--on-gold);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  transition: background-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn-sm .i { width: 16px; height: 16px; }
.icon-btn-danger { color: var(--danger); }
.icon-btn-danger:hover { background: var(--danger-tint); color: var(--danger); }
.icon-btn-glass {
  background: var(--glass);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.icon-btn-glass:hover { background: rgba(10, 15, 28, 0.78); color: #fff; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 560;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.link-btn:hover { text-decoration-thickness: 2px; }
.link-btn:disabled { color: var(--text-3); text-decoration: none; cursor: default; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 560;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.chip:hover { background: var(--surface-hover); }
.chip[aria-pressed="true"] { background: var(--gold-tint); border-color: var(--gold); }
.chip .i { width: 16px; height: 16px; }
.chip-remove .i { width: 14px; height: 14px; color: var(--text-3); }

/* Sélecteur segmenté */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.seg > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  min-width: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}
.seg > button:hover { color: var(--text); }
.seg > button[aria-pressed="true"],
.seg > button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.seg-wide { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg-sm > button { height: 30px; min-width: 34px; padding: 0 10px; }
.seg-sm .i { width: 16px; height: 16px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 620;
  white-space: nowrap;
}
.badge .i { width: 14px; height: 14px; }
.badge-private { background: var(--surface-2); color: var(--text-2); }
.badge-public { background: var(--blue-tint); color: var(--blue); }

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--on-gold);
  font-size: 0.75rem;
  font-weight: 760;
}

/* ── Formulaires ──────────────────────────────────────────────────────── */

.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field-compact { margin-bottom: 0; }
.label { color: var(--text-2); font-size: 0.875rem; font-weight: 600; }
.optional { color: var(--text-3); font-weight: 450; margin-left: 4px; }
.field-help { color: var(--text-3); font-size: 0.8125rem; }
.field-error { color: var(--danger); font-size: 0.875rem; font-weight: 560; }
.field-error:empty { display: none; }
.static-value { font-weight: 560; }

.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: var(--text-3); opacity: 1; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-lg { height: 56px; font-size: 1.0625rem; }
.textarea { height: auto; min-height: 128px; padding: 12px 14px; line-height: 1.55; resize: vertical; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--danger-tint);
  color: var(--text);
  font-size: 0.9375rem;
}
.alert .i { margin-top: 2px; color: var(--danger); }
.alert-info { background: var(--blue-tint); }
.alert-info .i { color: var(--blue); }

/* Interrupteur */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-weight: 560;
  cursor: pointer;
}
.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid var(--line-strong);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s var(--ease-out);
}
.switch:checked { background: var(--gold); border-color: var(--gold); }
.switch:checked::before { transform: translateX(18px); background: var(--on-gold); }

/* Curseur */
.range { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 14px; margin-top: 16px; }
.range-label { grid-column: 1 / -1; color: var(--text-2); font-size: 0.875rem; font-weight: 600; }
.range output { min-width: 7ch; text-align: right; font-weight: 650; font-stretch: 88%; font-variant-numeric: tabular-nums; }
input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--surface-hover); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-hover); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--gold); }
input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--gold);
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--bg); background: var(--gold); }
input[type="range"]:disabled { opacity: 0.4; }

/* ── Barre du haut ────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1320px;
  height: var(--topbar-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--text); }
.brand-mark .brand-dot { fill: var(--gold); }
.brand-name { font-size: 1.25rem; font-stretch: 125%; font-weight: 800; letter-spacing: -0.03em; }
.brand-lg .brand-mark { width: 34px; height: 34px; }
.brand-lg .brand-name { font-size: 1.5rem; }

.scope {
  display: inline-flex;
  gap: 2px;
  margin-inline: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.scope-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 620;
  transition: background-color 0.18s, color 0.18s;
}
.scope-btn .i { width: 16px; height: 16px; }
.scope-btn:hover { color: var(--text); }
.scope-btn[aria-selected="true"] { background: var(--text); color: var(--bg); }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.scope + .topbar-actions { margin-left: 0; }
.topbar-add .i { width: 18px; height: 18px; }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 720;
  font-stretch: 110%;
  cursor: pointer;
  user-select: none;
}
.menu[open] > .avatar { border-color: var(--gold); }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 50;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.menu-who { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-who strong { font-weight: 680; }
.menu-who span { color: var(--text-3); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 540;
  text-align: left;
  text-decoration: none;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item .i { color: var(--text-2); }
.menu-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  font-size: 0.9375rem;
}
.no-js .menu-theme { display: none; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  display: none;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 14px 30px -10px rgba(243, 179, 61, 0.55), 0 6px 18px -6px rgba(2, 6, 18, 0.6);
}
.fab .i { width: 26px; height: 26px; stroke-width: 2.2; }

/* ── Liste ────────────────────────────────────────────────────────────── */

.list-page { padding-top: clamp(24px, 4vw, 44px); padding-bottom: 80px; }
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 22px;
}
.list-count { color: var(--text-2); font-size: 1rem; font-weight: 560; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { position: relative; flex: 1 1 320px; display: block; }
.search > .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%;
  height: 48px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.toolbar .btn { height: 48px; }
.view-switch > button { height: 40px; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.active-filters:empty { display: none; }

.results { margin-top: 22px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: clamp(16px, 2vw, 26px) clamp(14px, 1.8vw, 22px);
  list-style: none;
  transition: opacity 0.2s;
}
.grid[aria-busy="true"] { opacity: 0.55; }

.card { display: block; color: inherit; text-decoration: none; border-radius: var(--radius-photo); }
.card:hover { text-decoration: none; }
.card:focus-visible { outline: none; }
.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-photo);
  overflow: hidden;
  background: var(--surface-2);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
/* Collimateurs de mise au point : apparaissent au survol ou au focus clavier */
.card-media::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  --c: var(--gold);
  --l: 20px;
  --t: 2px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--t) no-repeat,
    linear-gradient(var(--c) 0 0) top left / var(--t) var(--l) no-repeat,
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--t) no-repeat,
    linear-gradient(var(--c) 0 0) top right / var(--t) var(--l) no-repeat,
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--t) no-repeat,
    linear-gradient(var(--c) 0 0) bottom left / var(--t) var(--l) no-repeat,
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--t) no-repeat,
    linear-gradient(var(--c) 0 0) bottom right / var(--t) var(--l) no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.18s, transform 0.25s var(--ease-out);
}
.card:hover .card-media::after,
.card:focus-visible .card-media::after { opacity: 1; transform: scale(1); }
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--glass);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 640;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.glass-pill .i { width: 13px; height: 13px; }
.card-noimg {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  color: var(--text-3);
  font-size: 0.8125rem;
}
.card-noimg svg { width: 44px; height: 44px; }
.card-noimg .brand-dot { fill: currentColor; }
.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 12px;
  padding: 11px 2px 0;
}
.card-title {
  font-size: 1.0625rem;
  font-stretch: 112%;
  font-weight: 660;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-dist {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 640;
  font-stretch: 85%;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 2px;
}
.card-place, .card-author {
  grid-column: 1 / -1;
  color: var(--text-2);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-author { color: var(--text-3); font-size: 0.8125rem; }

.more { display: flex; justify-content: center; margin-top: 32px; }

.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 440px;
  margin: 48px auto 0;
  text-align: center;
}
.empty .brand-mark { width: 56px; height: 56px; color: var(--text-3); margin-bottom: 6px; }
.empty .brand-dot { fill: var(--gold); }
.empty-text { color: var(--text-2); }
.empty .btn { margin-top: 8px; }

.list-map {
  height: max(420px, calc(100dvh - 260px));
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  overflow: hidden;
}

/* ── Feuille de filtres ───────────────────────────────────────────────── */

dialog { color: var(--text); }
dialog::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }

.sheet {
  width: min(440px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sheet[open] { animation: sheet-in 0.26s var(--ease-out); }
.sheet-inner { display: flex; flex-direction: column; height: 100%; }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px 22px;
  border-bottom: 1px solid var(--line);
}
.sheet-scroll { flex: 1; overflow-y: auto; padding: 8px 22px 22px; overscroll-behavior: contain; }
.sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet-foot .btn-gold { flex: 1; }

.fgroup { margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.fgroup:last-of-type { border-bottom: 0; }
.fgroup legend { float: left; width: 100%; margin-bottom: 12px; padding: 0; font-size: 0.9375rem; font-weight: 680; font-stretch: 110%; }
.fgroup legend + * { clear: both; }
.fgroup-hint { color: var(--text-2); font-size: 0.875rem; margin-bottom: 12px; }
.fgroup-hint strong { color: var(--text); font-weight: 650; }
.origin-row { display: grid; gap: 10px; }
.origin-row .chip { justify-self: start; }
.origin-search { display: flex; gap: 6px; }
.origin-search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9375rem;
}
.origin-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.origin-search .icon-btn { width: 42px; height: 42px; background: var(--surface-2); border-color: var(--line); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .chip { height: 32px; padding: 0 12px; font-size: 0.8125rem; }
.tag-cloud .chip span { color: var(--text-3); font-variant-numeric: tabular-nums; }
.tag-cloud-empty { color: var(--text-3); font-size: 0.875rem; }

.suggestions {
  margin-top: 8px;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}
.suggestions button {
  display: grid;
  gap: 1px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  background: none;
  text-align: left;
}
.suggestions button:hover, .suggestions button:focus-visible { background: var(--surface-2); outline: none; }
.suggestions strong { font-weight: 640; }
.suggestions span { color: var(--text-2); font-size: 0.8125rem; }
.suggestions .suggestions-note { padding: 8px 12px; color: var(--text-3); font-size: 0.8125rem; }

/* ── Fiche d'un spot ──────────────────────────────────────────────────── */

.spot-page { padding-bottom: 72px; }
.spot-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.spot-bar-actions { display: flex; align-items: center; gap: 4px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -6px;
  padding: 8px 10px 8px 4px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.spot-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
.spot-media { position: sticky; top: calc(var(--topbar-h) + 16px); min-width: 0; }

.gallery {
  position: relative;
  aspect-ratio: var(--ratio, 1.5);
  max-height: calc(100dvh - var(--topbar-h) - 140px);
  width: 100%;
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--surface-2);
}
.gallery-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { outline-offset: -3px; }
.gallery-slide { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: start; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-zoom { position: absolute; top: 12px; right: 12px; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-count {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--glass);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 640;
  font-stretch: 90%;
  font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.gallery-empty { aspect-ratio: 4 / 3; }
.gallery-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  height: 100%;
  padding: 24px;
  color: var(--text-2);
  text-align: center;
}
.placeholder-mark { width: 64px; height: 64px; color: var(--text-3); }
.placeholder-mark .brand-dot { fill: var(--gold); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
.thumb {
  flex: none;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  opacity: 0.5;
  transition: opacity 0.15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 0.85; }
.thumb[aria-current="true"] { opacity: 1; outline: 2px solid var(--gold); outline-offset: 2px; }

.spot-info { min-width: 0; }
.spot-head { margin-bottom: 18px; }
.spot-title { margin-bottom: 14px; }
.spot-place { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 1.0625rem; font-weight: 520; }
.spot-place .i { color: var(--gold); }
.spot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; color: var(--text-3); font-size: 0.875rem; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; list-style: none; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 560;
  text-decoration: none;
}
.tag::before { content: "#"; color: var(--text-3); margin-right: 1px; }
.tag:hover { background: var(--surface-2); text-decoration: none; }

.spot-desc { margin-bottom: 26px; font-size: 1.0625rem; line-height: 1.65; max-width: 62ch; overflow-wrap: anywhere; }
.spot-desc p + p { margin-top: 0.85em; }

.panel {
  padding: clamp(18px, 2.6vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-note { margin-top: 12px; color: var(--text-3); font-size: 0.8125rem; }

/* Lumière du jour */
.day-picker { display: flex; align-items: center; gap: 2px; }
.day-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 620;
  cursor: pointer;
}
.day-label:hover { background: var(--surface-2); }
.day-label input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
}
.light-bar { position: relative; }
.light-bar svg { width: 100%; height: auto; overflow: visible; }
.light-bar .ph-night { fill: var(--phase-night); }
.light-bar .ph-twilight { fill: var(--phase-twilight); }
.light-bar .ph-blue { fill: var(--phase-blue); }
.light-bar .ph-golden { fill: var(--phase-golden); }
.light-bar .ph-day { fill: var(--phase-day); }
.light-bar .bar-outline { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.light-bar .tick { fill: var(--text-3); font-size: 11px; font-weight: 560; font-stretch: 85%; font-variant-numeric: tabular-nums; }
.light-bar .now-line { stroke: var(--text); stroke-width: 2; }
.light-bar .now-dot { fill: var(--text); stroke: var(--surface); stroke-width: 3; }
.light-bar .now-label { fill: var(--text); font-size: 11px; font-weight: 700; font-stretch: 90%; }
.light-times { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin-top: 18px; }
.light-col h3 { margin-bottom: 8px; color: var(--text-3); font-size: 0.8125rem; font-weight: 600; }
.light-col dl { display: grid; gap: 8px; margin: 0; }
.light-row { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; }
.light-row dt { color: var(--text-2); font-size: 0.9375rem; }
.light-row dd {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 660;
  font-stretch: 82%;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.swatch { width: 10px; height: 10px; border-radius: 3px; transform: translateY(1px); }
.swatch-blue { background: var(--phase-blue); }
.swatch-golden { background: var(--phase-golden); }
.swatch-sun { background: transparent; border: 2px solid var(--phase-golden); border-radius: 50%; }
.light-empty { grid-column: 1 / -1; color: var(--text-2); }

/* Y aller */
.place-map { height: 260px; margin-bottom: 18px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.facts { display: grid; gap: 12px; margin: 0 0 20px; }
.fact { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.fact dt { color: var(--text-3); font-size: 0.875rem; }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.fact-coords { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fact-coords .icon-btn { margin-block: -6px; }
.open-with-label { margin-bottom: 10px; color: var(--text-3); font-size: 0.875rem; }
.open-with-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 620;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.app-btn:hover { background: var(--surface-hover); border-color: var(--line-strong); text-decoration: none; }
.app-btn .i { color: var(--gold); }

/* Plein écran */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #05080F;
  color: #fff;
}
.lightbox::backdrop { background: #05080F; }
.lightbox-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.lightbox-track::-webkit-scrollbar { display: none; }
.lightbox-slide {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) 16px max(56px, env(safe-area-inset-bottom));
  scroll-snap-align: start;
}
.lightbox-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }
.lightbox-count {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 640;
  font-stretch: 90%;
  font-variant-numeric: tabular-nums;
}

/* Fenêtre de confirmation */
.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.modal[open] { animation: pop-in 0.2s var(--ease-out); }
.modal-inner { padding: 24px; }
.modal-text { margin: 10px 0 22px; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ── Ajout / modification ─────────────────────────────────────────────── */

.edit-page { padding-top: 18px; padding-bottom: 40px; }
.edit-title { margin: 14px 0 28px; }
.form-block { padding: 26px 0; border-top: 1px solid var(--line); }
.form-block:first-of-type { border-top: 0; padding-top: 0; }
.block-head { margin-bottom: 16px; }
.block-hint { margin-top: 4px; color: var(--text-2); font-size: 0.9375rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  list-style: none;
}
.photo-grid:empty { display: none; }
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.tile-cover { position: absolute; left: 6px; bottom: 6px; }
.tile-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.tile-actions .icon-btn { width: 30px; height: 30px; }
.tile-actions .i { width: 15px; height: 15px; }

.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 26px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: var(--gold-tint); }
.dropzone:focus-within { border-color: var(--gold); }
.dropzone .i { width: 26px; height: 26px; margin-bottom: 6px; color: var(--gold); }
.dropzone-title { color: var(--text); font-weight: 650; }
.dropzone-hint { font-size: 0.875rem; }
.js .dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.no-js .dropzone { cursor: default; }
.dropzone.is-full { display: none; }
.noscript-photo { display: inline-flex; align-items: center; gap: 8px; margin: 8px 12px 0 0; }

.gps-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 12px;
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  background: var(--blue-tint);
}
.gps-hint .i { color: var(--blue); }
.gps-hint p { flex: 1 1 200px; font-size: 0.9375rem; }

.address-row { display: flex; gap: 8px; }
.address-row .input { flex: 1; min-width: 0; }
.address-row .btn { height: 48px; flex: none; }
.locate-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 2px 0 12px; }
.locate-status { color: var(--text-2); font-size: 0.875rem; }
.picker-map {
  height: clamp(260px, 44vh, 440px);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
}
.picker-map .leaflet-container { cursor: crosshair; }
.coords-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }

.vis-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vis-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.vis-card input { position: absolute; opacity: 0; pointer-events: none; }
.vis-card:hover { border-color: var(--line-strong); }
.vis-card:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); }
.vis-card:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.vis-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.vis-card:has(input:checked) .vis-icon { background: var(--gold); color: var(--on-gold); }
.vis-text { display: grid; gap: 2px; }
.vis-text strong { font-weight: 680; font-stretch: 108%; }
.vis-text span { color: var(--text-2); font-size: 0.875rem; line-height: 1.4; }

.tags-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--surface-2);
  cursor: text;
}
.tags-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.tags-field .chip { height: 30px; padding: 0 6px 0 11px; gap: 2px; background: var(--surface); font-size: 0.8125rem; }
.tags-field .chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-3); }
.tags-field .chip button:hover { color: var(--text); background: var(--surface-2); }
.tags-field .chip .i { width: 13px; height: 13px; }
.tags-field input { flex: 1 1 120px; min-width: 100px; height: 34px; padding: 0 6px; border: 0; background: none; color: var(--text); font-size: 1rem; outline: none; }
.tags-field input::placeholder { color: var(--text-3); }

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.upload-progress { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; }
.upload-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.upload-bar span { display: block; width: 0; height: 100%; background: var(--gold); transition: width 0.2s; }
.upload-text { color: var(--text-2); font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Connexion ────────────────────────────────────────────────────────── */

.page-login { background: var(--bg); }
.login {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.sky { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #0A0F1D; }
.sky-band { position: relative; transform-origin: bottom; }
.sky-band span {
  position: absolute;
  right: clamp(18px, 3vw, 32px);
  bottom: 10px;
  font-size: 0.8125rem;
  font-weight: 640;
  font-stretch: 105%;
}
.sky-night { flex: 2.3 1 0; background: #080C19; }
.sky-deep { flex: 1.3 1 0; background: #111A3A; }
.sky-dusk { flex: 1.1 1 0; background: #1D2B66; }
.sky-blue { flex: 1 1 0; background: #3352B0; }
.sky-blue span { color: rgba(255, 255, 255, 0.85); }
.sky-gold { flex: 0.78 1 0; background: #F3B33D; }
.sky-gold span { color: rgba(19, 27, 46, 0.8); }
.sky-ground {
  flex: 2.5 1 0;
  display: flex;
  align-items: flex-end;
  padding: clamp(24px, 4vw, 48px);
  background: #070B15;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.sky-line {
  max-width: 19ch;
  color: #E6EBF5;
  font-size: clamp(1.5rem, 0.9rem + 1.7vw, 2.45rem);
  font-weight: 740;
  font-stretch: 118%;
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.js .sky-gold { animation: band-in 0.7s var(--ease-out) 0.05s both; }
.js .sky-blue { animation: band-in 0.7s var(--ease-out) 0.15s both; }
.js .sky-dusk { animation: band-in 0.7s var(--ease-out) 0.25s both; }
.js .sky-deep { animation: band-in 0.7s var(--ease-out) 0.35s both; }
.js .sky-night { animation: band-in 0.8s var(--ease-out) 0.45s both; }
.js .sky-line { animation: fade-in 0.8s ease 0.7s both; }

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  margin-inline: auto;
  padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 56px);
}
.login-panel .brand { align-self: flex-start; margin-bottom: clamp(32px, 6vh, 56px); }
.login-form .title-lg { margin-bottom: 12px; }
.login-form .lead { margin-bottom: 26px; }
.login-form .lead a { white-space: nowrap; }
.login-form .btn-block { margin-top: 6px; }
.login-foot { margin-top: 16px; color: var(--text-3); font-size: 0.875rem; }
.resend { margin-top: 22px; color: var(--text-2); font-size: 0.9375rem; }

.otp { position: relative; }
.otp-slots { display: none; }
.no-js .otp-input, .otp-input { letter-spacing: 0.45em; text-align: center; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.js .otp-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.js .otp-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  letter-spacing: 0;
}
.otp-slots span {
  display: grid;
  place-items: center;
  height: 64px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 1.75rem;
  font-weight: 720;
  font-stretch: 105%;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.otp-slots span.is-filled { border-color: var(--line-strong); }
.otp.is-focused .otp-slots span.is-active { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.otp.is-error .otp-slots span { border-color: var(--danger); }
.paste-btn { justify-self: start; margin-top: 4px; font-size: 0.875rem; }
.paste-btn .i { width: 15px; height: 15px; }

/* ── Compte ───────────────────────────────────────────────────────────── */

.account-page { padding-top: 18px; padding-bottom: 64px; }
.account-page .title-xl { margin: 14px 0 26px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { display: grid; gap: 2px; }
.stat-value { font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.4rem); font-weight: 760; font-stretch: 85%; line-height: 1; }
.stat-label { color: var(--text-2); font-size: 0.875rem; }
.profile-form .btn { margin-top: 4px; }
.sessions { display: grid; list-style: none; margin-top: 14px; }
.session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.session-text { display: grid; gap: 2px; min-width: 0; }
.session-text strong { font-weight: 640; }
.session-text span { color: var(--text-3); font-size: 0.875rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ── Erreurs ──────────────────────────────────────────────────────────── */

.error-page { display: grid; place-items: center; min-height: calc(100dvh - var(--topbar-h)); padding-block: 48px; }
.error-card { display: grid; justify-items: start; gap: 14px; max-width: 520px; }
.error-code { color: var(--gold); font-size: 1rem; font-weight: 700; font-stretch: 85%; font-variant-numeric: tabular-nums; }
.error-detail { max-width: 100%; margin: 0; padding: 12px 14px; overflow-x: auto; border-radius: 12px; background: var(--surface); color: var(--text-2); font-size: 0.8125rem; white-space: pre-wrap; }

/* ── Notifications ────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 200;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s var(--ease-out);
}
.toast .i { width: 17px; height: 17px; }
.toast-error { background: var(--danger); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }

/* ── Cartes (Leaflet) ─────────────────────────────────────────────────── */

.leaflet-container { background: var(--surface-2); font-family: inherit; font-size: 0.875rem; }
.leaflet-container a { color: var(--blue); }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 80%, transparent) !important;
  color: var(--text-3);
  font-size: 0.6875rem;
  border-top-left-radius: 8px;
}
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: 12px !important; overflow: hidden; box-shadow: none !important; }
.leaflet-bar a {
  width: 34px !important;
  height: 34px !important;
  line-height: 32px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom-color: var(--line) !important;
}
.leaflet-bar a:hover { background: var(--surface-2) !important; }
.leaflet-popup-content-wrapper { padding: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.leaflet-popup-content { width: 220px !important; margin: 0; line-height: 1.4; }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-container a.leaflet-popup-close-button { top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--glass); color: #fff; font: 18px/26px sans-serif; text-align: center; }
.map-popup { display: block; color: var(--text) !important; text-decoration: none; }
.map-popup:hover { text-decoration: none; }
.map-popup img { width: 100%; height: 130px; object-fit: cover; }
.map-popup-body { display: grid; gap: 2px; padding: 10px 12px 12px; }
.map-popup-body strong { font-weight: 680; font-stretch: 108%; }
.map-popup-body span { color: var(--text-2); font-size: 0.8125rem; }

/* Fonds OpenStreetMap : atténués en clair, inversés et teintés en sombre */
.tiles-osm .leaflet-tile-pane { filter: saturate(0.72) contrast(0.97); }
:root[data-theme="dark"] .tiles-osm .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(0.78) contrast(1.05) sepia(0.35) hue-rotate(185deg) saturate(1.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tiles-osm .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(0.78) contrast(1.05) sepia(0.35) hue-rotate(185deg) saturate(1.6); }
}

.pin-wrap { background: none; border: 0; }
.pin {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--bg), 0 4px 12px rgba(2, 6, 18, 0.5);
  transition: transform 0.15s var(--ease-out);
}
.pin-wrap:hover .pin { transform: scale(1.2); }
.pin-origin { background: var(--phase-blue); box-shadow: 0 0 0 3px #fff, 0 0 0 9px rgba(61, 90, 184, 0.25); }
.pin-spot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--glass);
  color: #fff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(2, 6, 18, 0.45);
}
.pin-spot svg { width: 30px; height: 30px; }
.pin-spot .brand-dot { fill: var(--gold); }

/* ── Animations ───────────────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes band-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Écrans moyens et petits ──────────────────────────────────────────── */

@media (max-width: 980px) {
  .spot-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .spot-media { position: static; }
  .gallery { max-height: 72vh; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .sky { height: 132px; flex-direction: column; }
  .sky-band span, .sky-ground { display: none; }
  .sky { height: 112px; }
  .sky-night { flex: 1.1 1 0; }
  .sky-deep { flex: 1 1 0; }
  .sky-dusk { flex: 1 1 0; }
  .sky-blue { flex: 1 1 0; }
  .sky-gold { flex: 0.85 1 0; }
  .login-panel { justify-content: flex-start; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 58px; }
  .topbar-inner { gap: 10px; }
  .topbar .brand-name { display: none; }
  .topbar-add { display: none; }
  .fab { display: grid; }
  .scope { margin-inline: auto; }
  .scope-btn { height: 34px; padding: 0 12px; font-size: 0.875rem; }
  .list-page { padding-bottom: 110px; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar .tool-near, .toolbar .tool-filters { flex: 1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-title { font-size: 1rem; }
  .sheet {
    width: 100vw;
    height: auto;
    max-height: 88dvh;
    margin: auto 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
  }
  .sheet[open] { animation-name: sheet-up; }
  .gallery { margin-inline: calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter)); border-radius: 0; }
  .gallery-thumbs { display: none; }
  .gallery-nav { display: none; }
  .spot-bar-actions .btn span { display: none; }
  .spot-bar-actions .btn { width: 40px; padding: 0; }
  .light-times { grid-template-columns: 1fr; }
  .vis-options { grid-template-columns: 1fr; }
  .fact { grid-template-columns: 1fr; gap: 2px; }
  .open-with-apps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-btn { flex-direction: column; gap: 5px; height: 68px; padding: 0 6px; font-size: 0.8125rem; text-align: center; }
  .form-actions .btn-quiet { display: none; }
  .form-actions .btn-gold { flex: 1; }
  .stats .stat-label { font-size: 0.8125rem; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card-media { aspect-ratio: 4 / 3; }
  .scope-btn .i { display: none; }
  .toolbar .btn span:not(.count-badge) { display: none; }
  .toolbar .tool-near, .toolbar .tool-filters { flex: 0 0 48px; width: 48px; padding: 0; position: relative; }
  .toolbar .count-badge { position: absolute; top: -4px; right: -4px; }
  .toolbar .view-switch { margin-left: auto; }
  .otp-slots span { height: 56px; font-size: 1.5rem; }
}

@media (hover: none) {
  .gallery-nav { display: none; }
}
