/* =========================================================
   AdamAgri — CSS principal
   ========================================================= */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-50:  #f0fdf4;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;
  --red-600:   #dc2626;
  --red-50:    #fef2f2;
  --amber-500: #f59e0b;
  --amber-50:  #fffbeb;
  --blue-600:  #2563eb;
  --blue-50:   #eff6ff;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --font: 'Poppins', system-ui, -apple-system, Arial, sans-serif;
}

/* ── Material Symbols ────────────────────────────────────── */
.ms {
  font-family: 'Material Symbols Rounded', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: inherit;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  user-select: none;
}
.ms-outline { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.ms-lg   { font-size: 28px; }
.ms-xl   { font-size: 36px; }
.ms-2xl  { font-size: 48px; }
.ms-sm   { font-size: 18px; }
.ms-xs   { font-size: 14px; }

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Poppins', system-ui, sans-serif; background: var(--slate-50); color: var(--slate-900); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}
.navbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.navbar__brand { display: flex; align-items: center; gap: 10px; }
.navbar__logo {
  width: 34px; height: 34px; background: var(--green-600);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; color: var(--white); font-weight: 900; font-size: 16px;
}
.navbar__name { font-weight: 800; font-size: 18px; color: var(--slate-900); letter-spacing: -.3px; }
.navbar__links { display: flex; align-items: center; gap: 4px; }
.navbar__link {
  font-size: 14px; font-weight: 500; color: var(--slate-600);
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.navbar__link:hover { background: var(--slate-100); color: var(--slate-900); }
.navbar__link--active { color: var(--green-700); font-weight: 600; background: var(--green-50, #f0fdf4); }
.navbar__link--btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* Dropdown compte */
.navbar__dropdown { position: relative; }
.navbar__dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border: 1px solid var(--slate-200);
  border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,.12));
  min-width: 200px; padding: 6px; z-index: 200;
}
.navbar__dropdown-menu--open { display: block; }
.navbar__dropdown-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--slate-700);
  padding: 8px 10px; border-radius: var(--radius-sm);
  transition: background .12s; background: none; border: none; cursor: pointer;
  text-decoration: none; width: 100%;
}
.navbar__dropdown-item:hover { background: var(--slate-100); color: var(--slate-900); }
.navbar__dropdown-item--danger { color: #dc2626; }
.navbar__dropdown-item--danger:hover { background: #fef2f2; color: #dc2626; }

/* Séparateur navbar */
.navbar__sep { width: 1px; height: 20px; background: var(--slate-200); display: inline-block; margin: 0 6px; }

/* Burger mobile */
.navbar__burger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm); color: var(--slate-700);
}
.navbar__burger:hover { background: var(--slate-100); }

/* ── Mega trigger wrapper ─────────────────────────────── */
.mega-trigger { position: static; }

/* ── Overlay (fond sombre derrière le mega) ───────────── */
.mega-overlay {
  display: none; position: fixed; inset: 0; top: 60px;
  background: rgba(0,0,0,.35); z-index: 90; backdrop-filter: blur(2px);
}
.mega-overlay--visible { display: block; }

/* ── Mega menu ────────────────────────────────────────── */
.mega-menu {
  display: none; position: fixed; left: 0; right: 0; top: 60px;
  background: var(--white); border-bottom: 1px solid var(--slate-200);
  box-shadow: 0 20px 60px rgba(0,0,0,.12); z-index: 95;
  max-height: calc(100vh - 80px); overflow-y: auto;
}
.mega-menu--open { display: block; animation: megaSlide .18s ease; }
@keyframes megaSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mega-menu__inner { padding: 28px 0 0; }

/* En-tête */
.mega-menu__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--slate-100);
}
.mega-menu__title { font-size: 18px; font-weight: 800; color: var(--slate-900); margin-bottom: 2px; }
.mega-menu__subtitle { font-size: 12px; color: var(--slate-400); }

/* Grille des catégories */
.mega-menu__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px 24px;
  margin-bottom: 0;
}
.mega-menu__col { padding: 8px 0 12px; }
.mega-menu__cat-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--slate-900);
  padding: 6px 8px; border-radius: var(--radius-sm);
  margin-bottom: 4px; transition: background .12s;
}
.mega-menu__cat-title:hover { background: var(--green-50, #f0fdf4); color: var(--green-700); }
.mega-menu__cat-title .ms { color: var(--green-600); font-size: 18px; }
.mega-menu__subs { list-style: none; padding-left: 32px; }
.mega-menu__subs li { margin-bottom: 1px; }
.mega-menu__sub-link {
  display: block; font-size: 12px; color: var(--slate-500);
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
}
.mega-menu__sub-link:hover { color: var(--green-700); background: var(--green-50, #f0fdf4); }
.mega-menu__sub-more { color: var(--green-600); font-weight: 600; }

/* Bande du bas */
.mega-menu__footer {
  display: flex; gap: 2px;
  background: var(--slate-50, #f8fafc);
  border-top: 1px solid var(--slate-100);
  margin-top: 16px; padding: 0;
}
.mega-menu__footer-link {
  display: flex; align-items: center; gap: 12px;
  flex: 1; padding: 16px 20px;
  color: var(--slate-700); font-size: 13px;
  transition: background .15s;
  border-right: 1px solid var(--slate-100);
}
.mega-menu__footer-link:last-child { border-right: none; }
.mega-menu__footer-link:hover { background: var(--slate-100); }
.mega-menu__footer-link .ms { font-size: 22px; color: var(--green-600); flex-shrink: 0; }
.mega-menu__footer-link small { font-size: 11px; color: var(--slate-400); display: block; margin-top: 1px; }
.mega-menu__footer-link--cta { background: var(--green-600); color: var(--white); }
.mega-menu__footer-link--cta .ms { color: var(--white); }
.mega-menu__footer-link--cta small { color: rgba(255,255,255,.75); }
.mega-menu__footer-link--cta:hover { background: var(--green-700); }

/* ── Boutons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 600; font-size: 14px; padding: 10px 20px;
  border-radius: var(--radius); border: none; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green-600); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-700); }
.btn-secondary { background: var(--white); color: var(--green-700); border: 1.5px solid var(--green-500); }
.btn-secondary:hover { background: var(--green-50); }
.btn-ghost { color: var(--slate-600); padding: 8px 14px; }
.btn-ghost:hover { background: var(--slate-100); }
.btn-dark { background: var(--slate-900); color: var(--white); }
.btn-dark:hover { background: var(--slate-800); }
.btn-lg { padding: 13px 28px; font-size: 15px; width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── Cartes ───────────────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card:hover { box-shadow: var(--shadow); }
.card-body { padding: 16px; }
.card-body-lg { padding: 24px; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #166534 0%, #15803d 60%, #16a34a 100%);
  color: var(--white); padding: 80px 0 0;
  position: relative; overflow: hidden;
}

/* Icônes décoratives arrière-plan */
.hero__bg-icons {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  user-select: none;
}
.hero__bg-icon {
  position: absolute; color: #fff;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 48;
  line-height: 1; display: block;
  filter: blur(0.5px);
}

/* S'assurer que le contenu est au-dessus */
.hero > .container { position: relative; z-index: 1; }
.hero__eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #86efac; margin-bottom: 14px;
}
.hero__title {
  font-size: clamp(32px, 5vw, 52px); font-weight: 900;
  line-height: 1.1; letter-spacing: -.03em; margin-bottom: 18px;
}
.hero__title span { color: #86efac; }
.hero__sub { font-size: 17px; color: #d1fae5; line-height: 1.6; max-width: 520px; margin-bottom: 32px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.hero__btn-white {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--green-700);
  font-weight: 700; font-size: 15px; padding: 13px 28px;
  border-radius: var(--radius); transition: background .15s;
}
.hero__btn-white:hover { background: var(--green-50); }
.hero__btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid rgba(255,255,255,.4); color: var(--white);
  font-weight: 600; font-size: 15px; padding: 13px 28px;
  border-radius: var(--radius); transition: background .15s;
}
.hero__btn-outline:hover { background: rgba(255,255,255,.1); }

/* Stats bar */
.stats-bar { background: rgba(0,0,0,.2); border-top: 1px solid rgba(255,255,255,.1); margin-top: 0; }
.stats-bar__inner { display: flex; }
.stats-item {
  flex: 1; text-align: center; padding: 18px 10px;
  border-right: 1px solid rgba(255,255,255,.1);
}
.stats-item:last-child { border-right: none; }
.stats-item__number { font-size: 28px; font-weight: 900; color: var(--white); }
.stats-item__label { font-size: 12px; color: #86efac; margin-top: 2px; }

/* ── Section ──────────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-white { background: var(--white); border-top: 1px solid var(--slate-100); border-bottom: 1px solid var(--slate-100); }
.section-dark { background: var(--green-700); color: var(--white); }
.section-dark .section__eyebrow { color: #86efac; }
.section-dark .section__title { color: var(--white); }
.section__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green-600); margin-bottom: 8px; }
.section__title { font-size: clamp(22px, 3vw, 30px); font-weight: 900; color: var(--slate-900); letter-spacing: -.02em; }
.section__header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 12px; }
.section__link { font-size: 13px; font-weight: 600; color: var(--green-600); white-space: nowrap; }
.section__link:hover { text-decoration: underline; }

/* ── Grilles ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

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

/* ── Feature card ─────────────────────────────────────────── */
.feature-card { padding: 24px; transition: box-shadow .2s; }
.feature-card:hover { box-shadow: var(--shadow); }
.feature-card__icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}
.feature-card__title { font-size: 15px; font-weight: 700; color: var(--slate-900); margin-bottom: 6px; }
.feature-card__desc { font-size: 13px; color: var(--slate-500); line-height: 1.6; }
.feature-card__arrow { font-size: 13px; font-weight: 600; color: var(--green-600); margin-top: 14px; display: block; }

/* ── Prix table ───────────────────────────────────────────── */
.price-table { width: 100%; border-collapse: collapse; }
.price-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--slate-100); }
.price-row:last-child { border-bottom: none; }
.price-row:hover { background: var(--slate-50); }
.price-row__product { display: flex; align-items: center; gap: 12px; }
.price-row__icon { width: 36px; height: 36px; background: var(--green-50); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.price-row__name { font-size: 14px; font-weight: 600; color: var(--slate-800); }
.price-row__zone { font-size: 12px; color: var(--slate-400); margin-top: 1px; }
.price-row__amount { font-size: 14px; font-weight: 700; color: var(--green-700); text-align: right; }
.price-row__unit { font-size: 12px; color: var(--slate-400); }

/* ── Annonce card ─────────────────────────────────────────── */
.listing-card { display: block; transition: box-shadow .2s, transform .15s; }
.listing-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.listing-card__thumb {
  height: 120px; background: var(--slate-100);
  display: flex; align-items: center; justify-content: center; font-size: 52px;
}
.listing-card__body { padding: 12px; }
.listing-card__type {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; margin-bottom: 6px;
  border: 1px solid;
}
.badge-vente   { background: var(--green-50); color: var(--green-700); border-color: #bbf7d0; }
.badge-achat   { background: var(--blue-50);  color: var(--blue-600);  border-color: #bfdbfe; }
.badge-intrant { background: var(--amber-50); color: #92400e;          border-color: #fde68a; }
.badge-service { background: #f5f3ff;         color: #6d28d9;          border-color: #ddd6fe; }
.listing-card__title { font-size: 13px; font-weight: 600; color: var(--slate-800); line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-card__price { font-size: 14px; font-weight: 800; color: var(--green-700); }
.listing-card__zone  { font-size: 12px; color: var(--slate-400); }
.listing-card__footer { display: flex; justify-content: space-between; align-items: flex-end; }
.badge-vedette { display: inline-flex; align-items: center; gap: 4px; background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; margin-bottom: 5px; }

/* ── Formulaires ──────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 6px; }
.form-label span { font-weight: 400; color: var(--slate-400); }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--slate-200);
  border-radius: var(--radius); font-size: 14px; color: var(--slate-900);
  background: var(--white); transition: border-color .15s, box-shadow .15s;
  outline: none; line-height: 1.5;
  /* Hauteur minimale cohérente pour input ET select */
  min-height: 42px;
  box-sizing: border-box;
}
.form-control:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.form-control::placeholder { color: var(--slate-400); }

/* Select — suppression apparence native + chevron SVG personnalisé */
select.form-control,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
select.form-control:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }

/* Textarea — pas de min-height fixe */
textarea.form-control { min-height: unset; height: auto; }
.form-error { font-size: 12px; color: var(--red-600); margin-top: 5px; }
.alert-error { background: var(--red-50); border: 1px solid #fecaca; color: var(--red-600); padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 20px; }
.alert-success { background: var(--green-50); border: 1px solid #bbf7d0; color: var(--green-700); padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 20px; }

/* ── Auth layout ──────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; }
.auth-side {
  width: 420px; flex-shrink: 0;
  background: linear-gradient(160deg, #166534 0%, #15803d 100%);
  padding: 48px 40px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side__title { font-size: 30px; font-weight: 900; color: var(--white); line-height: 1.2; margin-bottom: 20px; }
.auth-side__list { list-style: none; }
.auth-side__list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #d1fae5; margin-bottom: 12px; }
.auth-side__check { width: 20px; height: 20px; background: var(--green-500); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; color: white; }
.auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-form__inner { width: 100%; max-width: 400px; }
.auth-form__title { font-size: 24px; font-weight: 900; color: var(--slate-900); margin-bottom: 4px; }
.auth-form__sub { font-size: 14px; color: var(--slate-500); margin-bottom: 28px; }

/* ── Filtres / Tags ───────────────────────────────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1.5px solid var(--slate-200); background: var(--white); color: var(--slate-600); cursor: pointer; transition: all .15s; }
.filter-btn:hover { border-color: var(--slate-300); }
.filter-btn.active { background: var(--green-600); color: var(--white); border-color: var(--green-600); }

/* ── Search bar ───────────────────────────────────────────── */
.search-bar { position: relative; }
.search-bar input { padding-left: 40px; }
.search-bar__icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--slate-400); font-size: 16px; pointer-events: none; }

/* ── Page header ──────────────────────────────────────────── */
.page-header { padding: 32px 0 24px; border-bottom: 1px solid var(--slate-200); margin-bottom: 32px; }
.page-header__title { font-size: 26px; font-weight: 900; color: var(--slate-900); letter-spacing: -.02em; }
.page-header__sub { font-size: 14px; color: var(--slate-500); margin-top: 4px; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { background: var(--slate-900); color: var(--slate-400); padding: 48px 0 24px; }
.footer__brand { font-size: 16px; font-weight: 800; color: var(--white); margin-bottom: 8px; }
.footer__tagline { font-size: 13px; line-height: 1.6; max-width: 260px; }
.footer__col-title { font-size: 12px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer__links { list-style: none; }
.footer__links li { margin-bottom: 8px; }
.footer__links a { font-size: 13px; color: var(--slate-400); transition: color .15s; }
.footer__links a:hover { color: var(--white); }
.footer__bottom { border-top: 1px solid var(--slate-800); margin-top: 40px; padding-top: 20px; font-size: 12px; text-align: center; color: var(--slate-600); }

/* ── Bottom nav mobile ────────────────────────────────────── */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--white); border-top: 1px solid var(--slate-200);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__inner { display: flex; height: 60px; }
.bottom-nav__item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: var(--slate-400); font-size: 10px;
  font-weight: 500; transition: color .15s; text-decoration: none; padding: 6px 4px;
}
.bottom-nav__item .ms { font-size: 24px; }
.bottom-nav__item.active { color: var(--green-600); }
.bottom-nav__item.active .ms { font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; gap: 14px; color: var(--slate-400); font-size: 13px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--slate-200); border-top-color: var(--green-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state__icon { font-size: 48px; margin-bottom: 14px; }
.empty-state__title { font-size: 17px; font-weight: 700; color: var(--slate-700); margin-bottom: 6px; }
.empty-state__sub { font-size: 13px; color: var(--slate-400); }

/* ── Utilitaires ──────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--slate-400); }
.text-green { color: var(--green-700); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Landing : hero split ─────────────────────────────────── */
.hero__inner { display: grid; grid-template-columns: 1fr 420px; gap: 48px; align-items: center; padding-bottom: 52px; }
.hero__note  { font-size: 12px; color: #86efac; margin-top: 18px; letter-spacing: .02em; }

/* Hero card prix */
.hero__card {
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; overflow: hidden; backdrop-filter: blur(8px);
}
.hero__card-header { display: flex; align-items: center; gap: 8px; padding: 14px 16px; background: rgba(0,0,0,.2); border-bottom: 1px solid rgba(255,255,255,.08); }
.hero__card-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.hero__card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.5); padding: 10px 16px 6px; }
.hero__price-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.hero__price-row:last-of-type { border-bottom: none; }
.hero__price-icon { font-size: 20px; flex-shrink: 0; }
.hero__price-info { flex: 1; min-width: 0; }
.hero__price-name { display: block; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); }
.hero__price-zone { display: block; font-size: 11px; color: rgba(255,255,255,.45); }
.hero__price-right { text-align: right; flex-shrink: 0; }
.hero__price-amount { font-size: 13px; font-weight: 700; color: white; }
.hero__price-unit { font-size: 11px; font-weight: 400; color: rgba(255,255,255,.5); }
.hero__price-trend { display: block; font-size: 11px; font-weight: 700; margin-top: 1px; }
.trend-up   { color: #4ade80; }
.trend-down { color: #f87171; }
.trend-flat { color: rgba(255,255,255,.4); }
.hero__card-cta { display: block; text-align: center; padding: 12px 16px; font-size: 13px; font-weight: 600; color: #86efac; border-top: 1px solid rgba(255,255,255,.08); transition: background .15s; }
.hero__card-cta:hover { background: rgba(255,255,255,.06); }

/* ── Landing split (prix + annonces) ─────────────────────── */
.landing-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.listings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Steps ────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; position: relative; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; padding: 0 20px; }
.step__num {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green-600); color: white;
  font-size: 22px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  z-index: 1; position: relative; flex-shrink: 0;
  box-shadow: 0 0 0 6px var(--green-50);
  margin-bottom: 20px;
}
.step__line {
  position: absolute; top: 26px; left: calc(50% + 26px); right: calc(-50% + 26px);
  height: 2px; background: var(--slate-200); z-index: 0;
}
.step__title { font-size: 16px; font-weight: 800; color: var(--slate-900); margin-bottom: 8px; }
.step__desc  { font-size: 13px; color: var(--slate-500); line-height: 1.6; }

/* ── Why list ─────────────────────────────────────────────── */
.why-list { display: flex; flex-direction: column; gap: 24px; }
.why-item { display: flex; gap: 16px; }
.why-icon { width: 46px; height: 46px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.why-title { font-size: 15px; font-weight: 700; color: var(--slate-900); margin-bottom: 4px; }
.why-desc  { font-size: 13px; color: var(--slate-500); line-height: 1.6; }

/* Why grid */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.why-card { background: var(--white); border: 1px solid var(--slate-200); border-radius: var(--radius-lg); padding: 20px; transition: box-shadow .2s; }
.why-card:hover { box-shadow: var(--shadow); }
.why-card__icon { font-size: 26px; display: block; margin-bottom: 10px; }
.why-card__title { font-size: 14px; font-weight: 700; color: var(--slate-900); margin-bottom: 4px; }
.why-card__desc  { font-size: 12px; color: var(--slate-400); line-height: 1.5; }

/* ── Témoignages ──────────────────────────────────────────── */
.testimonial-card { padding: 24px; }
.testimonial-stars { color: var(--amber-500); font-size: 14px; letter-spacing: 2px; margin-bottom: 14px; }
.testimonial-text  { font-size: 14px; color: var(--slate-700); line-height: 1.7; margin-bottom: 20px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--slate-100); padding-top: 16px; }
.testimonial-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--green-600); color: white; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.testimonial-name { font-size: 14px; font-weight: 700; color: var(--slate-900); }
.testimonial-role { font-size: 12px; color: var(--slate-400); margin-top: 1px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr 360px; gap: 32px; }
}
@media (max-width: 900px) {
  .hero__inner    { grid-template-columns: 1fr; }
  .hero__card     { display: none; }
  .landing-split  { grid-template-columns: 1fr; }
  .grid-2-1       { grid-template-columns: 1fr; }
  .why-grid       { grid-template-columns: repeat(3, 1fr); }
  .steps          { grid-template-columns: 1fr; gap: 32px; }
  .step__line     { display: none; }
  .step           { flex-direction: row; text-align: left; gap: 20px; align-items: flex-start; }
  .step__num      { margin-bottom: 0; flex-shrink: 0; }
}
@media (max-width: 768px) {
  /* Navbar mobile */
  .navbar__burger { display: flex; }
  .navbar__links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--slate-200);
    box-shadow: var(--shadow); flex-direction: column; align-items: stretch;
    padding: 8px 16px 16px; gap: 2px; z-index: 150;
  }
  .navbar__links--open { display: flex; }
  .navbar__link { font-size: 15px; padding: 10px 12px; }
  .navbar__sep { display: none; }
  .navbar__dropdown-menu { position: static; box-shadow: none; border: none; padding: 0 0 0 16px; }
  .navbar__dropdown-menu--open { display: block; }
  /* Mega menu mobile : devient une liste simple dans le nav mobile */
  .mega-menu { position: static; box-shadow: none; border: none; max-height: none; }
  .mega-menu--open { display: block; animation: none; }
  .mega-menu__inner { padding: 8px 0 0; }
  .mega-menu__header { display: none; }
  .mega-menu__grid { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .mega-menu__footer { flex-direction: column; }
  .mega-menu__footer-link { border-right: none; border-bottom: 1px solid var(--slate-100); padding: 12px 16px; }
  .mega-overlay { display: none !important; }
  /* Footer responsive */
  .footer > .container > div:first-child { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
  .footer > .container > div:first-child > div:first-child { grid-column: 1 / -1; }
  .bottom-nav { display: block; }
  .auth-side  { display: none; }
  body        { padding-bottom: 70px; }
  .hero       { padding-top: 56px; }
  .hero__inner { padding-bottom: 0; }
  .hero__title { font-size: 32px; }
  .section    { padding: 40px 0; }
  .grid-3     { grid-template-columns: repeat(2, 1fr); }
  .grid-4     { grid-template-columns: repeat(2, 1fr); }
  .listings-grid { grid-template-columns: 1fr 1fr; }
  .why-grid   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .hero__actions  { flex-direction: column; }
  .hero__btn-white, .hero__btn-outline { width: 100%; justify-content: center; }
  .grid-3         { grid-template-columns: 1fr; }
  .grid-4         { grid-template-columns: 1fr 1fr; }
  .listings-grid  { grid-template-columns: 1fr; }
  .why-grid       { grid-template-columns: 1fr 1fr; }
  .stats-bar__inner { flex-wrap: wrap; }
  .stats-item     { flex: 0 0 50%; border-bottom: 1px solid rgba(255,255,255,.1); }
  .stats-item:nth-child(1),.stats-item:nth-child(2) { border-bottom: 1px solid rgba(255,255,255,.1); }
  .stats-item:nth-child(3),.stats-item:nth-child(4) { border-bottom: none; }
  .stats-item:nth-child(even) { border-right: none; }
}

/* ── Role badges (navbar) ─────────────────────────────────── */
.role-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; white-space: nowrap;
}
.role-badge--admin   { background: #fff7ed; color: #c2410c; }
.role-badge--manager { background: #eff6ff; color: #1d4ed8; }
.role-badge--member  { background: #f0fdf4; color: #15803d; }
.role-badge--ong     { background: #f5f3ff; color: #7c3aed; }
.role-badge--agent   { background: #fffbeb; color: #b45309; }

/* ── Navbar avatar ────────────────────────────────────────── */
.navbar__avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-600); color: var(--white);
  font-size: 11px; font-weight: 900; margin-right: 4px;
  vertical-align: middle;
}

/* ── Dashboard contextuel (landing) ──────────────────────── */
.dash-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--slate-200);
}
.dash-panel__header {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px;
  color: var(--white);
}
.dash-panel__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: var(--white);
  flex-shrink: 0;
}
.dash-panel__info { flex: 1; min-width: 0; }
.dash-panel__name { font-size: 17px; font-weight: 800; line-height: 1.2; }
.dash-panel__badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  background: rgba(255,255,255,.2); color: var(--white); margin-top: 4px;
}
.dash-panel__zone { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 4px; }
.dash-panel__cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.2); color: var(--white);
  font-size: 12px; font-weight: 700; padding: 8px 16px;
  border-radius: var(--radius); white-space: nowrap;
  transition: background .15s;
}
.dash-panel__cta:hover { background: rgba(255,255,255,.35); }
.dash-panel__actions { background: var(--white); padding: 16px 24px 20px; }
.dash-panel__actions-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--slate-400); margin-bottom: 12px;
}
.dash-panel__actions-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* Couleurs accent par rôle */
.dash-panel--super-admin .dash-panel__header { background: linear-gradient(135deg,#991b1b,#b91c1c); }
.dash-panel--admin       .dash-panel__header { background: linear-gradient(135deg,#c2410c,#ea580c); }
.dash-panel--manager     .dash-panel__header { background: linear-gradient(135deg,#1d4ed8,#2563eb); }
.dash-panel--member      .dash-panel__header { background: linear-gradient(135deg,#15803d,#16a34a); }
.dash-panel--ong         .dash-panel__header { background: linear-gradient(135deg,#7c3aed,#8b5cf6); }
.dash-panel--agent       .dash-panel__header { background: linear-gradient(135deg,#b45309,#d97706); }

/* ── Actions rapides ──────────────────────────────────────── */
.dash-action {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; padding: 8px 14px;
  border-radius: var(--radius); border: 1.5px solid var(--slate-200);
  background: var(--slate-50); color: var(--slate-700);
  transition: all .15s; white-space: nowrap;
}
.dash-action:hover { background: var(--slate-100); border-color: var(--slate-300); transform: scale(1.03); }
.dash-action--primary { background: var(--green-50); color: var(--green-700); border-color: #bbf7d0; }
.dash-action--primary:hover { background: #dcfce7; }
.dash-action--admin   { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.dash-action--manager { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.dash-action--ong     { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.dash-action--agent   { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* ── Bottom nav highlight ─────────────────────────────────── */
.bottom-nav__item--highlight { color: var(--green-600) !important; }
.bottom-nav__item--highlight .ms { font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24; }

@media (max-width: 600px) {
  .dash-panel__header { flex-wrap: wrap; }
  .dash-panel__cta { display: none; }
  .dash-panel__name { font-size: 15px; }
}

/* ── Optimisations mobile supplémentaires ─────────────────── */
@media (max-width: 480px) {
  /* Footer 1 colonne */
  .footer > .container > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .footer > .container > div:first-child > div:first-child {
    grid-column: 1 !important;
  }
  .footer__tagline { max-width: 100%; }
  .footer { padding: 32px 0 16px; }

  /* Navbar burger — liens plus espacés */
  .navbar__link { padding: 12px 14px; font-size: 14px; }

  /* Bottom nav — labels plus petits */
  .bottom-nav__item { font-size: 9px; gap: 2px; }
  .bottom-nav__item .ms { font-size: 22px; }
  .bottom-nav__inner { height: 56px; }
}
