/* LeBeauMarché · charte « Le Carnet vert »
   Gazette de quartier élégante : ivoire, encre vert forêt, accent vert vif, titres Fraunces, texte Figtree.
   Formes arrondies (boutons pilule), presque pas d'ombres. Pensé d'abord pour le téléphone. */

:root {
  --foret: #0b3b2e;          /* encre, bandeaux sombres */
  --foret-2: #164a3b;
  --pousse: #19c37d;         /* accent vif */
  --pousse-fonce: #0e8f5a;   /* accent lisible sur fond clair */
  --pousse-clair: #dcf5e9;
  --ivoire: #faf8f4;         /* fond de page */
  --carte: #ffffff;
  --lin: #efebe4;            /* aplats, champs */
  --sable: #e4ded3;          /* filets */
  --texte: #0b3b2e;
  --doux: #6f7d76;
  --creme: #fffaf0;          /* texte sur fond sombre */
  --tomate: #e4572e;         /* alertes uniquement */
  --tomate-clair: #fde9e3;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ivoire: #0b3b2e;
    --carte: #11463a;
    --lin: #164a3b;
    --sable: rgba(255, 250, 240, .12);
    --texte: #fffaf0;
    --doux: #9fb2a9;
    --pousse-fonce: #19c37d;
    --pousse-clair: rgba(25, 195, 125, .16);
    --tomate-clair: rgba(228, 87, 46, .18);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivoire); color: var(--texte);
  font: 16px/1.5 var(--sans); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--pousse-fonce); text-underline-offset: 3px; }
h1, h2 { font-family: var(--serif); font-weight: 500; font-variation-settings: "SOFT" 100; letter-spacing: -.01em; line-height: 1.08; }
h1 { font-size: 2rem; margin: .1em 0 .5em; }
h2 { font-size: 1.35rem; margin: 1.8em 0 .6em; }
.muted { color: var(--doux); }
.center { text-align: center; }
.kicker { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--pousse-fonce); }
.crumb { margin: 0 0 6px; font-size: .92rem; }
[hidden] { display: none !important; }

/* --- En-tête -------------------------------------------------------------- */
.topbar {
  background: var(--foret); color: var(--creme);
  display: flex; align-items: center; gap: 24px;
  padding: 14px max(16px, calc(50% - 480px));
  position: sticky; top: 0; z-index: 10;
}
.brand { font: 600 1.4rem var(--serif); font-variation-settings: "SOFT" 100; color: var(--creme); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--pousse); }

/* Navigation : dans l'en-tête sur ordinateur, barre en bas de l'écran sur téléphone */
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a {
  position: relative; display: flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 99px; text-decoration: none;
  color: rgba(255, 250, 240, .78); font-weight: 600; font-size: .92rem;
}
.tabs a:hover { color: var(--creme); background: rgba(255, 250, 240, .08); }
.tabs a.on { background: var(--creme); color: var(--foret); }
.tabs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs .badge { position: absolute; top: 0; right: 2px; }

@media (max-width: 760px) {
  .topbar { padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top)); }
  body.with-tabs { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; gap: 0;
    background: var(--carte); border-top: 1px solid var(--sable);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .tabs a { flex-direction: column; gap: 3px; padding: 4px 6px; font-size: .68rem; color: var(--doux); border-radius: 12px; flex: 1; }
  .tabs a:hover { background: none; color: var(--texte); }
  .tabs a.on { background: none; color: var(--texte); font-weight: 700; }
  .tabs a.on svg { color: var(--pousse-fonce); stroke-width: 2.2; }
  .tabs svg { width: 23px; height: 23px; }
  .tabs .badge { top: 0; right: calc(50% - 22px); }
}

.page { max-width: 960px; margin: 0 auto; padding: 22px 18px 48px; }
.footer { text-align: center; color: var(--doux); font-size: .82rem; padding: 18px 16px 28px; }

/* --- Messages ------------------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: 16px; margin-bottom: 14px; font-weight: 500; }
.flash-succes { background: var(--pousse-clair); color: var(--pousse-fonce); }
.flash-erreur { background: var(--tomate-clair); color: var(--tomate); }
.flash-info { background: var(--lin); }

/* --- Boutons (pilules) ---------------------------------------------------- */
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 99px; cursor: pointer; text-decoration: none; text-align: center;
  border: 1.5px solid var(--sable); background: var(--carte); color: var(--texte);
  font: 700 .95rem/1.2 var(--sans);
}
.btn:hover { border-color: var(--doux); }
.btn-primary { background: var(--foret); border-color: var(--foret); color: var(--creme); }
.btn-primary:hover { background: var(--foret-2); border-color: var(--foret-2); }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--pousse); border-color: var(--pousse); color: #0b3b2e; }
  .btn-primary:hover { background: #2bd38c; border-color: #2bd38c; }
}
.btn-danger { color: var(--tomate); }
.btn-danger:hover { border-color: var(--tomate); }
.btn-small { padding: 6px 13px; font-size: .85rem; font-weight: 600; }
.btn-block { display: block; width: 100%; padding: 14px; }
.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* --- Cartes et formulaires ----------------------------------------------- */
.card { background: var(--carte); border-radius: 22px; }
.form { padding: 20px; display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-weight: 600; font-size: .95rem; }
.form small { font-weight: 400; color: var(--doux); }
input, select, textarea {
  font: inherit; color: var(--texte); background: var(--carte);
  border: 1.5px solid var(--sable); border-radius: 14px; padding: 11px 14px; width: 100%; min-height: 46px;
}
textarea { min-height: 0; }
select { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pousse-fonce); box-shadow: 0 0 0 3px var(--pousse-clair); }
.form .check, .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.form .check input, .check input { width: 18px; height: 18px; min-height: 0; margin: 3px 0 0; flex: none; accent-color: var(--pousse-fonce); }
.form > .btn, .return .form .btn { justify-self: start; }
.auth { max-width: 440px; margin: 10px auto; }
.auth h1, .auth > .muted { text-align: center; }
.address { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 10px; }
.dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dates input, .address input, .address select { min-width: 0; }
input[type="date"] { -webkit-appearance: none; appearance: none; }
.hint { margin: -6px 0 0; font-size: .85rem; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: .1em 0 0; }

/* --- Catalogue : bandeau vert forêt -------------------------------------- */
.band {
  background: var(--foret); color: var(--creme);
  margin: -22px calc(50% - 50vw) 0; padding: 6px calc(50vw - 50%) 26px;
  position: relative; overflow: hidden;
}
.band::after { /* lignes de niveau : le quartier vu du ciel */
  content: ""; position: absolute; inset: 0; opacity: .1; pointer-events: none;
  background: repeating-radial-gradient(circle at 88% 0%, transparent 0 15px, var(--pousse) 15px 16px);
}
.band-in { position: relative; z-index: 1; }
.band .kicker { color: var(--pousse); margin-top: 12px; }
.band h1 { font-size: 2.3rem; line-height: 1.02; margin: 6px 0 18px; max-width: 14em; }
.band h1 span { color: var(--pousse); }
.search input {
  border-radius: 99px; padding: 12px 18px 12px 44px; font-size: 1rem;
  background: rgba(255, 250, 240, .1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fffaf0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") 16px 50% / 18px no-repeat;
  border: 1px solid rgba(255, 250, 240, .25); color: var(--creme);
}
.search input::placeholder { color: rgba(255, 250, 240, .65); }
.search input:focus { border-color: var(--pousse); box-shadow: 0 0 0 3px rgba(25, 195, 125, .25); }

.filters { display: grid; gap: 10px; margin: 16px 0 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; padding: 7px 14px; border-radius: 99px; text-decoration: none; font-size: .85rem; font-weight: 600; background: var(--lin); color: var(--texte); }
.chip.on { background: var(--foret); color: var(--creme); }
@media (prefers-color-scheme: dark) { .chip.on { background: var(--pousse); color: #0b3b2e; } }
.toggle { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--texte); font-size: .9rem; font-weight: 500; justify-self: start; }
.toggle-box { width: 20px; height: 20px; flex: none; border: 1.5px solid var(--doux); border-radius: 6px; display: inline-grid; place-items: center; }
.toggle.on .toggle-box { background: var(--pousse-fonce); border-color: var(--pousse-fonce); }
.toggle.on .toggle-box::after { content: "✓"; color: #fff; font-weight: 700; font-size: .78rem; line-height: 1; }

/* --- Liste d'objets (façon gazette) -------------------------------------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--sable); text-decoration: none; color: var(--texte);
}
.row:hover strong { color: var(--pousse-fonce); }
/* Vignette : petite photo collée, légèrement de travers */
.thumb {
  width: 54px; height: 60px; justify-self: center; display: grid; place-items: center;
  background: #fff; padding: 3px 3px 9px; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(11, 59, 46, .2); transform: rotate(-2.5deg);
}
.rows li:nth-child(even) .thumb { transform: rotate(2deg); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb-icon { font-size: 1.5rem; padding: 3px 3px 9px; }
.thumb-icon::before { content: none; }
.row.is-lent .thumb { opacity: .6; }
.row-body { display: grid; gap: 3px; min-width: 0; }
.row-body strong { font: 500 1.12rem/1.2 var(--serif); font-variation-settings: "SOFT" 100; }
.row-body small { font-size: .8rem; color: var(--doux); }
.row .pill { justify-self: end; text-align: right; max-width: 9.5rem; }
@media (min-width: 761px) { .rows { columns: 2; column-gap: 40px; } .rows li { break-inside: avoid; } }

/* Étiquette du numéro de maison */
.plaque { display: inline-block; min-width: 1.5em; text-align: center; font-weight: 700; font-size: .92em; background: var(--lin); color: var(--texte); border-radius: 6px; padding: 0 5px; margin-right: 2px; }

/* Pastilles de statut */
.pill { display: inline-block; justify-self: start; padding: 4px 11px; border-radius: 99px; font-size: .74rem; font-weight: 700; line-height: 1.3; }
.pill-dispo, .pill-rendu { background: var(--pousse-clair); color: var(--pousse-fonce); }
.pill-dispo::before { content: "● "; font-size: .62rem; vertical-align: 1px; }
.pill-prete, .pill-en_cours, .pill-demande, .pill-refuse, .pill-annule { background: var(--lin); color: var(--doux); }
.pill-retard { background: var(--tomate-clair); color: var(--tomate); }

/* Bouton flottant « Proposer » */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 15;
  background: var(--pousse); color: #0b3b2e; text-decoration: none; font-weight: 700; font-size: .95rem;
  border-radius: 99px; padding: 14px 20px; box-shadow: 0 10px 24px rgba(25, 195, 125, .4);
}
@media (min-width: 761px) { .fab { bottom: 28px; right: max(24px, calc(50% - 480px)); } }

/* --- Fiche objet ---------------------------------------------------------- */
.description { white-space: pre-line; margin: 14px 0 0; }
.owner { display: flex; align-items: center; gap: 12px; padding: 14px 0; margin: 16px 0 0; border-top: 1px solid var(--sable); border-bottom: 1px solid var(--sable); }
.owner strong { font-weight: 700; }
.request { padding: 18px 0 0; }
.notice { margin-top: 16px; padding: 13px 16px; border-radius: 16px; background: var(--lin); }
.notice .inline { margin-left: 6px; }
.bookings { margin-top: 16px; padding: 12px 16px; border-radius: 16px; background: var(--lin); }
.bookings ul { margin: 4px 0 0; padding-left: 18px; }

/* Avatars */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; color: #0b3b2e; flex: none; font-size: .95rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.3rem; }

/* --- Photos --------------------------------------------------------------- */
.photo-field { display: grid; gap: 8px; justify-items: start; }
.field-title { font-weight: 600; }
.file-btn { cursor: pointer; }

/* --- Prêts ---------------------------------------------------------------- */
.loan { padding: 16px 18px; margin-bottom: 12px; }
.loan p { margin: 0; }
.who { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.who strong { font-weight: 700; }
blockquote { margin: 10px 0 0; font: 400 1rem/1.4 var(--serif); font-variation-settings: "SOFT" 100; color: var(--doux); }
blockquote::before { content: "« "; }
blockquote::after { content: " »"; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: .9rem; }
.return { margin-top: 12px; }
.return summary { list-style: none; display: inline-block; }
.return summary::-webkit-details-marker { display: none; }
.return[open] summary { margin-bottom: 10px; }
.return .form { padding: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--sable); }
.badge { display: inline-block; min-width: 19px; padding: 0 6px; border-radius: 99px; background: var(--tomate); color: #fff; font: 700 .7rem/19px var(--sans); text-align: center; font-style: normal; }
.empty { text-align: center; color: var(--doux); padding: 40px 10px; }
.ico { margin-right: .3em; }

/* --- Voisins -------------------------------------------------------------- */
.street { list-style: none; padding: 0; margin: 0; }
.street li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--sable); }
.street li.me strong { color: var(--pousse-fonce); }
.house.plaque { font-size: 1rem; min-width: 52px; padding: 6px 8px; border-radius: 12px; }

/* --- Mon compte et administration ---------------------------------------- */
.admin-link { display: flex; align-items: center; gap: 12px; padding: 16px 18px; text-decoration: none; color: var(--texte); margin-bottom: 8px; }
.admin-link span:first-child { flex: 1; }
.logout { margin: 26px 0 0; text-align: center; }
.form.compact { padding: 0; margin-top: 12px; gap: 8px; }
.street-row { padding: 14px 16px; margin-bottom: 10px; display: grid; gap: 8px; }
.rename { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rename input { flex: 1 1 180px; min-width: 0; min-height: 40px; padding: 8px 12px; }

@media (max-width: 760px) {
  h1 { font-size: 1.8rem; }
  .band h1 { font-size: 2rem; }
}
.rows { margin-bottom: 80px; }

/* --- Fiche objet : photo collée dans le carnet ---------------------------- */
.crumb { max-width: 860px; margin: 0 auto 14px; }
.detail { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.detail-media { position: sticky; top: 96px; padding-top: 14px; }
.polaroid {
  display: block; position: relative; background: #fff; padding: 12px 12px 38px; border-radius: 4px;
  box-shadow: 0 1px 2px rgba(11, 59, 46, .12), 0 12px 28px rgba(11, 59, 46, .12);
  transform: rotate(-1.6deg); text-decoration: none; transition: transform .2s;
}
a.polaroid:hover { transform: rotate(0deg) scale(1.02); }
.polaroid::before { /* morceau de ruban adhésif */
  content: ""; position: absolute; top: -11px; left: 50%; width: 84px; height: 24px; margin-left: -42px;
  background: rgba(228, 222, 211, .9); transform: rotate(2.5deg);
}
.polaroid img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain; }
.polaroid > span:last-child {
  position: absolute; left: 0; right: 0; bottom: 9px; text-align: center;
  font: 500 1rem var(--serif); font-variation-settings: "SOFT" 100; color: #6f7d76;
}
.polaroid-icon { display: grid; place-items: center; aspect-ratio: 1; background: #f3efe8; font-size: 4rem; }
.polaroid-small { display: inline-block; width: 170px; padding: 8px 8px 14px; }
.polaroid-small::before { width: 60px; margin-left: -30px; height: 18px; top: -8px; }
.photo-preview { max-width: 100%; max-height: 220px; border-radius: 0; }
.detail-body > .pill:first-child { margin-top: 4px; }
.detail-body h1 { margin: 10px 0 2px; font-size: 2.2rem; }
.detail-body .cat { margin: 0; font-size: .9rem; }
.detail-body section h2 { margin-top: 1.6em; }
@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; gap: 18px; }
  .detail-media { position: static; display: flex; justify-content: center; padding-top: 16px; }
  .polaroid { width: 210px; }
  .polaroid img { max-height: 260px; }
  .detail-body h1 { font-size: 1.9rem; }
}
.polaroid.polaroid-small { width: 150px; padding: 7px 7px 12px; transform: rotate(-1.5deg); margin: 8px 0 4px; }
.polaroid-small img, .polaroid-small .photo-preview { max-height: 160px; }

/* --- Photos de profil et rôles -------------------------------------------- */
img.avatar { object-fit: cover; background: var(--lin); }
.avatar-xl { width: 76px; height: 76px; font-size: 1.8rem; }
.profile-photo { display: flex; align-items: center; gap: 16px; }
.profile-photo > div { display: grid; gap: 6px; justify-items: start; }
.role { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pousse-fonce); background: var(--pousse-clair); border-radius: 99px; padding: 2px 8px; vertical-align: 2px; }
.members { list-style: none; margin: 0; padding: 0; }
.members li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sable); }
.member-name { flex: 1; min-width: 0; }

/* --- Pages légales et acceptation des CGU --------------------------------- */
.legal { max-width: 720px; margin: 0 auto; }
.legal h2 { font-size: 1.25rem; margin: 1.6em 0 .4em; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal .lead { font-size: 1.08rem; background: var(--lin); border-radius: 16px; padding: 14px 18px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--sable); }
.legal-table th { font-weight: 700; }
.legal-links { margin-top: 2em; font-size: .92rem; }
.cgu-box { background: var(--lin); border-radius: 16px; padding: 14px 16px; display: grid; gap: 10px; font-size: .92rem; }
.cgu-box p { margin: 0; }
.footer a { color: var(--doux); }
.danger-zone { padding: 14px 18px; }
.danger-zone summary { cursor: pointer; color: var(--tomate); font-weight: 600; }
.danger-zone[open] summary { margin-bottom: 8px; }
.danger-zone p { margin: 0; }
.subhead { font: 700 .95rem var(--sans); margin: 18px 0 4px; }
.invite-banner { background: var(--pousse-clair); color: var(--texte); border-radius: 16px; padding: 12px 16px; margin-bottom: 14px; text-align: center; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } @media (max-width: 560px) { .two-cols { grid-template-columns: 1fr; } }

/* --- Assistance ------------------------------------------------------------ */
.help-btn {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; text-decoration: none; font-weight: 700; font-size: 1rem;
  color: var(--creme); border: 1.5px solid rgba(255, 250, 240, .45);
}
.help-btn:hover { background: rgba(255, 250, 240, .1); border-color: var(--creme); }
.topbar .tabs { margin-left: 0; }
@media (min-width: 761px) { .help-btn { order: 3; margin-left: 4px; } .topbar .tabs { margin-left: auto; } }
.kinds { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.kinds legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.message { white-space: normal; }
.meta { font-size: .85rem; margin-top: 8px !important; }
.loan.is-done { opacity: .65; }
.auth > .kicker { text-align: center; }

/* --- Outils d'administration ---------------------------------------------- */
.admin-box { margin-top: 18px; padding: 14px 16px; border-radius: 16px; border: 1.5px dashed var(--sable); }
.admin-box .actions { margin-top: 10px; }
.admin-edit { margin-top: 8px; }
.admin-edit summary { cursor: pointer; color: var(--pousse-fonce); font-size: .85rem; font-weight: 600; }
.admin-edit .form { margin-top: 10px; }
.push-right { margin-left: auto; }
.members li { flex-wrap: wrap; }
