/* =====================================================
   Thanatolink — design system
   ===================================================== */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
p  { margin: 0; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.topbar {
  background: var(--card);
  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;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  font-size: 13px;
}

.container { max-width: 1240px; margin: 0 auto; padding: 28px; }
.container-narrow { max-width: 880px; margin: 0 auto; padding: 28px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-tight { padding: 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary { background: white; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: white; color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.field { margin-bottom: 14px; }
.field label, .label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}
.pill-success { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.pill-warning { background: var(--warning-soft); color: var(--warning); border-color: #fde68a; }
.pill-danger  { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.pill-accent  { background: var(--accent-soft); color: var(--accent); border-color: #bfdbfe; }
.pill-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

/* Tables / Lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.list-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }

.thanato-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.15s;
}
.thanato-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.thanato-card.replacement {
  border-style: dashed;
  background: var(--warning-soft);
  border-color: #fde68a;
}
.thanato-card .head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.thanato-card h3 { margin-bottom: 2px; }
.thanato-card .meta { color: var(--muted); font-size: 13px; }
.thanato-card .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.thanato-card .actions { display: flex; gap: 8px; margin-top: 4px; }
.thanato-card a.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: white;
}
.thanato-card a.contact-link:hover { background: var(--bg); }

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  display: grid; place-items: center;
  font-weight: 600; color: var(--accent);
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* Hero / Auth */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 880px) { .auth-shell { grid-template-columns: 1fr; } }
.auth-side {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-side h1 { font-size: 36px; line-height: 1.2; margin-bottom: 16px; }
.auth-side p.lede { font-size: 16px; opacity: 0.78; max-width: 420px; }
.auth-side .features { display: grid; gap: 14px; margin-top: 36px; }
.auth-side .features .feat {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.auth-side .features svg { flex-shrink: 0; opacity: 0.9; }
.auth-side .features b { display: block; margin-bottom: 2px; font-weight: 600; }
.auth-side .features span { opacity: 0.7; font-size: 13px; }
.auth-side .footer { font-size: 12px; opacity: 0.5; }

.auth-form-wrap {
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-form-wrap .inner { max-width: 380px; width: 100%; margin: 0 auto; }
.role-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.role-tile {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  background: white;
  font-size: 13px;
}
.role-tile:hover { border-color: var(--border-strong); }
.role-tile.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.role-tile b { display: block; font-size: 14px; margin-bottom: 2px; color: var(--text); }
.role-tile.active b { color: var(--accent); }
.role-tile .icon { margin-bottom: 6px; display: inline-flex; }

/* Calendar */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar .dow {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  padding: 6px 0;
}
.day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  user-select: none;
  background: white;
  border-color: var(--border);
}
.day:hover { border-color: var(--accent); }
.day.muted { color: var(--muted-2); background: transparent; border-color: transparent; }
.day.muted:hover { border-color: var(--border); }
.day.unavailable { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.day.special      { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.day.today { font-weight: 700; box-shadow: 0 0 0 2px var(--accent) inset; }

.cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month {
  font-weight: 600;
  font-size: 15px;
  text-transform: capitalize;
}

/* Map */
#map, #zone-map { height: 460px; border-radius: var(--radius); border: 1px solid var(--border); z-index: 0; }
#search-map { height: 360px; }

/* Sidebar layout */
.dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 60px);
}
.sidebar {
  background: white;
  border-right: 1px solid var(--border);
  padding: 22px 16px;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 2px;
}
.sidebar .nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.sidebar .nav-item.active { background: var(--accent-soft); color: var(--accent); }
.dashboard-main { padding: 28px 32px; min-width: 0; }

@media (max-width: 880px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dashboard-main { padding: 20px; }
}

/* Filter chips */
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-row .field { margin-bottom: 0; min-width: 160px; flex: 1; }
.filter-row .field-actions { display: flex; gap: 8px; }

.specialty-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.specialty-tag.removable { padding-right: 6px; cursor: default; }
.specialty-tag .x {
  cursor: pointer;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 10px;
}
.specialty-tag .x:hover { background: rgba(37, 99, 235, 0.15); }

/* Empty states */
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
}
.empty .icon { font-size: 36px; margin-bottom: 10px; opacity: 0.6; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin-bottom: 6px; }
.modal .modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 18px;
}

/* Toast */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--text);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.25s ease;
  max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Section headings within dashboard */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title h2 { margin-bottom: 2px; }
.section-title p  { color: var(--muted); font-size: 14px; }

.legend {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }

.zone-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}
.zone-list-item + .zone-list-item { margin-top: 8px; }
.zone-list-item .info { display: flex; align-items: center; gap: 10px; }
.zone-list-item .info .badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
  color: var(--muted);
}
.zone-list-item .info .badge.region { background: #ede9fe; color: #6d28d9; }
.zone-list-item .info .badge.gps { background: var(--accent-soft); color: var(--accent); }
.zone-list-item .info .badge.polygon { background: var(--success-soft); color: var(--success); }

/* Search results header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 12px;
}
.results-count { font-weight: 600; }
.results-count span { color: var(--muted); font-weight: 400; }

/* Misc */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

.scroll-area { max-height: 540px; overflow-y: auto; padding-right: 6px; }

/* Bandeau défilant d'avis (landing) */
.reviews-marquee {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 22px 0 26px;
  overflow: hidden;
}
.marquee-header { text-align: center; margin-bottom: 14px; padding: 0 16px; }
.marquee-title {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.marquee-viewport { overflow: hidden; position: relative; }
.marquee-viewport::before,
.marquee-viewport::after {
  content: ''; position: absolute; top: 0; bottom: 0;
  width: 60px; z-index: 2; pointer-events: none;
}
.marquee-viewport::before { left: 0;  background: linear-gradient( 90deg, #0f172a, transparent); }
.marquee-viewport::after  { right: 0; background: linear-gradient(-90deg, #0f172a, transparent); }
.marquee-track {
  display: inline-flex; gap: 18px;
  animation: marquee 90s linear infinite;
  padding: 0 12px;
}
.marquee-track:hover { animation-play-state: paused; }
.review-mini {
  flex: 0 0 auto;
  min-width: 320px; max-width: 380px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 16px;
  border-radius: 10px;
  color: white;
  white-space: normal;
  font-size: 13px;
}
.review-mini .stars { color: #f59e0b; letter-spacing: 1px; font-size: 13px; }
.review-mini .quote { color: rgba(255,255,255,0.85); margin: 6px 0 8px; line-height: 1.45; font-style: italic; }
.review-mini .who   { color: rgba(255,255,255,0.55); font-size: 12px; }
.review-mini .who b { color: rgba(255,255,255,0.9); font-style: normal; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (max-width: 600px) {
  .review-mini { min-width: 270px; max-width: 320px; }
}

/* ============================================================
   RESPONSIVE — adaptations mobile et tablette
   ============================================================ */

/* Tablettes & petits écrans (≤ 880px) — sidebar devient barre horizontale */
@media (max-width: 880px) {
  /* La sidebar latérale devient une barre d'onglets horizontale en haut */
  .dashboard {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: flex !important;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 6px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .sidebar h4,
  .sidebar > div:not([class]),
  .sidebar > div[style*="margin-top"] { display: none; }
  .sidebar .nav-item {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
  }
  .sidebar .nav-item svg { width: 14px; height: 14px; }
  .dashboard-main {
    padding: 16px;
  }

  /* Topbar plus compact */
  .topbar { padding: 10px 14px; }
  .brand { font-size: 15px; }
  .brand-mark { width: 26px; height: 26px; font-size: 12px; }
  .user-chip {
    padding: 4px 10px;
    font-size: 12px;
    gap: 4px;
    max-width: 50vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-chip > span:nth-child(2),
  .user-chip > span:nth-child(3) { display: none; } /* Cacher le rôle, garder juste le nom */

  /* Formulaires : .row passe en colonne */
  .row { flex-direction: column; gap: 8px; }
  .row > * { width: 100%; }

  /* Filtres de recherche : empilage propre */
  .filter-row { flex-direction: column; gap: 10px; }
  .filter-row .field { min-width: 0; width: 100%; flex: none; }
  .filter-row .field-actions {
    width: 100%;
    justify-content: stretch;
  }
  .filter-row .field-actions .btn {
    flex: 1;
  }

  /* Cartes Leaflet plus courtes */
  #map, #zone-map, #search-map { height: 320px; }

  /* Card padding réduit */
  .card { padding: 16px; }
  .card-tight { padding: 12px; }

  /* Section title : taille réduite */
  .section-title h2 { font-size: 19px; }
  .section-title p { font-size: 13px; }

  /* Auth shell : la partie sombre devient plus compacte */
  .auth-side { padding: 36px 28px; }
  .auth-side h1 { font-size: 26px; }
  .auth-side .features { display: none; } /* gain de hauteur sur mobile */
  .auth-form-wrap { padding: 36px 24px; }

  /* Tabs */
  .tab { padding: 9px 12px; font-size: 13px; }

  /* Comptes démo : 1 colonne au lieu de 3 sur petit écran */
  #panel-login .grid[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Sélecteur de rôle : 1 colonne au lieu de 3 */
  .role-select[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Modal : padding réduit, plus haut sur écran */
  .modal { padding: 20px; max-height: 92vh; }
  .modal h2 { font-size: 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }

  /* Booking modal : grille interventions en 1 colonne sur petit écran */
  #bk-interventions { grid-template-columns: 1fr !important; }

  /* Calendrier : cellules plus petites mais lisibles */
  .calendar { gap: 2px; }
  .day { font-size: 12px; }

  /* Cartes thanato dans résultats : padding interne réduit */
  .thanato-card { padding: 14px; }
  .thanato-card .head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .thanato-card .head .pill { align-self: flex-start; }

  /* Liens contact : plein largeur empilés */
  .thanato-card .actions { flex-direction: column; align-items: stretch; }
  .thanato-card a.contact-link {
    justify-content: center;
    padding: 9px 12px;
  }

  /* Avis modal : un peu plus compact */
  .filter-tiles { grid-template-columns: 1fr; }
}

/* Très petits écrans (≤ 480px — iPhone SE et similaires) */
@media (max-width: 480px) {
  body { font-size: 13px; }
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  h3 { font-size: 16px; }

  .topbar { padding: 8px 10px; }
  .brand span { font-size: 14px; }
  .container, .container-narrow, .dashboard-main { padding: 12px; }

  /* Cible tactile minimum 44px pour les boutons */
  .btn { min-height: 40px; padding: 9px 14px; }
  .btn-sm { min-height: 34px; padding: 7px 12px; font-size: 12px; }

  /* Inputs : police 16px pour éviter le zoom auto sur iOS */
  input[type=text], input[type=email], input[type=password], input[type=tel],
  input[type=date], input[type=number], select, textarea {
    font-size: 16px;
  }

  /* Suggestions ville : prendre toute la largeur */
  .ville-suggestions { font-size: 14px; }
  .ville-suggestion { padding: 11px 12px; }

  /* Cartes Leaflet : encore plus courtes */
  #map, #zone-map, #search-map { height: 260px; }

  /* Bandeau reviews : ne montrer qu'une carte à la fois pour lisibilité */
  .review-mini { min-width: 240px; max-width: 280px; padding: 10px 12px; }
}

/* Préférence orientation paysage sur petits téléphones — sidebar normale */
@media (max-width: 880px) and (orientation: landscape) and (min-width: 700px) {
  /* Suffisamment de largeur, on garde la mise horizontale par défaut */
}

/* Critères actifs — tuiles en grille */
.filter-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.filter-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.filter-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
}
.filter-tile-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Autocomplete ville */
.ville-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-strong);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}
.ville-suggestion {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.ville-suggestion:last-child { border-bottom: none; }
.ville-suggestion:hover { background: var(--accent-soft); }
.ville-suggestion b { color: var(--text); margin-right: 6px; }
.ville-suggestion span { color: var(--muted); font-size: 12px; }
.ville-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
