:root {
  --navy: #17263b;
  --gold: #c1974f;
  --ink: #22252a;
  --paper: #fafaf8;
  --line: #e3e1dc;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
main { max-width: 960px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.5rem; line-height: 1.25; }

.hidden { display: none !important; }
html[data-lang="fr"] .only-en { display: none; }
html[data-lang="en"] .only-fr { display: none; }

/* Header / footer */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1rem; background: var(--navy); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: 0.03em; }
#lang-toggle {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.45);
  border-radius: 6px; padding: 0.25rem 0.6rem; font: inherit; cursor: pointer;
}
.site-footer { text-align: center; padding: 2rem 1rem; color: #777; }
.site-footer a { color: inherit; }

/* Home cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: box-shadow 0.15s ease;
}
.card:hover { box-shadow: 0 4px 16px rgba(23,38,59,0.12); }
.card img, .card-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line); }
.card-body { padding: 0.75rem 0.9rem 1rem; }
.card-price { font-weight: 700; color: var(--navy); font-size: 1.1rem; }
.card-address { color: #555; font-size: 0.95rem; margin-top: 0.15rem; }

/* Teaser slideshow */
.teaser { transition: filter 0.5s ease; }
.teaser.blurred { filter: blur(16px); pointer-events: none; user-select: none; }
.slideshow { position: relative; aspect-ratio: 4 / 3; background: var(--navy); border-radius: var(--radius); overflow: hidden; }
.slideshow .slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.8s ease;
}
.slideshow .slide.active { opacity: 1; }
.badge-sold {
  display: inline-block; background: var(--gold); color: #fff;
  border-radius: 4px; padding: 0.1rem 0.5rem; font-size: 0.8em; vertical-align: middle;
}

/* Gate */
.gate {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(23,38,59,0.55);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.gate-card {
  background: #fff; border-radius: var(--radius); padding: 1.5rem;
  width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
.gate-card h2 { margin-top: 0; color: var(--navy); }
.gate-card label { display: block; margin: 0.8rem 0; font-weight: 600; font-size: 0.95rem; }
.gate-card input[type="text"], .gate-card input[type="tel"] {
  width: 100%; padding: 0.65rem 0.7rem; margin-top: 0.3rem;
  border: 1px solid var(--line); border-radius: 6px; font: inherit;
}
.gate-card .consent { display: flex; gap: 0.55rem; font-weight: 400; font-size: 0.85rem; align-items: flex-start; }
.gate-card .consent input { margin-top: 0.2rem; }
.gate-card button {
  width: 100%; padding: 0.8rem; margin-top: 0.5rem;
  background: var(--gold); color: #fff; border: 0; border-radius: 6px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.gate-card button:disabled { opacity: 0.6; }
.gate-error { color: #b3261e; font-size: 0.9rem; }
.gate-privacy { display: block; text-align: center; margin-top: 0.8rem; font-size: 0.8rem; color: #777; }
.hp { position: absolute; left: -9999px; top: -9999px; }

/* Full listing */
.listing-price { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.listing-meta { display: flex; gap: 1.2rem; color: #555; margin: 0.5rem 0 1rem; flex-wrap: wrap; }
.btn-visit {
  display: inline-block; background: var(--gold); color: #fff; text-decoration: none;
  padding: 0.75rem 1.4rem; border-radius: 6px; font-weight: 700; margin-bottom: 1rem;
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.descriptions { margin: 1.2rem 0; line-height: 1.6; white-space: pre-line; }
.features { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.features li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.9rem; }

/* Admin */
.admin main { max-width: 1100px; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; font-size: 0.92rem; }
.admin-form { display: grid; gap: 0.8rem; max-width: 640px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.admin-form label { font-weight: 600; font-size: 0.9rem; display: grid; gap: 0.3rem; }
.admin-form input, .admin-form textarea, .admin-form select {
  padding: 0.55rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit;
}
.admin-form textarea { min-height: 110px; }
.admin-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn { background: var(--navy); color: #fff; border: 0; border-radius: 6px; padding: 0.6rem 1.1rem; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.gold { background: var(--gold); }
.btn.danger { background: #b3261e; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; list-style: none; padding: 0; }
.photo-grid li { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem; cursor: grab; }
.photo-grid li.dragging { opacity: 0.5; }
.photo-grid img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }
.photo-grid .photo-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 0.3rem; font-size: 0.8rem; }
#qr-box svg { width: 220px; height: 220px; }
.upload-status { font-size: 0.9rem; color: #555; }
