:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --surface-2: #efebe4;
  --text: #1d1b18;
  --muted: #6d665c;
  --border: #e2dcd2;
  --accent: #a8743f;
  --accent-ink: #ffffff;
  --accent-soft: #f3e7da;
  --danger: #b4392f;
  --ok: #2f7d4f;
  --shadow: 0 1px 2px rgba(30, 25, 15, .06), 0 6px 24px rgba(30, 25, 15, .06);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311;
    --surface: #1d1b18;
    --surface-2: #282521;
    --text: #f1ece4;
    --muted: #a59d90;
    --border: #35312b;
    --accent: #d39a5e;
    --accent-ink: #1a140d;
    --accent-soft: #3a2c1e;
    --danger: #e0685d;
    --ok: #5cc286;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
img { display: block; max-width: 100%; }

/* --- Barre du haut --- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; font-size: 17px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--accent); display: grid; place-items: center;
  color: var(--accent); font-size: 11px; font-weight: 800;
}
.topbar .spacer { flex: 1; }

/* --- Boutons et champs --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; font-size: 14px;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 9px; font-size: 13px; border-radius: 7px; }
.btn.icon { padding: 6px 8px; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* --- Mise en page --- */
.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; }
.section-head h2 { font-size: 22px; }
.section-head .spacer { flex: 1; }
.muted { color: var(--muted); }
.empty {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 48px 20px; text-align: center; color: var(--muted);
}

/* --- Cartes de biens --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  display: flex; flex-direction: column; text-decoration: none;
}
.card .cover { aspect-ratio: 16 / 9; background: var(--surface-2); position: relative; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
a.card:hover .cover img { transform: scale(1.05); }
.card .cover .badge { position: absolute; top: 10px; left: 10px; }
.card .cover .b360 {
  position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
}
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .title { font-weight: 700; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13.5px; }
.card .price { font-weight: 700; color: var(--accent); }
.card .actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
}
.badge.on { background: var(--ok); color: #fff; border-color: transparent; }

.hero { padding: 56px 24px 36px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); }
.hero p { color: var(--muted); max-width: 560px; margin: 12px auto 0; font-size: 16px; }

/* --- Photothèque --- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.photo img { aspect-ratio: 2 / 1; width: 100%; object-fit: cover; background: var(--surface-2); }
.photo .info { padding: 8px 10px; font-size: 13px; }
.photo .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .links { display: flex; gap: 10px; margin-top: 4px; font-size: 12.5px; }
.photo .links a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* --- Connexion --- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login {
  width: 100%; max-width: 360px; background: var(--surface); padding: 28px;
  border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.login h1 { font-size: 22px; margin: 14px 0 18px; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* --- Dialogues --- */
dialog {
  border: 1px solid var(--border); border-radius: 14px; padding: 22px; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(10, 8, 5, .5); }
dialog h3 { margin-bottom: 14px; font-size: 18px; }
dialog .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Hotspots Pannellum (éditeur et visite) --- */
.hs {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
}
.hs .hs-dot {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.22); border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(0,0,0,.18), 0 4px 14px rgba(0,0,0,.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: transform .2s, background .2s;
}
.hs:hover .hs-dot { transform: scale(1.12); background: rgba(255,255,255,.4); }
.hs svg { width: 22px; height: 22px; fill: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.hs-scene .hs-dot { animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55), 0 4px 14px rgba(0,0,0,.35); }
  70% { box-shadow: 0 0 0 14px rgba(255,255,255,0), 0 4px 14px rgba(0,0,0,.35); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0), 0 4px 14px rgba(0,0,0,.35); }
}
.hs .hs-label {
  position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 13, 10, .82); color: #fff; padding: 6px 11px; border-radius: 8px;
  font: 600 13.5px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s;
  max-width: 280px;
}
.hs .hs-label.multi { white-space: normal; width: max-content; }
.hs .hs-label small { display: block; font-weight: 400; opacity: .85; margin-top: 2px; }
.hs:hover .hs-label, .hs.flash .hs-label { opacity: 1; }
.hs-scene .hs-label { opacity: 1; }
.hs.flash .hs-dot { background: var(--accent); }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .container { padding: 20px 16px 48px; }
  .row { grid-template-columns: 1fr; }
}
