/* ============================================================
   Le Fourtout — feuille de style partagée
   ============================================================ */

:root {
  --navy-900: #0f1d2e;
  --navy-700: #1b2e44;
  --navy-500: #2f4a66;
  --navy-300: #7c93aa;
  --navy-100: #d7e0e9;
  --navy-50: #eef2f6;

  --mint-700: #116b4e;
  --mint-600: #178963;
  --mint-500: #1fa97a;
  --mint-300: #6fdba9;
  --mint-100: #c9f4e1;
  --mint-50: #e9fbf3;

  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --surface-border: #e4e9ee;

  --radius: 1.1rem;
  --radius-sm: 0.6rem;
  --shadow-card: 0 1px 2px rgba(15, 29, 46, 0.06), 0 8px 24px -12px rgba(15, 29, 46, 0.12);
  --shadow-card-hover: 0 4px 10px rgba(15, 29, 46, 0.08), 0 16px 32px -12px rgba(15, 29, 46, 0.18);

  --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-soft);
  color: var(--navy-900);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--mint-600);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Boutons ---------- */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--mint-500);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.btn-primary:hover { background: var(--mint-600); }
.btn-primary:disabled { opacity: .5; pointer-events: none; }

.btn-secondary {
  background: #fff;
  color: var(--navy-700);
  border: 1px solid var(--surface-border);
}
.btn-secondary:hover { border-color: var(--navy-300); background: var(--navy-50); }

.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-card);
  color: var(--navy-500);
}
.icon-btn:hover { background: #fff; }

/* ---------- Champs de formulaire ---------- */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy-700);
  margin-bottom: 0.35rem;
}
.input,
select.input,
textarea.input {
  width: 100%;
  border: 1px solid var(--surface-border);
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  color: var(--navy-900);
  font-family: inherit;
}
.input::placeholder { color: var(--navy-300); }
.input:focus {
  outline: none;
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px var(--mint-50);
}
textarea.input { resize: vertical; }
.field-error { color: #c0392b; font-size: 0.78rem; margin-top: 0.3rem; }
.form-error {
  background: #fdecea;
  color: #c0392b;
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.form-success {
  background: var(--mint-50);
  color: var(--mint-700);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-border);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
}
.logo {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
}
.logo .wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}
.logo .wordmark .navy { color: var(--navy-900); }
.logo .wordmark .mint { color: var(--mint-500); }
.logo .tagline {
  margin-top: 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-500);
}
.logo .tagline .mint { color: var(--mint-500); }

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy-700);
  background: none;
  border: none;
}
.nav-link:hover { background: var(--navy-50); }

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}

.menu-toggle {
  display: inline-flex;
  border: none;
  background: none;
  padding: 0.4rem;
  color: var(--navy-700);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid var(--surface-border);
  background: #fff;
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { justify-content: flex-start; }

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .menu-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy-900);
  border-bottom: 1px solid var(--surface-border);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
}
.hero::before {
  width: 280px; height: 280px;
  right: -90px; top: -90px;
  background: rgba(31,169,122,.25);
}
.hero::after {
  width: 220px; height: 220px;
  left: -70px; bottom: -70px;
  background: rgba(47,74,102,.5);
}
.hero-inner { position: relative; padding: 3.5rem 0; }
.hero h1 {
  color: #fff;
  font-size: 2rem;
  line-height: 1.2;
  max-width: 32rem;
  font-weight: 800;
}
.hero h1 .accent { color: var(--mint-300); }
.hero p {
  color: var(--navy-100);
  max-width: 30rem;
  font-size: 0.95rem;
  margin-top: 0.75rem;
}
@media (min-width: 640px) {
  .hero-inner { padding: 5rem 0; }
  .hero h1 { font-size: 2.5rem; }
}

/* ---------- Recherche ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-card);
  padding: 0.4rem 0.4rem 0.4rem 1.1rem;
  max-width: 42rem;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  background: transparent;
  color: var(--navy-900);
}
.search-bar input::placeholder { color: var(--navy-300); }
.search-bar svg { flex-shrink: 0; color: var(--navy-300); }

/* ---------- Trust strip ---------- */
.trust-strip {
  background: #fff;
  border-bottom: 1px solid var(--surface-border);
}
.trust-grid {
  display: grid;
  gap: 1.5rem;
  padding: 2rem 0;
}
.trust-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.trust-item .icon-wrap {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--mint-50);
  color: var(--mint-600);
  display: flex; align-items: center; justify-content: center;
}
.trust-item strong { display: block; font-size: 0.875rem; color: var(--navy-900); }
.trust-item p { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--navy-500); line-height: 1.4; }
@media (min-width: 640px) { .trust-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Sections ---------- */
.section { padding: 2.5rem 0; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-head h2 { font-size: 1.3rem; font-weight: 700; color: var(--navy-900); }
.section-head a { font-size: 0.875rem; font-weight: 600; color: var(--mint-600); }

/* ---------- Grille catégories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1rem 0.5rem;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--mint-300); }
.category-card .emoji {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--mint-50);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.category-card span.label { font-size: 0.75rem; font-weight: 500; color: var(--navy-700); }
@media (min-width: 640px) { .category-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1024px) { .category-grid { grid-template-columns: repeat(8, 1fr); } }

/* ---------- Cartes annonces ---------- */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) { .listing-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .listing-grid { grid-template-columns: repeat(4, 1fr); } }

.listing-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s ease;
}
.listing-card:hover { box-shadow: var(--shadow-card-hover); }
.listing-photo {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--navy-50);
  overflow: hidden;
}
.listing-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.listing-card:hover .listing-photo img { transform: scale(1.05); }
.listing-photo .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.2rem; }
.listing-photo .fav-btn { position: absolute; top: 0.5rem; right: 0.5rem; }
.listing-body { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.listing-price { font-weight: 800; font-size: 1rem; color: var(--navy-900); }
.listing-title {
  font-size: 0.85rem; font-weight: 500; color: var(--navy-700);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-meta {
  margin-top: auto; padding-top: 0.35rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.72rem; color: var(--navy-300);
}
.listing-meta .place { display: flex; align-items: center; gap: 0.25rem; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  border: 1px dashed var(--surface-border);
  background: #fff;
  border-radius: var(--radius);
  padding: 4rem 1rem;
  text-align: center;
  color: var(--navy-500);
}
.empty-state svg { color: var(--navy-300); }
.empty-state p { max-width: 22rem; font-size: 0.875rem; margin: 0; }

/* ---------- Filtres ---------- */
.filters-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1rem;
}
@media (min-width: 640px) { .filters-bar { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .filters-bar { grid-template-columns: repeat(6, 1fr); align-items: end; } }
.filters-bar .field { margin-bottom: 0; }

/* ---------- Fiche annonce ---------- */
.listing-detail {
  display: grid;
  gap: 2rem;
}
@media (min-width: 1024px) { .listing-detail { grid-template-columns: 1.4fr 1fr; } }
.detail-photo {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--navy-50);
}
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-photo .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 3.5rem; }
.thumb-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.thumb { aspect-ratio: 1; border-radius: 0.5rem; overflow: hidden; border: 1px solid var(--surface-border); background: var(--navy-50); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--mint-50);
  color: var(--mint-700);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}
.detail-price { font-size: 1.9rem; font-weight: 800; color: var(--mint-600); margin: 0.5rem 0; }
.detail-meta { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.875rem; color: var(--navy-500); margin-bottom: 1.25rem; }
.detail-meta span { display: flex; align-items: center; gap: 0.5rem; }
.contact-card {
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff;
}
.contact-card p.hint { font-size: 0.75rem; color: var(--navy-400, var(--navy-300)); margin-top: 0.75rem; line-height: 1.4; }
.description-block h2 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; }
.description-block p { font-size: 0.875rem; line-height: 1.6; color: var(--navy-700); white-space: pre-line; }

/* ---------- Auth pages ---------- */
.auth-page {
  max-width: 26rem;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-page h1 { font-size: 1.5rem; font-weight: 700; }
.auth-page > p.lead { font-size: 0.875rem; color: var(--navy-500); margin-top: 0.35rem; }
.auth-footer { text-align: center; font-size: 0.875rem; color: var(--navy-500); margin-top: 1.5rem; }
.auth-footer a { font-weight: 600; color: var(--mint-600); }
.auth-icon-block {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.auth-icon-block .icon-circle {
  width: 56px; height: 56px; border-radius: 999px;
  background: var(--mint-50); color: var(--mint-600);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}

/* ---------- Messagerie ---------- */
.messages-shell {
  display: grid;
  min-height: calc(100vh - 4.5rem);
}
@media (min-width: 860px) {
  .messages-shell { grid-template-columns: 320px 1fr; gap: 1rem; padding: 1.5rem 0; }
}
.convo-list {
  background: #fff;
  border-right: 1px solid var(--surface-border);
  overflow-y: auto;
}
@media (min-width: 860px) {
  .convo-list { border: 1px solid var(--surface-border); border-radius: var(--radius); }
}
.convo-list h1 { font-size: 1.1rem; font-weight: 700; padding: 0.9rem 1rem; border-bottom: 1px solid var(--surface-border); }
.convo-item {
  display: block; padding: 0.8rem 1rem; border-bottom: 1px solid var(--surface-border); font-size: 0.85rem;
}
.convo-item:hover { background: var(--navy-50); }
.convo-item.active { background: var(--mint-50); }
.convo-item strong { display: block; color: var(--navy-900); }
.convo-item span { font-size: 0.72rem; color: var(--navy-300); }
.thread {
  display: flex; flex-direction: column;
  min-height: 60vh;
}
@media (min-width: 860px) { .thread { border: 1px solid var(--surface-border); border-radius: var(--radius); background: #fff; } }
.thread-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--surface-border);
}
.thread-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; color: var(--navy-300); }
.thread-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.msg-bubble {
  max-width: 75%; padding: 0.55rem 0.85rem; border-radius: 1.1rem; font-size: 0.85rem; line-height: 1.4;
}
.msg-bubble.mine { align-self: flex-end; background: var(--mint-500); color: #fff; }
.msg-bubble.theirs { align-self: flex-start; background: var(--navy-50); color: var(--navy-900); }
.thread-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--surface-border); }
.thread-form input { flex: 1; }

/* ---------- Profil ---------- */
.profile-card { border: 1px solid var(--surface-border); border-radius: var(--radius); background: #fff; padding: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.my-listing-item {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--surface-border); border-radius: 0.8rem; background: #fff;
  padding: 0.75rem 1rem; margin-bottom: 0.5rem;
}
.my-listing-item .title { font-weight: 600; font-size: 0.9rem; color: var(--navy-900); }
.my-listing-item .sub { font-size: 0.75rem; color: var(--navy-300); }
.row-actions { display: flex; gap: 0.35rem; }

/* ---------- Formulaire dépôt : photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(6, 1fr); } }
.photo-slot {
  position: relative; aspect-ratio: 1; border-radius: 0.6rem; overflow: hidden;
  border: 1px solid var(--surface-border); background: var(--navy-50);
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .remove-btn {
  position: absolute; top: 4px; right: 4px; background: rgba(15,29,46,.7); color: #fff;
  border: none; border-radius: 999px; width: 20px; height: 20px; font-size: 11px; line-height: 1;
}
.photo-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  aspect-ratio: 1; border-radius: 0.6rem; border: 1px dashed var(--surface-border);
  color: var(--navy-300); font-size: 0.65rem; cursor: pointer;
}
.photo-add:hover { border-color: var(--mint-500); color: var(--mint-500); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--surface-border); background: #fff; }
.footer-grid { display: grid; gap: 2rem; padding: 3rem 0; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer-grid h3 { font-size: 0.85rem; font-weight: 700; color: var(--navy-900); margin-bottom: 0.6rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid a { font-size: 0.85rem; color: var(--navy-500); }
.footer-grid a:hover { color: var(--mint-600); }
.footer-grid p { font-size: 0.85rem; color: var(--navy-500); max-width: 20rem; line-height: 1.5; }
.footer-bottom { border-top: 1px solid var(--surface-border); padding: 1rem 0; text-align: center; font-size: 0.75rem; color: var(--navy-300); }

/* ---------- Pages statiques ---------- */
.static-page { max-width: 42rem; margin: 0 auto; padding: 3rem 1.25rem; }
.static-page h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.5rem; }
.static-page h2 { font-size: 0.95rem; font-weight: 700; margin: 1.25rem 0 0.4rem; color: var(--navy-900); }
.static-page p { font-size: 0.9rem; line-height: 1.65; color: var(--navy-700); margin: 0 0 0.9rem; }

/* ---------- Utilitaires ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.muted { color: var(--navy-300); font-size: 0.85rem; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
