:root {
  --blue: #1b4fd7;          /* bleu principal (boutons) */
  --blue-dark: #15389a;     /* bleu foncé hover */
  --navy: #14224b;          /* texte titres */
  --price: #1c64f2;         /* bleu vif du prix */
  --ink: #1f2937;           /* texte courant */
  --muted: #6b7280;         /* texte secondaire */
  --line: #e6e8ee;          /* bordures */
  --bg: #f4f6fb;            /* fond de page */
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 34, 75, 0.08);
  --shadow-hover: 0 14px 38px rgba(20, 34, 75, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--ghost { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn--ghost:hover { background: #eef3ff; }
.btn--sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn--block { width: 100%; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: .5px;
}
.brand__name { font-weight: 800; color: var(--navy); font-size: 18px; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--navy); font-weight: 600; font-size: 15px; }
.site-nav a:hover { color: var(--blue); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, #eef3ff 0%, var(--bg) 100%);
  padding: 52px 0 36px;
}
.hero__title {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  color: var(--navy);
  font-weight: 800;
}
.hero__text { margin: 0; max-width: 720px; color: var(--muted); font-size: 17px; }

/* ---------- Barre d'outils ---------- */
.toolbar { padding: 22px 0 8px; }
.toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.toolbar__count { font-weight: 700; color: var(--navy); margin-right: auto; }
.toolbar__filters { display: flex; flex-wrap: wrap; gap: 10px; }
.field {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
}
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27, 79, 215, .15); }
#searchInput { min-width: 240px; }

/* ---------- Grille ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
  padding: 22px 0 60px;
}
.empty { text-align: center; color: var(--muted); padding: 40px 0 80px; }

/* ---------- Carte ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.card__media {
  position: relative;
  aspect-ratio: 16 / 11;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.card__media--placeholder {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .92);
}
.card__media-icon { width: 56px; height: 56px; opacity: .9; }

.badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 8px; }
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  letter-spacing: .2px;
  width: fit-content;
}
.badge--exclu { background: #fff; color: var(--blue); border: 1px solid rgba(27,79,215,.25); }
.badge--new { background: var(--blue); color: #fff; }
.badge--coup { background: #b9881f; color: #fff; }
.badge--viager {
  background: rgba(20, 34, 75, .78);
  color: #fff;
}

.card__fav {
  position: absolute;
  top: 12px; right: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .1s;
}
.card__fav:hover { transform: scale(1.08); }
.card__fav svg { width: 20px; height: 20px; }
.card__fav.is-active { color: #e11d48; }

.card__count {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(20, 34, 75, .72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card__title { margin: 0; font-size: 21px; color: var(--navy); font-weight: 800; }
.card__price { color: var(--price); font-weight: 800; font-size: 22px; white-space: nowrap; }
.card__price small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; }
.card__loc { font-weight: 700; color: var(--navy); font-size: 14px; letter-spacing: .3px; }
.card__specs { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.card__rente {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--blue);
  background: #eef3ff; border-radius: 999px; padding: 5px 12px; width: fit-content;
}
.card__actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.card__actions .btn { flex: 1; }

/* ---------- Modale ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20, 34, 75, .55); }
.modal__dialog {
  position: relative;
  background: #fff;
  width: min(760px, 94vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
}
.modal__close {
  position: absolute; top: 12px; right: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: #fff; color: var(--navy);
  font-size: 26px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.detail__media {
  height: 280px; background-size: cover; background-position: center;
  display: grid; place-items: center; color: #fff;
}
.detail__body { padding: 24px 28px 30px; }
.detail__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.detail__title { margin: 0; color: var(--navy); font-size: 26px; font-weight: 800; }
.detail__loc { color: var(--muted); font-weight: 600; margin-top: 2px; }
.detail__sub { color: var(--ink); font-weight: 600; margin-top: 8px; max-width: 460px; }
.detail__price { color: var(--price); font-weight: 800; font-size: 28px; }
.detail__price small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.detail__pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.pill { background: #eef3ff; color: var(--blue); font-weight: 600; font-size: 14px; padding: 7px 13px; border-radius: 999px; }
.detail__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 18px 0; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat__k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat__v { font-size: 18px; font-weight: 700; color: var(--navy); }
.detail__desc { color: var(--ink); line-height: 1.6; margin: 16px 0; }
.detail__atouts { margin: 12px 0; padding-left: 20px; color: var(--ink); line-height: 1.7; }
.detail__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.detail__cta .btn { flex: 1; min-width: 160px; }
.detail__ref { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--navy); color: #cdd6ee; margin-top: 30px; }
.site-footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px;
  padding: 40px 0 24px;
}
.brand--footer .brand__name { color: #fff; }
.site-footer__base { margin: 12px 0 0; max-width: 360px; color: #aab6d8; }
.site-footer__contact h3 { color: #fff; margin: 0 0 10px; font-size: 16px; }
.site-footer__contact a:hover { color: #fff; }
.site-footer__legal {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 16px 0 30px; font-size: 13px; color: #93a1c9;
}

@media (max-width: 560px) {
  .site-nav a:not(.btn) { display: none; }
  .toolbar__count { width: 100%; }
}
