/* Immocilia — portail B2C public (charte Vol. 07).
 * Vert/turquoise plus présents sur le B2C ; bleu reserved aux actions principales.
 */
:root {
  --brand: #0B0BE2;        /* bleu : actions principales */
  --secondary: #3A5FCD;
  --success: #1BA97B;      /* vert : signature B2C */
  --accent: #00D4AA;       /* turquoise : accents */
  --text: #0f172a;
  --muted: #797D87;
  --surface: #ffffff;
  --surface-alt: #f5f9f7;
  --border: #e5ede9;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 40px rgba(0, 212, 170, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--surface-alt);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.topbar .brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.topbar .brand b { color: var(--success); }
.topbar nav { display: flex; gap: 6px; align-items: center; }
.topbar nav button, .topbar nav a {
  background: transparent; border: 0; cursor: pointer;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--muted);
}
.topbar nav button:hover, .topbar nav a:hover { background: var(--surface-alt); color: var(--text); }
.topbar nav button.active { background: var(--brand); color: #fff; }

.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--success), var(--accent));
  color: #fff;
  border-radius: 22px;
  padding: 44px 36px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 6px 0 8px; letter-spacing: -.02em; line-height: 1.1; }
.hero p { margin: 0; opacity: .92; max-width: 60ch; }
.hero .kicker { color: rgba(255,255,255,.85); }

/* ---------- Recherche ---------- */
.search-bar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  box-shadow: var(--shadow);
}
.search-bar input, .search-bar select {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.search-bar input[type="search"] { flex: 1; min-width: 200px; }
.search-bar input:focus, .search-bar select:focus { outline: 2px solid var(--success); border-color: var(--success); }

/* ---------- Grille d'annonces ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .photo {
  height: 160px;
  background: linear-gradient(135deg, var(--accent), var(--success));
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.card .photo .tag {
  background: rgba(255,255,255,.9);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}
.card .photo .country {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.4); color: #fff;
  padding: 4px 10px; border-radius: 999px; font-size: .75rem;
}
.card .photo .fav {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,.9); border: 0; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.1rem; display: grid; place-items: center;
}
.card .photo .fav.active { background: var(--danger); color: #fff; }
.card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .body h3 { margin: 0; font-size: 1.05rem; }
.card .body .meta { color: var(--muted); font-size: .85rem; }
.card .body .price { color: var(--brand); font-weight: 800; font-size: 1.15rem; margin-top: auto; }
.card .body .ref-line { font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.card .body .actions { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- Composants ---------- */
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; }
h1 { font-size: 1.7rem; margin: 4px 0 6px; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
p.lead { color: var(--muted); margin: 0 0 18px; max-width: 70ch; }

.btn { background: var(--brand); color: #fff; border: 0; padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: background .15s; }
.btn:hover { background: var(--secondary); }
.btn.good { background: var(--success); }
.btn.good:hover { background: #14966a; }
.btn.secondary { background: var(--surface); color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.full { width: 100%; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-alt); color: var(--muted); border: 1px solid var(--border); }
.badge.ok { background: rgba(27,169,123,.12); color: var(--success); border-color: rgba(27,169,123,.3); }
.badge.brand { background: rgba(11,11,226,.1); color: var(--brand); border-color: rgba(11,11,226,.25); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty b { display: block; font-size: 1.1rem; margin-bottom: 6px; color: var(--text); }

.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 1000; max-width: 90vw; }
.toast.ok { background: var(--success); }
.toast.error { background: var(--danger); }

.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 999; padding: 24px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 26px; width: min(100%, 460px); box-shadow: var(--shadow-lg); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.modal h2 { margin-top: 0; }

.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--success); border-color: var(--success); }

/* ---------- Fiche détail ---------- */
.detail-photo { height: 280px; background: linear-gradient(135deg, var(--accent), var(--success)); border-radius: var(--radius); margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.detail-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); height: fit-content; }
.spec-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.spec-row:last-child { border-bottom: 0; }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .container { padding: 18px 14px; }
  .hero { padding: 28px 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .home-layout { grid-template-columns: 1fr !important; }
  .form-grid { grid-template-columns: 1fr !important; }
}

/* =====================================================================
 * Styles enrichis B2C (Vol. 03)
 * ===================================================================== */

/* ---------- Bannière hors-ligne ---------- */
.offline-banner { position: sticky; top: 0; z-index: 60; padding: 9px 24px; font-size: .9rem; font-weight: 500; text-align: center; color: #fff; }
.offline-banner.offline { background: var(--danger); }
.offline-banner.syncing { background: var(--warning); }

/* ---------- Bannière gratuit + bouton connexion ---------- */
.free-banner {
  background: linear-gradient(135deg, rgba(27,169,123,.12), rgba(0,212,170,.12));
  border: 1px dashed var(--success);
  color: var(--success);
  padding: 9px 18px; border-radius: 10px; text-align: center;
  font-size: .88rem; font-weight: 600; margin-bottom: 18px;
}
.login-btn {
  background: var(--brand); color: #fff !important;
  padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.topbar nav button.active { background: var(--brand); color: #fff; }

/* ---------- Badges ---------- */
.badge.warn { background: rgba(217,119,6,.14); color: var(--warning); border-color: rgba(217,119,6,.3); }
.badge.sponsor { background: linear-gradient(135deg, var(--accent), var(--success)); color: #fff; border: 0; font-weight: 700; }
.badge.small { padding: 2px 8px; font-size: .68rem; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { background: #00b894; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-alt); }

/* ---------- Ligne agence ---------- */
.agency-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.agency-line small { color: var(--secondary); font-weight: 600; }

/* ---------- Layout accueil avec sidebar pub ---------- */
.home-layout { display: grid; grid-template-columns: 1fr 240px; gap: 22px; }
.home-side { position: sticky; top: 80px; height: fit-content; }

/* ---------- Régie pub ---------- */
.ad { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.ad-label { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.ad-banner {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text);
  margin-bottom: 22px; background: linear-gradient(135deg, rgba(0,212,170,.08), rgba(27,169,123,.08));
  border: 1px solid var(--accent);
}
.ad-banner .ad-content { font-size: 1.05rem; font-weight: 700; color: var(--success); }
.ad-inline { margin: 22px 0; }
.ad-inline-list { display: flex; gap: 10px; flex-wrap: wrap; }
.ad-mini { background: var(--surface-alt); border: 1px solid var(--border); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--text); }
.ad-mini:hover { background: var(--success); color: #fff; }
.ad-sidebar { position: sticky; top: 80px; }
.ad-side-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--border); padding: 10px 0; cursor: pointer; }
.ad-side-item:last-child { border-bottom: 0; }
.ad-side-item b { display: block; color: var(--text); }
.ad-side-item small { color: var(--brand); font-weight: 700; }
.ad-side-item:hover b { color: var(--success); }

/* ---------- Segmented (Mon espace) ---------- */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-alt); border-radius: 10px; padding: 4px; margin-bottom: 18px; gap: 4px; }
.seg button { background: transparent; border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--success); color: #fff; }

/* ---------- Carte escrow ---------- */
.escrow-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--secondary); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.escrow-card.status-HELD_IN_ESCROW { border-left-color: var(--secondary); }
.escrow-card.status-DISPUTED { border-left-color: var(--warning); }
.escrow-card.status-RELEASED_TO_AGENCY, .escrow-card.status-REFUNDED_CLIENT { border-left-color: var(--success); }
.escrow-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.escrow-amounts { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; color: var(--text); margin-bottom: 6px; }
.escrow-info { background: var(--surface-alt); border-radius: 8px; padding: 10px; font-size: .85rem; color: var(--muted); margin: 10px 0; }
.escrow-info div { margin: 2px 0; }

/* ---------- Liste (annonces propriétaire) ---------- */
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.list-card .meta b { display: block; }
.list-card .meta small { color: var(--muted); display: block; }

/* ---------- Form card ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; max-width: 520px; box-shadow: var(--shadow); }
.form-card .field input:disabled { background: var(--surface-alt); color: var(--muted); }

/* ---------- Demo box (login) ---------- */
.demo-box { margin-top: 8px; padding: 10px; background: linear-gradient(135deg, rgba(27,169,123,.1), rgba(0,212,170,.1)); border: 1px dashed var(--success); border-radius: 10px; text-align: center; }
.demo-box small { display: block; color: var(--muted); font-size: .78rem; }
.demo-box b { display: block; font-size: 1.6rem; letter-spacing: .3em; color: var(--success); font-family: "Courier New", monospace; }

/* ---------- Phone box (detail) ---------- */
.phone-box { margin-top: 14px; padding: 12px; background: var(--surface-alt); border-radius: 10px; text-align: center; font-size: .85rem; color: var(--muted); }
.phone-box b { display: block; color: var(--brand); font-size: 1.05rem; margin-top: 2px; }

/* ---------- Cœur public (♥) + badge vidéo (fonctionnalité 3+4) ---------- */
.card .photo .heart {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,.92); border: 0; cursor: pointer;
  padding: 5px 10px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; color: var(--text);
  display: inline-flex; align-items: center; gap: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.card .photo .heart small { color: var(--muted); font-weight: 600; }
.card .photo .heart.active { background: var(--danger); color: #fff; }
.card .photo .heart.active small { color: #fff; }
.card .photo .heart:hover { transform: scale(1.05); }

.video-badge {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(0,0,0,.65); color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: .9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* ---------- Lecteur média + galerie (détail) ---------- */
.detail-photo { position: relative; overflow: hidden; min-height: 280px; display: flex; flex-direction: column; }
.media-stage { flex: 1; display: flex; align-items: center; justify-content: center; background: #000; }
.media-gallery {
  display: flex; gap: 6px; padding: 8px; overflow-x: auto;
  background: rgba(0,0,0,.7); position: absolute; bottom: 0; left: 0; right: 0;
}
.gallery-thumb {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px; border: 2px solid transparent;
  background: rgba(255,255,255,.2); color: #fff; cursor: pointer; font-size: .9rem;
  display: grid; place-items: center;
}
.gallery-thumb.active { border-color: var(--accent); background: var(--accent); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 1000; max-width: 90vw; }
.toast.ok { background: var(--success); }
.toast.error { background: var(--danger); }

/* ===== Mes identifiants de connexion (e-mail + téléphone vérifiés) ===== */
.identity-panel h3 { margin: 0 0 6px; }
.identity-panel .muted, .identity-panel .id-label { color: var(--muted); }
.identity-box { margin-top: 18px; }
.id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.id-label { min-width: 110px; font-weight: 600; }
.id-value { flex: 1; min-width: 180px; }
.id-form { margin-top: 12px; }
.id-form > label { display: block; font-weight: 600; margin-bottom: 6px; }
.id-inputs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.id-inputs input, .id-inputs select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.id-inputs input { flex: 1; min-width: 180px; }

/* Régie publicitaire (Vol. 03 §4.2). */
.ad-campaign { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; margin: 14px 0; }
.ad-campaign .ad-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 8px; }
.ad-campaign .ad-content { font-weight: 700; color: var(--brand); }
.ad-campaign small { color: var(--secondary); }
/* Numéro de l'agence (Vol. 03 §4.1). */
.phone-box small { display: block; margin-top: 6px; }
.phone-box .phone-num { display: block; font-size: 1.1rem; font-weight: 800; color: var(--brand); margin: 6px 0; text-decoration: none; }
.list-card.unread { border-left: 4px solid var(--accent); }

/* Vitrine d'agence et avis (Vol. 03 §3.2). */
.agency-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.agency-link:hover { text-decoration: underline; }
.agency-link.small { font-size: .82rem; }
.stars, .rating-big b { color: #F5A623; }
.agency-head { margin: 16px 0 10px; }
.agency-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rating-big { font-size: 1rem; color: var(--muted); }
.reviews-head { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; }
.review { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.review b { color: #F5A623; letter-spacing: 1px; }
.review p { margin: 6px 0 0; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: .8rem; cursor: pointer; padding: 4px 0 0; text-decoration: underline; }
.star-input { display: flex; gap: 6px; margin: 8px 0 14px; }
.star-input button { background: none; border: 0; font-size: 2rem; color: #F5A623; cursor: pointer; line-height: 1; }
/* Recherches de biens des particuliers. */
.request-cta { background: var(--surface-alt); border: 1px dashed var(--secondary); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.request-card .proposal { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.request-card .proposal p { margin: 6px 0; }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Chat sécurisé client ↔ agence (Vol. 03 §1). */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; min-height: 420px; }
.chat-list { display: flex; flex-direction: column; gap: 6px; }
.chat-item { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.chat-item.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11,11,226,.12); }
.chat-item small { color: var(--muted); }
.chat-thread { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.chat-head small { color: var(--muted); }
.chat-head-actions { display: flex; gap: 8px; align-items: center; }
.chat-notice { margin: 0; padding: 8px 14px; background: rgba(0,212,170,.10); color: var(--text, #1d2433); font-size: .82rem; }
.chat-body { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 420px; min-height: 220px; }
.chat-body .bubble { align-self: flex-start; max-width: 78%; background: var(--surface-alt); padding: 8px 12px; border-radius: 12px 12px 12px 4px; white-space: pre-wrap; }
.chat-body .bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 12px 12px 4px 12px; }
.chat-body .bubble small { display: block; font-size: .7rem; opacity: .7; margin-top: 3px; }
.empty-chat { color: var(--muted); text-align: center; margin: auto; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; }
@media (max-width: 720px) { .chat-layout { grid-template-columns: 1fr; } .chat-list { flex-direction: row; overflow-x: auto; } .chat-item { min-width: 200px; } }

/* Inscription / connexion (Vol. 03 §3). */
.topbar nav .login-btn { background: var(--brand); color: #fff !important; border: 1px solid var(--brand); border-radius: 999px; }
.topbar nav .login-btn:hover { background: var(--secondary); border-color: var(--secondary); }
.topbar nav .login-btn.ghost-btn { background: transparent; color: var(--brand) !important; }
.topbar nav .login-btn.ghost-btn:hover { background: var(--surface-alt); }
.profile-choices { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.profile-choice { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; }
.profile-choice:hover, .profile-choice.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11,11,226,.12); }
.profile-choice .profile-icon { grid-row: span 2; font-size: 1.8rem; align-self: center; text-align: center; }
.profile-choice small { color: var(--muted); }
.auth-switch { text-align: center; font-size: .9rem; margin: 12px 0 6px; }
.auth-switch a { color: var(--brand); font-weight: 600; }
.auth-hint { font-size: .82rem; color: var(--muted); margin-top: 10px; }
.terms-box { margin: 6px 0 10px; font-size: .85rem; }
.terms-box summary { cursor: pointer; color: var(--secondary); }
.terms { padding-left: 18px; margin: 8px 0; color: var(--muted); }
.terms li { margin-bottom: 4px; }

/* Vidéos des annonces : cadre plus haut et vidéo entière (les vidéos de téléphone sont verticales ;
 * sans cela, la barre de lecture sortait du cadre et la vidéo ne pouvait pas être lancée). */
.detail-photo:has(video), .detail-photo:has(iframe) { height: min(70vh, 540px); }
.media-stage { min-height: 0; overflow: hidden; }
.media-stage video, .media-stage iframe { width: 100% !important; height: 100% !important; min-height: 0 !important; object-fit: contain; }
.media-stage img { width: 100%; height: 100%; object-fit: cover; }

/* Carte d'annonce avec vidéo : aperçu et vrai bouton de lecture. */
.card .photo .card-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.card .photo .video-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 1.4rem; cursor: pointer; justify-content: center; line-height: 1; }
.card .photo .video-play span { font-size: .6rem; font-weight: 700; text-transform: uppercase; }
.card .photo .video-play:hover { background: var(--brand); transform: translate(-50%, -50%) scale(1.06); }

/* Espace agence (compte Mandalia). */
.agency-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.agency-card-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.agency-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.agency-stat { background: var(--surface-alt); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.agency-stat b { font-size: 1.5rem; color: var(--brand); }
.agency-stat span { font-size: .85rem; }
.agency-stat small { color: var(--muted); font-size: .75rem; }

/* Réservations sur les annonces de l'agence. */
.reservation-list { display: flex; flex-direction: column; gap: 8px; }
.reservation-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.reservation-row small { color: var(--muted); }
.reservation-amount { text-align: right; display: flex; flex-direction: column; }
@media (max-width: 720px) { .reservation-row { grid-template-columns: 1fr; } .reservation-amount { text-align: left; } }

/* Bandeau : ne déborde jamais (le bouton « Déconnexion » était coupé sur les écrans étroits). */
.topbar { gap: 10px; flex-wrap: wrap; }
.topbar nav { flex-wrap: wrap; justify-content: flex-end; min-width: 0; row-gap: 6px; }
.topbar nav button, .topbar nav a { white-space: nowrap; }
@media (max-width: 960px) {
  .topbar { padding: 10px 16px; }
  .topbar nav { gap: 4px; }
  .topbar nav button, .topbar nav a { padding: 7px 10px; font-size: .88rem; }
}
@media (max-width: 560px) {
  .topbar { justify-content: center; }
  .topbar nav { justify-content: center; }
}

/* National / International (National par défaut). */
.scope-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.scope-seg { display: inline-flex; background: var(--surface-alt); border-radius: 999px; padding: 4px; gap: 4px; }
.scope-seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--muted); }
.scope-seg button.active { background: var(--brand); color: #fff; }
#intl-country { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 180px; }

/* Recherche : texte lisible (le pays choisi était écrit en blanc sur fond blanc). */
.search-bar input, .search-bar select { color: var(--text); background: #fff; }

/* Zone de recherche réduite (les bannières prennent le haut de page). */
.hero.hero-compact { padding: 20px 26px; margin-bottom: 18px; }
.hero.hero-compact h1 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); margin: 0 0 4px; }
.hero.hero-compact p { font-size: .88rem; margin-bottom: 12px; }
/* Bannières défilantes. */
.banner-carousel { position: relative; height: clamp(140px, 22vw, 260px); border-radius: var(--radius); overflow: hidden; background: #0b0b2a; margin-bottom: 16px; box-shadow: var(--shadow); }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; pointer-events: none; }
.banner-slide.active { opacity: 1; pointer-events: auto; }
.banner-slide a { display: block; width: 100%; height: 100%; color: inherit; }
.banner-slide img, .banner-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-text { display: grid; place-items: center; height: 100%; color: #fff; font-size: 1.5rem; font-weight: 800; padding: 20px; text-align: center; background: linear-gradient(135deg, var(--brand), var(--secondary)); }
.banner-label { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; padding: 3px 8px; border-radius: 999px; }
.banner-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.banner-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.banner-dots button.active { background: #fff; width: 22px; border-radius: 6px; }
/* Type d'annonce. */
.kind-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.kind-bar button { border: 1px solid var(--border); background: var(--surface); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.kind-bar button.active { border-color: var(--secondary); background: var(--secondary); color: #fff; }
.deal-tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.deal-tag.rent { background: rgba(0,212,170,.16); color: #078a70; }
.deal-tag.sale { background: rgba(58,95,205,.14); color: var(--secondary); }
.deal-tag.search { background: rgba(245,166,35,.18); color: #a86a00; }
/* Fiche : titre et description de l'annonce. */
.detail-title { font-weight: 700; margin: 6px 0 0; }
.detail-desc { margin-top: 18px; }
/* Partage dans la messagerie */
.share-chats { display: grid; gap: 6px; max-height: 45vh; overflow: auto; }
.share-chat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); border-radius: 10px; padding: 9px 12px; font: inherit; cursor: pointer; }
.share-chat small { color: var(--muted); }
.card .actions .card-share { padding-left: 10px; padding-right: 10px; }
/* Commentaires sous l'annonce (repliés) */
.cm-box { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.cm-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.cm-toggle .cm-caret { transition: transform .2s; }
.cm-toggle.open .cm-caret { transform: rotate(180deg); }
.cm-panel { margin-top: 10px; display: grid; gap: 8px; }
.cm-item { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.cm-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cm-head small { margin-left: auto; color: var(--muted); }
.cm-item p { margin: 4px 0 2px; white-space: pre-line; line-height: 1.45; }
.cm-actions { text-align: right; }
.cm-actions button { background: none; border: 0; color: var(--muted); font-size: .8rem; cursor: pointer; padding: 2px 4px; }
.cm-empty { color: var(--muted); margin: 4px 0; font-size: .9rem; }
.cm-form { display: flex; gap: 8px; align-items: flex-end; }
.cm-form textarea { flex: 1; min-width: 0; resize: vertical; }
.detail-desc h3 { margin: 0 0 6px; font-size: 1rem; }
.detail-desc p { margin: 0; white-space: pre-line; color: var(--text); line-height: 1.5; }
.search-card .search-title { font-weight: 700; margin: 6px 0 4px; }
.search-card .search-desc { color: var(--muted); font-size: .88rem; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.conversions { color: var(--muted); font-size: .82rem; margin: 6px 0 0; text-align: center; }
.escrow-info .esc-total { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }

/* Mises en avant (Vol. 04 §8). */
.card.featured { box-shadow: 0 0 0 2px #00D4AA, var(--shadow); }
.boost-badge { position: absolute; bottom: 10px; left: 10px; z-index: 2; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; color: #fff; }
.boost-badge.heart { background: linear-gradient(135deg, #e53935, #f06292); }
.boost-badge.top { background: var(--brand); }
.recommended { margin: 0 0 16px; }
.recommended h3 { margin: 0 0 8px; font-size: 1rem; }
.recommended-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.recommended-card { position: relative; min-width: 200px; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid #F5A623; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.recommended-card small { color: var(--muted); }
.recommended-card .vip { position: absolute; top: 8px; right: 8px; font-size: .65rem; font-weight: 800; background: #F5A623; color: #fff; padding: 2px 6px; border-radius: 6px; }
.popup-tag { margin: 0 0 10px; font-weight: 800; color: #a86a00; }

/* Encart publicitaire dans la grille, pop-up interstitiel. */
.grid-ad { grid-column: 1 / -1; }
.grid-ad .ad-campaign { margin: 0; }
.ad-popup { position: relative; width: min(100%, 520px); text-align: center; }
.ad-popup img, .ad-popup video { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 10px; display: block; margin: 8px 0; }
.ad-popup-close { position: absolute; top: 8px; right: 8px; border: 0; background: rgba(0,0,0,.6); color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }

/* Messages vocaux dans la discussion avec l'agence */
.chat-mic { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 0 12px; cursor: pointer; font: inherit; font-size: 1.05rem; white-space: nowrap; }
.chat-mic.recording { background: #E53935; color: #fff; border-color: #E53935; font-size: .9rem; }
.voice-note { display: block; margin: 4px 0; }
.voice-note audio, .voice-chip audio { max-width: 240px; height: 34px; vertical-align: middle; }
.chat-voice-pending:empty { display: none; }
.chat-voice-pending { padding: 6px 14px 0; }
.voice-chip { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(11,11,226,.06); border-radius: 10px; padding: 6px 10px; font-size: .85rem; }
.voice-chip button { border: 0; background: none; cursor: pointer; font-size: 1rem; }

.voice-level { width: 60px; height: 8px; border-radius: 4px; background: rgba(0,0,0,.1); overflow: hidden; align-self: center; }
.voice-level span { display: block; height: 100%; width: 0; background: #1BA97B; transition: width .08s; }
.voice-row { display: flex; align-items: center; gap: 6px; }
.voice-del { border: 0; background: rgba(0,0,0,.08); border-radius: 8px; cursor: pointer; padding: 4px 7px; }
.voice-del:hover { background: rgba(229,57,53,.2); }
.voice-removed { display: block; font-size: .8rem; opacity: .7; font-style: italic; }

/* Image standard des recherches (agences et particuliers) */
.card .photo.search-photo { background: #0B0BE2 url("recherche.svg") center / cover no-repeat; }

/* Annonce partagée dans une discussion */
.chat-listing { display: flex; gap: 10px; margin: 6px 0; background: rgba(255,255,255,.9); color: var(--text, #1d2433); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; max-width: 340px; }
.chat-listing-photo { width: 96px; min-height: 80px; background: #0B0BE2 center / cover no-repeat; flex-shrink: 0; }
.chat-listing-body { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 8px 0; }
.chat-listing-body small { color: var(--muted); }
.chat-listing-body .btn { align-self: flex-start; }

/* Titre de carte : lien vers la page de l'annonce (lisible par Google). */
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { text-decoration: underline; }


/* ---------- À la une ---------- */
.une-strip { margin: 0 0 22px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #FFF8E6, #FFFDF6); border: 1px solid #F5D98A; }
.une-strip h3 { margin: 0 0 12px; color: #8A5A00; }
.une-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 300px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.une-list > .card { scroll-snap-align: start; }
/* La bande défile dans sa largeur : elle ne doit jamais élargir la page (téléphone). */
.home-layout > *, .home-main { min-width: 0; }
.une-strip { max-width: 100%; overflow: hidden; }
.une-list { scroll-behavior: smooth; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 760px) {
  .une-strip { padding: 12px; }
  .une-list { grid-auto-columns: min(82%, 300px); gap: 10px; }
}
.boost-badge.une { background: #F5C451; color: #3D2A00; top: 12px; bottom: auto; left: 50%; transform: translateX(-50%); box-shadow: 0 2px 8px rgba(0,0,0,.18); white-space: nowrap; }
.card.is-une { box-shadow: 0 0 0 2px #F5C451, 0 10px 26px rgba(245, 196, 81, .25); }

.search-card { position: relative; }
.une-tag { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 2; background: #F5C451; color: #3D2A00; font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.une-note { color: #8A5A00; font-weight: 700; }
.btn.une-btn { background: #FFF4D6; color: #8A5A00; border: 1px solid #F5C451; }
.chk-inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }

/* Téléphone : les menus passent dans la barre de 4 boutons du bas ; en haut, seulement le nom. */
@media (max-width: 760px) {
  .topbar nav { display: none; }
  .topbar { justify-content: center; }
  /* Dans « Mon espace », les sous-onglets sont dans la barre du bas. */
  #content > .seg:has(> [data-tab]) { display: none; }
}

/* Recherche précise (sous la barre de recherche) */
.adv-search { margin-top: 12px; }
.adv-search summary { cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.18); }
.adv-search .adv-n { background: #fff; color: var(--accent); border-radius: 999px; padding: 0 8px; font-size: .85rem; }
.adv-search[open] summary { margin-bottom: 10px; }
.adv-grid { background: var(--surface); color: var(--text, #13203a); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; box-shadow: var(--shadow); }
.adv-grid label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.adv-grid input, .adv-grid select { width: 100%; box-sizing: border-box; }
.adv-checks { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.adv-checks label { display: flex; align-items: center; gap: 6px; color: var(--text, #13203a); font-weight: 500; font-size: .9rem; }
.adv-checks input { width: auto; }
.adv-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.adv-actions .btn.ghost { color: #fff; border-color: rgba(255,255,255,.6); }
@media (max-width: 760px) { .adv-grid { grid-template-columns: 1fr 1fr; } }

/* Écran « Rechercher » : un champ par critère */
.search-page { max-width: 880px; margin: 0 auto; }
.sp-form { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.sp-field { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.sp-field input, .sp-field select { width: 100%; box-sizing: border-box; font-size: 1rem; }
.sp-field.full, .sp-actions.full { grid-column: 1 / -1; }
.sp-label { font-size: .85rem; }
.sp-kind { margin: 0; }
.sp-checks { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text, #13203a); font-weight: 500; }
.sp-checks label { display: flex; align-items: center; gap: 6px; }
.sp-checks input { width: auto; }
.sp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sp-go { flex: 1; min-height: 48px; font-size: 1.05rem; }
.sp-go:disabled { opacity: .6; cursor: default; }
/* Rappel des critères sous la barre de l'accueil (une ligne) */
.criteria-line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; font-size: .9rem; }
.criteria-line > span { font-weight: 600; }
.hero .criteria-line .link-btn { color: #fff; font-size: .9rem; padding: 0; }
@media (max-width: 760px) {
  /* Deux champs par ligne : je cherche | type, pays | ville, quartier seul, pièces | budget… */
  .sp-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; gap: 10px; }
  .sp-form .sp-wide { grid-column: 1 / -1; }
  .sp-field { gap: 4px; font-size: .78rem; }
  .sp-field input, .sp-field select { font-size: .95rem; padding: 9px 10px; min-width: 0; }
}

/* ---------- Cartes d'annonces moins hautes (agence et référence dans « Détails ») ---------- */
.card .photo { height: 132px; padding: 10px; }
.card .body { padding: 10px 12px 12px; gap: 3px; }
.card .body h3 { font-size: 1rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .body .meta { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .body .price { font-size: 1.05rem; margin-top: 2px; }
.card .body .actions { margin-top: 6px; }
.card .body .actions .btn { flex: 1; padding-left: 6px; padding-right: 6px; }
.home-main > .criteria-line { margin: 0 0 10px; }
@media (max-width: 640px) { .card .photo { height: 120px; } .grid { gap: 12px; } }
.home-main .criteria-line .link-btn { color: var(--brand); font-weight: 600; padding: 0; background: none; border: 0; cursor: pointer; font-size: .9rem; }
@media (max-width: 640px) {
  .home-main > .criteria-line { font-size: .82rem; margin-bottom: 8px; }
  .home-main .criteria-line .link-btn { font-size: .82rem; text-align: left; }
  .scope-bar { margin-bottom: 8px; }
  .scope-bar .seg { display: flex; flex-wrap: nowrap; width: 100%; }
  .scope-bar .seg button { flex: 1; padding: 7px 8px; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kind-bar { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin-bottom: 8px; scrollbar-width: none; }
  .kind-bar::-webkit-scrollbar { display: none; }
  .kind-bar button { flex: none; padding: 6px 12px; font-size: .84rem; }
  .home-main > div[style*="space-between"] { margin-bottom: 8px !important; }
  .home-main > div[style*="space-between"] h2 { font-size: 1rem; }
  .home-main > div[style*="space-between"] small { display: none; }
}

.bubble .msg-link { color: inherit; text-decoration: underline; word-break: break-all; }

/* Contours des petits boutons d'action (favori, j'aime, partager, détails…) : vert de la charte, trait seulement. */
.card .actions .btn.ghost, .card .actions .btn.secondary { border: 1.5px solid #1BA97B; }
.card .photo .fav, .card .photo .heart { border: 1.5px solid #1BA97B; }
.detail-side .btn.ghost, .detail-side .btn.secondary { border-color: #1BA97B; }
