/* ============================================================
   FGCL — Recherche de biens
   Feuille de style partagée (accueil + résultats)
   Palette alignée sur le logo SRC/DRC Cameroun (turquoise + vert /
   rouge / jaune du drapeau). Structure extraite des maquettes Figma.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&display=swap');

:root {
  /* --- Couleurs de base (échantillonnées sur les maquettes) --- */
  --bg: #e6f2f3;
  --bg-decor: #d5eaec;
  --panel: #ffffff;
  --sidebar-bg: #fcfcfc;

  --ink: #1b1a1a;
  --ink-soft: #636363;
  --ink-faint: #9aa0ab;

  --accent: #007a89;
  --accent-dark: #005663;
  --accent-soft: #dcf0f2;
  --accent-soft-border: #a8d5db;

  --line: #e8eaef;

  --input-bg: #f9f9f9;
  --btn-secondary-bg: #f5f5f5;

  --badge-green-bg: #e8f8f0;
  --badge-green-text: #1f8a55;
  --badge-red-bg: #fbe9e9;
  --badge-red-text: #e02424;
  --badge-amber-bg: #fdf3e3;
  --badge-amber-text: #b7791f;

  --pin-red: #c30d0d;
  --danger: #c0392b;

  /* --- Couleurs du drapeau reprises dans le logo SRC/DRC Cameroun --- */
  --flag-green: #007850;
  --flag-red: #d01828;
  --flag-yellow: #f8d018;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 14px 34px rgba(0, 86, 99, 0.12);
  --shadow-popover: 0 20px 48px rgba(0, 60, 68, 0.18);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select { font-family: inherit; }

/* ============================================================
   Décor de fond (grands cercles pastel, communs aux deux pages)
   ============================================================ */

.bg-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.bg-decor span {
  position: absolute;
  border-radius: 50%;
  background: var(--bg-decor);
}

.bg-decor .circle-tr { width: 340px; height: 340px; top: -140px; right: -120px; }
.bg-decor .circle-bl { width: 420px; height: 420px; bottom: -220px; left: -160px; }
.bg-decor .circle-bl-small { width: 130px; height: 130px; bottom: 40px; left: 40px; opacity: 0.8; }

/* ============================================================
   En-tête : avatar utilisateur (statique, démo)
   ============================================================ */

.topbar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 28px 48px 0;
}

.add-property-btn {
  padding: 11px 22px;
  font-size: 13.5px;
  text-decoration: none;
}

.add-property-btn svg { width: 16px; height: 16px; }

.user-chip-wrap { position: relative; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.user-chip:hover { opacity: 0.75; }

.user-chevron {
  display: flex;
  color: var(--ink-faint);
  transition: transform 0.18s ease;
}

.user-chevron svg { width: 16px; height: 16px; }

.user-chip[aria-expanded="true"] .user-chevron { transform: rotate(180deg); }

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 8px;
  min-width: 220px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

.user-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-menu-header {
  padding: 8px 10px 10px;
}

.user-menu-name {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.user-menu-email {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  word-break: break-all;
}

.user-menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px 6px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 8px;
  transition: background 0.12s ease, color 0.12s ease;
}

.user-menu-item svg { width: 16px; height: 16px; }

.user-menu-item:hover { background: var(--badge-red-bg); color: var(--badge-red-text); }

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ============================================================
   Champs de recherche / filtres — éléments communs
   ============================================================ */

.search-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--input-bg);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 22px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-pill:focus-within {
  border-color: var(--accent-soft-border);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-pill svg { width: 19px; height: 19px; color: var(--ink-faint); flex-shrink: 0; }

.search-pill input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15.5px;
  color: var(--ink);
  padding: 14px 4px;
  min-width: 0;
}

.search-pill input::placeholder { color: #b3b7c0; }

.icon-round-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--btn-secondary-bg);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-round-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft-border); }
.icon-round-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft-border); }
.icon-round-btn svg { width: 18px; height: 18px; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 15px 34px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-pill:hover { background: var(--accent-dark); }
.btn-pill:active { transform: scale(0.98); }
.btn-pill:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-pill-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent-soft-border);
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-pill-outline:hover { background: var(--accent-soft); }

/* --- Champs de formulaire (selects, inputs texte/date) --- */

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.field-control {
  width: 100%;
  padding: 11px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}

.field-control:focus {
  border-color: var(--accent-soft-border);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select.field-control {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636363' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 34px;
  cursor: pointer;
}

.field-control.date-input { position: relative; }

.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.toggle-btn:hover { border-color: var(--accent-soft-border); }

.toggle-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-soft-border);
  color: var(--accent);
}

.range-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.range-value-pill {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  outline: none;
  margin: 8px 0 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 122, 137, 0.35);
  cursor: pointer;
  margin-top: -7px;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 122, 137, 0.35);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--range-fill, 0%), var(--line) var(--range-fill, 0%), var(--line) 100%);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-green { background: var(--badge-green-bg); color: var(--badge-green-text); }
.badge-red { background: var(--badge-red-bg); color: var(--badge-red-text); }
.badge-amber { background: var(--badge-amber-bg); color: var(--badge-amber-text); }

/* ============================================================
   Icônes (traits, cohérentes avec le reste de l'app FGCL)
   ============================================================ */

.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================================
   Toast (repris du formulaire FGCL, même look)
   ============================================================ */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-dark);
  color: #fff;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateX(16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 500;
}

.toast.show { opacity: 1; transform: translateX(0); }

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

/* ============================================================
   Modal générique (overlay) — utilisé par l'itinéraire
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 45, 52, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2000;
}

.modal-overlay.show { opacity: 1; pointer-events: auto; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #eaf4f5;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn.btn-close:hover { background: var(--badge-red-bg); color: var(--badge-red-text); }

@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { animation: spin 0.8s linear infinite; display: inline-flex; }

/* ============================================================
   Marque : logo SRC / DRC Cameroun + liseré tricolore
   ============================================================ */

.brand-logo {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 86, 99, 0.20);
  user-select: none;
  -webkit-user-drag: none;
}

/* Liseré vert / rouge / jaune (couleurs du drapeau, comme l'arc du logo) */
.flag-bar {
  display: flex;
  height: 5px;
}

.flag-bar span { flex: 1; }
.flag-bar span:nth-child(1) { background: var(--flag-green); }
.flag-bar span:nth-child(2) { background: var(--flag-red); }
.flag-bar span:nth-child(3) { background: var(--flag-yellow); }

/* ============================================================
   Utilitaires
   ============================================================ */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}