/*
 * NextSeason — composants
 * ---------------------------------------------------------------
 * Éléments réutilisés sur plusieurs pages : boutons, puces, champs,
 * étiquettes, encadrés, cartes d’annonce, lignes, avis, discussions.
 */

/* ---------- Boutons et liens ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: var(--r);
  font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: .9; }
.btn-sign { background: var(--sign); color: var(--sign-ink); }
.btn-sign:hover { filter: brightness(.96); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-lg { font-size: 17px; padding: 13px 22px; white-space: normal; text-align: center; }
.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
.links { display: flex; gap: 18px; flex-wrap: wrap; }
.title-link {
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
  font-weight: 700; color: inherit;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px;
}
.title-link:hover { text-decoration-color: currentColor; }

/* Lien qui rend toute la carte cliquable (la carte doit être en position: relative) */
.stretch { color: inherit; text-decoration: none; font-weight: 700; }
.stretch::after { content: ""; position: absolute; inset: 0; }
.stretch:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Puces (filtres) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 14.5px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* Rubrique « Divers » : volontairement plus discrète */
.chip-minor { border-style: dashed; color: var(--muted); font-weight: 400; }
.chips-sep { width: 1px; align-self: stretch; margin-inline: 4px; background: var(--line); }

/* ---------- Champs de formulaire ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: 14.5px; }
.inline-field { display: flex; gap: 8px; align-items: center; }
.hint { font-size: 13.5px; color: var(--muted); }
.input {
  width: 100%; padding: 10px 12px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.inline-field .input { width: auto; padding: 8px 10px; font-size: 15px; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
textarea.input { resize: vertical; min-height: 90px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.errors { display: grid; gap: 4px; font-size: 14.5px; color: var(--alert); }
.errors:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- Étiquettes ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 3px;
  font: 500 12.5px/1.2 var(--f-mono); white-space: nowrap;
}
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.alert { background: var(--alert); color: var(--on-alert); }
.tag.na { background: var(--surface-2); color: var(--muted); }
.tag.plain { background: var(--surface-2); color: var(--ink); }
/* « Écrit en anglais » à côté d’un texte d’utilisateur */
.lang-note { display: inline-block; margin-left: 4px; font: 500 12px/1.2 var(--f-mono); color: var(--muted); }

/* ---------- Encadrés d’information ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--r); font-size: 15px; }
.notice > svg { flex: none; margin-top: 2px; }
.notice strong { display: block; }
.notice.alert { background: var(--alert-bg); }
.notice.alert > svg { color: var(--alert); }
.notice.warn { background: var(--warn-bg); }
.notice.warn > svg { color: var(--warn); }
.notice.info { background: var(--surface-2); }
.ok-ic { color: var(--good); }

.box { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.box h2, .box h3 { font: 600 20px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; }
.box-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.who { font: 400 13px var(--f-mono); color: var(--muted); }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------- Vignettes (courbes de niveau + pictogramme) ---------- */
.thumb {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 4 / 3; max-width: 100%; color: var(--ink);
  background-color: var(--tile);
  background-image:
    repeating-radial-gradient(circle at var(--x1, 30%) var(--y1, 40%), transparent 0 11px, var(--topo) 11px 12.5px),
    repeating-radial-gradient(circle at var(--x2, 76%) var(--y2, 82%), transparent 0 15px, var(--topo) 15px 16.5px);
}
.thumb svg { width: 44%; max-width: 120px; height: auto; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.framed { border: 1px solid var(--line); border-radius: var(--r); }
.thumb.big svg { width: 34%; }

/* ---------- Carte d’annonce ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s;
}
.card:hover { border-color: var(--muted); }
.on-thumb { position: absolute; top: 10px; left: 10px; }
.on-thumb-r { position: absolute; top: 10px; right: 10px; }
.on-thumb-b { position: absolute; bottom: 10px; left: 10px; }
.card-body { display: grid; gap: 6px; padding: 12px 14px 14px; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.price { font: 500 22px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.big-price { font-size: 30px; }
.neuf { font: 400 13px var(--f-mono); color: var(--muted); }
.card-title { font-weight: 700; font-size: 16.5px; line-height: 1.3; }
.card-meta { font-size: 14px; color: var(--muted); }
.card-state { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.card-state .mono { color: var(--muted); }

/* ---------- Lignes (fiches, mes annonces) ---------- */
.rows { display: grid; gap: 10px; }
.row, .my-row {
  position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.row:hover { border-color: var(--muted); }
.row .thumb, .my-row .thumb { aspect-ratio: 1; border-radius: 3px; }
.row .thumb svg, .my-row .thumb svg { width: 58%; }
.row-main { min-width: 0; display: grid; gap: 2px; }
.row-side { display: grid; gap: 2px; text-align: right; font-size: 14px; }
.my-edit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.my-edit .input { width: 110px; padding: 8px 10px; }
@media (max-width: 560px) {
  .row { grid-template-columns: 56px minmax(0, 1fr); }
  .row-side { grid-column: 2; display: flex; gap: 12px; flex-wrap: wrap; text-align: left; }
}
@media (max-width: 640px) {
  .my-row { grid-template-columns: 56px minmax(0, 1fr); }
  .my-edit { grid-column: 1 / -1; }
}

/* Petit résumé avec vignette (récapitulatif, fiche liée) */
.mini { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; }
.mini .thumb { aspect-ratio: 1; border-radius: 3px; }
.mini .thumb svg { width: 58%; }

/* ---------- Comparaison au prix neuf ---------- */
.scale { position: relative; height: 74px; margin-inline: 4px; }
.scale::before { content: ""; position: absolute; left: 0; right: 0; top: 36px; height: 4px; border-radius: 2px; background: var(--surface-2); }
.scale .fill { position: absolute; left: 0; top: 36px; height: 4px; border-radius: 2px; }
.scale .fill.good { background: var(--good); }
.scale .fill.warn { background: var(--warn); }
.scale .fill.alert { background: var(--alert); }
.mk { position: absolute; top: 0; bottom: 0; width: 0; }
.mk .pin { position: absolute; left: -7px; top: 31px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); }
.mk .pin.good { background: var(--good); }
.mk .pin.warn { background: var(--warn); }
.mk .pin.alert { background: var(--alert); }
.mk.ref .pin { left: -2px; top: 26px; width: 4px; height: 24px; border: 0; border-radius: 1px; background: var(--ink); }
.mk .lbl { position: absolute; white-space: nowrap; font: 500 13px/1.25 var(--f-mono); transform: translateX(-50%); }
.mk.cur .lbl { top: 0; }
.mk.ref .lbl { top: 54px; color: var(--muted); }
.mk .lbl.l { transform: translateX(-14px); }
.mk .lbl.r { transform: translateX(calc(-100% + 14px)); }
.price-note { font-size: 14.5px; }

/* ---------- Jauge de dossier ---------- */
.meter { display: flex; gap: 4px; }
.meter span { flex: 1; height: 8px; border-radius: 2px; background: var(--surface-2); }
.meter span.on { background: var(--ink); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 700; }

/* ---------- Note communautaire ---------- */
.rating-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rating-big .num { font: 700 54px/1 var(--f-display); }
.crit { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 2.6em; gap: 8px 12px; align-items: center; font-size: 14.5px; }
.crit .bar { height: 8px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.crit .bar span { display: block; height: 100%; background: var(--sign); }
.crit .v { font: 400 13.5px var(--f-mono); text-align: right; }

/* Liste à puces en forme de petits panneaux */
.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; font-size: 15px; }
.checklist li::before {
  content: ""; flex: none; width: 9px; height: 9px; margin-top: 7px; background: var(--sign);
  clip-path: polygon(0 0, 60% 0, 100% 50%, 60% 100%, 0 100%);
}

/* ---------- Avis ---------- */
.reviews { display: grid; gap: 14px; }
.review { display: grid; gap: 8px; padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.review-head strong { font-size: 15.5px; }
.stars { font: 400 13.5px var(--f-mono); letter-spacing: .08em; color: var(--warn); }
.review-ctx { font: 400 13.5px var(--f-mono); color: var(--muted); }
.review p { max-width: 62ch; }
details.policy { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
details.policy summary { cursor: pointer; font-weight: 700; }
details.policy p { margin-top: 10px; max-width: 62ch; color: var(--muted); font-size: 15px; }
/* Avantages débloqués par le dénivelé personnel (Mon espace) */
.perks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.perks li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }
.perks li.on { border-style: solid; border-color: var(--ink); color: var(--ink); }
.perks li span:first-child { display: inline-flex; align-items: center; gap: 6px; }

/* « Compléter la fiche » : années de production et manuel proposés par les visiteurs */
details.contrib { padding-top: 10px; border-top: 1px dashed var(--line); }
details.contrib summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
details.contrib form { margin-top: 10px; }

/* ---------- Forum ---------- */
.threads { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.thread {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 13px 16px; border-top: 1px solid var(--line);
}
.thread:first-child { border-top: 0; }
.thread:hover { background: var(--bg); }
.box .threads { border: 0; border-radius: 0; background: none; margin-inline: -16px; }
.thread-kicker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ttype { font: 500 12px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.thread-title { margin-top: 4px; font-weight: 700; font-size: 16px; line-height: 1.3; }
.thread-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.replies {
  display: grid; justify-items: center; min-width: 56px; padding: 6px 8px; border-radius: var(--r);
  background: var(--surface-2); font: 500 16px/1.1 var(--f-mono);
}
.replies small { font: 400 11.5px/1.2 var(--f-body); color: var(--muted); }

.posts { display: grid; gap: 12px; min-width: 0; }
.post { display: grid; gap: 8px; padding: 15px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.post.op { border-color: var(--ink); }
.post p { max-width: 65ch; }
.post-head { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.post-head strong { font-size: 15.5px; }
.owner { padding: 3px 7px; border-radius: 3px; background: var(--sign); color: var(--sign-ink); font: 500 12px/1.2 var(--f-mono); }
.owner.pro { background: var(--surface-2); color: var(--ink); }
.post-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.helpful {
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.helpful:hover { border-color: var(--muted); }
.helpful[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Achat ---------- */
.recap { display: grid; gap: 9px; font-size: 15px; }
.recap-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.recap-line > span:last-child { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.recap-total { padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; font-size: 17px; }
.code {
  display: inline-block; padding: 10px 14px 10px 18px;
  background: var(--sign); color: var(--sign-ink);
  font: 500 30px/1 var(--f-mono); letter-spacing: .2em;
}
/* Étapes numérotées (ordre réel des opérations) */
.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15.5px; }
.steps-list li::before {
  content: counter(s); display: grid; place-items: center; width: 30px; height: 30px;
  background: var(--sign); color: var(--sign-ink); font: 700 18px/1 var(--f-display);
}
