/* Grenier — feuille de style.
   Parti pris : fond clair, tres gros texte, cibles tactiles de 64px.
   L'utilisateur vise a 70 ans et lit mal les themes sombres a petite police. */

:root {
  --fond: #f6f4ef;
  --carte: #ffffff;
  --trait: #ded8cc;
  --texte: #1b1a17;
  --texte-doux: #57534e;
  --vert: #1f7a4d;
  --vert-fonce: #175c3a;
  --ambre: #b45309;
  --rouge: #b91c1c;
  --leboncoin: #f56b2a;
  --vinted: #007782;
  --rayon: 16px;
  --ombre: 0 2px 10px rgba(28, 25, 23, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 19px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  /* clip et non hidden : hidden creerait un conteneur de defilement qui casse
     position:sticky de la barre d'action et de l'en-tete. Meme piege que sur Radar. */
  overflow-x: clip;
}

/* ---------- Barre du haut ---------- */
.barre {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--vert);
  color: #fff;
  box-shadow: var(--ombre);
}

.marque {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .5px;
}

.icone-bouton {
  min-width: 52px;
  min-height: 52px;
  font-size: 1.7rem;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}

.icone-bouton:active { background: rgba(255, 255, 255, .3); }

/* ---------- Ecrans ---------- */
#principal {
  max-width: 620px;
  margin: 0 auto;
  padding: 22px 18px calc(40px + env(safe-area-inset-bottom));
}

.ecran { display: none; }
.ecran.actif { display: block; }

.titre-ecran {
  margin: 0 0 8px;
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 800;
}

.sous-titre {
  margin: 0 0 24px;
  color: var(--texte-doux);
  font-size: 1.05rem;
}

/* ---------- Gros boutons ---------- */
.gros-bouton {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  margin-bottom: 14px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--rayon);
  cursor: pointer;
}

.gros-bouton-icone { font-size: 1.9rem; line-height: 1; flex: 0 0 auto; }

.gros-bouton.principal {
  background: var(--vert);
  color: #fff;
  box-shadow: var(--ombre);
}
.gros-bouton.principal:active { background: var(--vert-fonce); }

.gros-bouton.secondaire {
  background: var(--carte);
  color: var(--texte);
  border-color: var(--trait);
}
.gros-bouton.secondaire:active { background: #efece5; }

.gros-bouton.discret {
  min-height: 60px;
  background: transparent;
  color: var(--texte-doux);
  font-size: 1.05rem;
  font-weight: 600;
  justify-content: center;
  text-align: center;
}
.gros-bouton.discret:active { background: rgba(0, 0, 0, .05); }

.pastille {
  display: inline-block;
  min-width: 30px;
  margin-left: 6px;
  padding: 1px 9px;
  background: var(--ambre);
  color: #fff;
  font-size: .95rem;
  text-align: center;
  border-radius: 999px;
}

/* ---------- Avertissement ---------- */
.avert {
  display: block;
  margin-top: 18px;
  padding: 16px 18px;
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: var(--rayon);
  font-size: 1.05rem;
}
.avert strong { display: block; margin-bottom: 4px; }

/* ---------- Analyse ---------- */
.apercu {
  display: block;
  width: 100%;
  max-height: 260px;
  margin-bottom: 22px;
  object-fit: contain;
  background: #e7e2d8;
  border-radius: var(--rayon);
}

.etapes {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.etapes li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  font-size: 1.1rem;
  color: var(--texte-doux);
}

.puce {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  background: #fff;
  border: 3px solid var(--trait);
  border-radius: 50%;
}

.etapes li.en-cours { color: var(--texte); font-weight: 700; }
.etapes li.en-cours .puce {
  border-color: var(--vert);
  border-top-color: transparent;
  animation: tourne .9s linear infinite;
}

.etapes li.faite { color: var(--vert-fonce); font-weight: 600; }
.etapes li.faite .puce {
  background: var(--vert);
  border-color: var(--vert);
  position: relative;
}
.etapes li.faite .puce::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

@keyframes tourne { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .etapes li.en-cours .puce { animation: none; border-top-color: var(--vert); }
}

.patience { color: var(--texte-doux); font-size: 1rem; }

/* ---------- Resultat ---------- */
.entete-resultat {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.vignette {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  object-fit: cover;
  background: #e7e2d8;
  border-radius: var(--rayon);
}

.titre-objet {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 800;
}

.etat-objet {
  margin: 4px 0 0;
  color: var(--texte-doux);
  font-size: 1rem;
}

.carte {
  margin-bottom: 16px;
  padding: 18px;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}

.etiquette {
  margin: 0 0 10px;
  color: var(--texte-doux);
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.carte-prix { text-align: center; }

.prix-principal {
  margin: 0;
  color: var(--vert);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.1;
}

.prix-fourchette {
  margin: 6px 0 0;
  font-size: 1.05rem;
  color: var(--texte-doux);
}

.confiance {
  margin: 12px 0 0;
  padding: 8px 12px;
  font-size: .98rem;
  border-radius: 10px;
}
.confiance.bonne { background: #dcfce7; color: #14532d; }
.confiance.moyenne { background: #fef3c7; color: #78350f; }
.confiance.faible { background: #fee2e2; color: #7f1d1d; }

.justification {
  margin: 0 0 12px;
  font-size: 1.02rem;
  color: var(--texte);
}

/* Annonces reellement vues par l'IA : la preuve concrete, plus parlante qu'un nom de domaine */
.annonces-vues {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.annonces-vues li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #f3f1ea;
  border-radius: 10px;
  font-size: .98rem;
}

.annonces-vues .av-quoi { flex: 1 1 auto; min-width: 0; }

.annonces-vues .av-prix {
  flex: 0 0 auto;
  color: var(--vert-fonce);
  font-weight: 800;
  white-space: nowrap;
}

.mention-recherche {
  margin: 0 0 12px;
  color: var(--texte-doux);
  font-size: .9rem;
  font-style: italic;
}

.sources {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.sources li { margin-bottom: 8px; }
.sources a {
  display: block;
  padding: 10px 12px;
  background: #f3f1ea;
  color: var(--vert-fonce);
  font-size: .98rem;
  text-decoration: none;
  border-radius: 10px;
  word-break: break-word;
}

.lien-verif {
  display: block;
  min-height: 60px;
  padding: 17px 16px;
  background: #eef7f2;
  color: var(--vert-fonce);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--vert);
  border-radius: 12px;
}

/* ---------- Plateformes ---------- */
.choix-plateforme { display: grid; gap: 12px; }

.plateforme {
  display: block;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  font-family: inherit;
  text-align: left;
  background: #f3f1ea;
  border: 3px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}

.plateforme-nom {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--texte);
}

.plateforme-quoi {
  display: block;
  margin-top: 2px;
  font-size: .95rem;
  color: var(--texte-doux);
}

.plateforme[aria-checked="true"] { background: #fff; }
.plateforme[data-plateforme="leboncoin"][aria-checked="true"] { border-color: var(--leboncoin); }
.plateforme[data-plateforme="leboncoin"][aria-checked="true"] .plateforme-nom { color: #c2410c; }
.plateforme[data-plateforme="vinted"][aria-checked="true"] { border-color: var(--vinted); }
.plateforme[data-plateforme="vinted"][aria-checked="true"] .plateforme-nom { color: var(--vinted); }

.pourquoi {
  margin: 12px 0 0;
  font-size: .98rem;
  color: var(--texte-doux);
}

/* ---------- Textes d'annonce ---------- */
.texte-annonce {
  margin: 0 0 14px;
  padding: 14px;
  background: #f9f8f4;
  border: 1px dashed var(--trait);
  border-radius: 10px;
  font-size: 1.05rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.bouton-copier {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--texte);
  text-align: center;
  text-decoration: none;
  background: #eceae2;
  border: 2px solid var(--trait);
  border-radius: 12px;
  cursor: pointer;
}
.bouton-copier:active { background: #ddd9cd; }
.bouton-copier.grand { min-height: 64px; font-size: 1.1rem; }
.bouton-copier.accent {
  background: var(--vert);
  color: #fff;
  border-color: var(--vert);
}
.bouton-copier.accent:active { background: var(--vert-fonce); }
.bouton-copier.fait {
  background: #dcfce7;
  border-color: var(--vert);
  color: #14532d;
}

/* Barre d'action collee en bas, pour que "Mettre en vente" soit toujours atteignable */
.barre-action {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 8px -18px calc(-40px - env(safe-area-inset-bottom));
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(246, 244, 239, 0), var(--fond) 22%);
}

.barre-action .gros-bouton { margin-bottom: 0; }

/* ---------- Guide de mise en vente ---------- */
.guide {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: pas;
}

.guide-pas {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}

.guide-pas > div { flex: 1 1 auto; min-width: 0; }

.guide-num {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--vert);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  border-radius: 50%;
}

.guide-titre {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.guide-aide {
  margin: 0 0 12px;
  color: var(--texte-doux);
  font-size: 1rem;
}

/* ---------- Mes objets ---------- */
.liste-objets {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.objet {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 12px;
  padding: 14px;
  font-family: inherit;
  text-align: left;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  cursor: pointer;
}

.objet img {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  object-fit: cover;
  background: #e7e2d8;
  border-radius: 12px;
}

.objet-infos { flex: 1 1 auto; min-width: 0; }

.objet-nom {
  display: block;
  font-size: 1.08rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.objet-prix {
  display: block;
  margin-top: 2px;
  color: var(--vert);
  font-size: 1.05rem;
  font-weight: 700;
}

.badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  font-size: .88rem;
  font-weight: 700;
  border-radius: 999px;
}
.badge.a-vendre { background: #f3f1ea; color: var(--texte-doux); }
.badge.en-ligne { background: #dbeafe; color: #1e40af; }
.badge.vendu { background: #dcfce7; color: #14532d; }

.vide {
  padding: 30px 16px;
  color: var(--texte-doux);
  text-align: center;
  font-size: 1.05rem;
}

/* ---------- Reglages ---------- */
.champ {
  display: block;
  width: 100%;
  min-height: 60px;
  margin-bottom: 14px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--texte);
  background: #f9f8f4;
  border: 2px solid var(--trait);
  border-radius: 12px;
}
.champ:focus { outline: 3px solid var(--vert); outline-offset: 1px; }

.retour-test {
  margin: 12px 0 0;
  font-size: 1.02rem;
  font-weight: 600;
}
.retour-test.ok { color: var(--vert-fonce); }
.retour-test.ko { color: var(--rouge); }

.version {
  margin: 24px 0 8px;
  color: var(--texte-doux);
  font-size: .92rem;
  text-align: center;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: 90vw;
  padding: 16px 22px;
  transform: translateX(-50%);
  background: #1b1a17;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .3);
}

/* ---------- Focus visible partout ---------- */
button:focus-visible,
a:focus-visible,
label:focus-visible {
  outline: 3px solid var(--vert);
  outline-offset: 2px;
}
