/* ── Tokens de design ──────────────────────────────────────────────────────── */
:root {
  --blue:        #2563eb;
  --blue-light:  #eff6ff;
  --blue-dark:   #1d4ed8;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-600:    #4b5563;
  --gray-800:    #1f2937;
  --text:        #1f2937;
  --text-muted:  #6b7280;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-md:   0 8px 24px rgba(0,0,0,.10);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html { font-size: 17px; }   /* +1px vs Bulma default pour les seniors */

body {
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.lbe-navbar {
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.lbe-brand {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-800) !important;
  gap: 8px;
  display: flex;
  align-items: center;
}
.lbe-brand strong { color: var(--blue); }
.lbe-brand-icon { display: flex; align-items: center; }

/* ── Hero (homepage) ──────────────────────────────────────────────────────── */
.lbe-hero {
  background: #1e3a5f;
  padding: 3rem 1.5rem 3.5rem;
}
.lbe-hero-title {
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.lbe-hero-subtitle {
  font-size: 1rem;
  color: #93b8d8;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* ── Barre de recherche principale ───────────────────────────────────────── */
.lbe-search-bar {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}
.lbe-search-bar .input {
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,.3);
  background: #fff;
  padding-left: 1.4rem;
  padding-right: 130px;
  height: 3.2rem;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  transition: border-color .2s, box-shadow .2s;
}
.lbe-search-bar .input:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
  outline: none;
}
.lbe-search-bar .button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50px;
  height: 2.6rem;
  padding: 0 1.3rem;
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 600;
}
.lbe-search-bar .button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

/* Autocomplete dropdown */
.lbe-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.lbe-suggestion-item {
  padding: .8rem 1.2rem;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  font-size: .95rem;
  transition: background .15s;
}
.lbe-suggestion-item:last-child { border-bottom: none; }
.lbe-suggestion-item:hover,
.lbe-suggestion-item.is-active { background: var(--blue-light); }
.lbe-suggestion-type {
  font-size: .75rem;
  color: var(--text-muted);
  margin-left: .4rem;
}

/* Filtres rapides (chips) — version hero sombre */
.lbe-chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.25rem; }
.lbe-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .85rem;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 50px;
  font-size: .85rem;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.1);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .2s;
}
.lbe-chip:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.18); }
.lbe-chip-geo  { border-color: rgba(255,255,255,.5); color: #fff; background: rgba(255,255,255,.15); }
.lbe-chip-geo:hover { background: rgba(255,255,255,.25); border-color: #fff; }

/* ── KPI strip ────────────────────────────────────────────────────────────── */
.lbe-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #f8fafc;
  border-bottom: 1px solid var(--gray-200);
}
.lbe-kpi-strip-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.4rem 1rem;
  border-right: 1px solid var(--gray-200);
}
.lbe-kpi-strip-item:last-child { border-right: none; }
.lbe-kpi-strip-n { font-size: 1.6rem; font-weight: 700; color: #1e3a5f; line-height: 1; }
.lbe-kpi-strip-l { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; text-align: center; }

/* ── Section géographie ───────────────────────────────────────────────────── */
.lbe-geo-section { padding: 2.5rem 0 3rem; }
.lbe-geo-title { font-size: 1.15rem; font-weight: 600; color: var(--gray-800); margin-bottom: 1.25rem; }

.lbe-region-tabs {
  display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.5rem;
  overflow-x: auto; scrollbar-width: none;
}
.lbe-region-tabs::-webkit-scrollbar { display: none; }
.lbe-region-tab {
  padding: .4rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 50px;
  font-size: .82rem;
  background: #fff;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.lbe-region-tab:hover { border-color: var(--blue); color: var(--blue); }
.lbe-region-tab.is-active { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }

.lbe-dept-grid-geo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.lbe-dept-geo-card {
  display: block;
  padding: .85rem .9rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.lbe-dept-geo-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); color: var(--text); }
.lbe-dept-geo-code { font-size: 1.25rem; font-weight: 700; color: #1e3a5f; line-height: 1; }
.lbe-dept-geo-name { font-size: .78rem; color: var(--text-muted); margin: .25rem 0 .55rem; line-height: 1.3; }
.lbe-dept-geo-bar-track { background: var(--gray-100); border-radius: 4px; height: 4px; overflow: hidden; }
.lbe-dept-geo-bar { height: 4px; background: var(--blue); border-radius: 4px; }
.lbe-dept-geo-nb { font-size: .75rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Système de filtres (listing + recherche) ────────────────────────────── */
.lbe-filters {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.lbe-filter-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.lbe-filter-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  min-width: 90px;
}
.lbe-chip-filter {
  display: inline-flex; align-items: center;
  padding: .3rem .75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 50px;
  font-size: .82rem;
  color: var(--gray-600);
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
  user-select: none;
}
.lbe-chip-filter:hover    { border-color: var(--blue); color: var(--blue); }
.lbe-chip-filter.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.lbe-chip-reset { border-color: #dc2626; color: #dc2626; }
.lbe-chip-reset:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ── Section top départements (listing, conservé pour compat) ─────────────── */
.lbe-dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.lbe-dept-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.lbe-dept-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
  color: var(--blue);
}
.lbe-dept-code {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .05em;
}
.lbe-dept-name { font-weight: 600; font-size: .95rem; }
.lbe-dept-count { font-size: .8rem; color: var(--text-muted); }

/* ── Cards EHPAD (listes, résultats) ──────────────────────────────────────── */
.lbe-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 1.25rem 1.5rem;
  transition: box-shadow .2s, transform .15s;
}
.lbe-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lbe-card-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); }
.lbe-card-meta  { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; }
.lbe-card-price { font-size: 1.4rem; font-weight: 700; color: var(--blue); }
.lbe-card-price-label { font-size: .8rem; color: var(--text-muted); }

/* Badge spécialité */
.lbe-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.lbe-badge-alzheimer { background: #fef3c7; color: #92400e; }
.lbe-badge-phv       { background: #dbeafe; color: #1e40af; }
.lbe-badge-ash       { background: #dcfce7; color: #14532d; }
.lbe-badge-temp      { background: #f3e8ff; color: #581c87; }

/* ── Fiche EHPAD ──────────────────────────────────────────────────────────── */
.lbe-fiche-header {
  background: var(--gray-50);
  border-bottom: none;
  padding: 1.5rem 0 1rem;
}
#map-fiche {
  height: 300px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}
.lbe-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.lbe-price-cell {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.lbe-price-cell-value { font-size: 1.5rem; font-weight: 700; color: var(--blue); }
.lbe-price-cell-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Fiche EHPAD — prix hero ─────────────────────────────────────────────── */
.lbe-price-hero {
  background: #1e3a5f;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  min-width: 220px;
  text-align: center;
}
.lbe-price-hero-label { font-size: .8rem; color: #93b8d8; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .35rem; }
.lbe-price-hero-amount { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.lbe-price-hero-unit { font-size: .85rem; color: #93b8d8; margin-top: .2rem; }
.lbe-price-hero-delta {
  display: inline-block;
  margin-top: .75rem;
  padding: .25rem .7rem;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
}
.lbe-price-hero-delta.is-above { background: rgba(220,38,38,.2); color: #fca5a5; }
.lbe-price-hero-delta.is-below { background: rgba(22,163,74,.2); color: #86efac; }
.lbe-price-hero-date { font-size: .72rem; color: #6b93b8; margin-top: .6rem; }

/* ── Fiche EHPAD — type établissement ────────────────────────────────────── */
.lbe-etab-type {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
}

/* ── Fiche EHPAD — prestations groupées ──────────────────────────────────── */
.lbe-prest-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.lbe-prest-group {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lbe-prest-group-title {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: .65rem 1rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-600);
}
.lbe-prest-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: .88rem;
}
.lbe-prest-item:last-child { border-bottom: none; }
.lbe-prest-icon { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; }
.lbe-prest-icon.inclus { background: #dcfce7; color: #15803d; }
.lbe-prest-icon.supplement { background: #dbeafe; color: #1d4ed8; }
.lbe-prest-icon.absent { background: var(--gray-100); color: #9ca3af; }
.lbe-prest-label { flex: 1; }
.lbe-prest-label.inclus { color: var(--text); }
.lbe-prest-label.supplement { color: var(--text); }
.lbe-prest-label.absent { color: var(--text-muted); text-decoration: line-through; }
.lbe-prest-tag { font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 50px; white-space: nowrap; }
.lbe-prest-tag.inclus { background: #dcfce7; color: #15803d; }
.lbe-prest-tag.supplement { background: #dbeafe; color: #1d4ed8; }

/* ── Fiche EHPAD — EHPAD proches ─────────────────────────────────────────── */
.lbe-proche-card {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: .6rem;
}
.lbe-proche-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); color: var(--text); }
.lbe-proche-km {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.2;
}
.lbe-proche-name { font-weight: 600; font-size: .95rem; }
.lbe-proche-ville { font-size: .8rem; color: var(--text-muted); }
.lbe-proche-price { margin-left: auto; text-align: right; flex-shrink: 0; }
.lbe-proche-price-n { font-weight: 700; color: var(--blue); font-size: .95rem; }
.lbe-proche-price-delta { font-size: .72rem; }

/* ── Utilitaires ──────────────────────────────────────────────────────────── */
.lbe-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
}
.lbe-divider { border: none; border-top: 1px solid var(--gray-200); margin: 2rem 0; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.lbe-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 3rem 1.5rem 2rem;
}
.lbe-footer-brand {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: .5rem;
}
.lbe-footer-brand strong { color: var(--blue); }
.lbe-footer-tagline { font-size: .875rem; color: var(--text-muted); line-height: 1.5; }
.lbe-footer-heading { font-weight: 700; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-600); margin-bottom: .6rem; }
.lbe-footer-links { list-style: none; padding: 0; margin: 0; }
.lbe-footer-links li { margin-bottom: .4rem; }
.lbe-footer-links a { color: var(--text-muted); font-size: .875rem; text-decoration: none; }
.lbe-footer-links a:hover { color: var(--blue); }
.lbe-footer-hr { border: none; border-top: 1px solid var(--gray-200); margin: 2rem 0 1rem; }
.lbe-footer-copy { font-size: .8rem; color: var(--text-muted); }
.lbe-footer-copy a { color: var(--text-muted); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .lbe-hero-title { font-size: 1.75rem; }
  .lbe-hero { padding: 2rem 1rem 2.5rem; }
  .lbe-search-bar .input { padding-right: 1.4rem; }
  .lbe-search-bar .button { position: static; transform: none; width: 100%; margin-top: .5rem; border-radius: 50px; }
  .lbe-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .lbe-kpi-strip-item:nth-child(2) { border-right: none; }
  .lbe-dept-grid-geo { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
