/* ==========================================================================
   Outil d'avis guidés — charte Refonte Up
   Mobile-first. Aucune dépendance.
   ========================================================================== */

:root {
  /* Charte */
  --vert: #3f4438;
  --encre: #2b2b2a;
  --sable: #e6e3dc;
  --gris: #8f8e87;   /* décoratif uniquement : 2.56:1 sur --sable, insuffisant pour du texte */
  --dore: #9b8b5a;   /* décoratif uniquement : 2.63:1 sur --sable */

  /* Dérivés nécessaires au contraste et aux surfaces */
  --surface: #fbfaf7;              /* carte, blanc chaud */
  --gris-texte: #63625f;           /* gris charte assombri, 4.76:1 sur --sable, 5.9:1 sur --surface */
  --vert-clair: #58604d;           /* survol */
  --alerte-texte: #96261d;         /* rouge : consigne de collage et erreurs */
  --alerte-fond: #fdecea;
  --alerte-bord: #f0c0b9;
  --bordure: rgba(143, 142, 135, .38);
  --bordure-forte: rgba(143, 142, 135, .7);

  --rayon: 14px;
  --rayon-pill: 100px;
  --ombre: 0 1px 2px rgba(43, 43, 42, .05), 0 8px 24px rgba(43, 43, 42, .06);
  --transition: 160ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

/* Toute classe posant un display (.actions, .chips) bat la règle navigateur
   de l'attribut hidden. Le JS pilote l'affichage par hidden : il doit gagner. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--sable);
  color: var(--encre);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Accessibilité ---------- */

.saut-lien {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--vert);
  color: var(--sable);
  padding: 12px 18px;
  border-radius: 0 0 var(--rayon) 0;
  text-decoration: none;
  font-weight: 600;
}
.saut-lien:focus { left: 0; }

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

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

/* ---------- Bandeau ---------- */

.bandeau {
  background: var(--vert);
  color: var(--sable);
  padding: 14px 20px;
}
.bandeau__inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bandeau__marque {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

/* Le logo hérite de la couleur du bandeau via fill="currentColor". */
.bandeau__logo {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.bandeau__nom {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.2px;
}

/* Le logo porte déjà le nom : on masque le texte quand il est là.
   Retirez le svg du bandeau et le nom réapparaît. */
.bandeau__logo + .bandeau__nom { display: none; }
.bandeau__badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--vert);
  background: var(--dore);
  padding: 3px 10px;
  border-radius: var(--rayon-pill);
}

/* ---------- Page ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.carte {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 22px 18px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.carte::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--dore);
}

@media (min-width: 640px) {
  .page { padding: 32px 20px 56px; }
  .carte { padding: 30px 28px; }
}

/* ---------- Typo ---------- */

.titre {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.4px;
  margin: 0 0 8px;
}
@media (min-width: 640px) { .titre { font-size: 26px; } }

.chapo {
  margin: 0 0 20px;
  color: var(--gris-texte);
  font-size: 15px;
}

.legende, .label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--gris-texte);
  margin: 0 0 10px;
  padding: 0;
}

.aide {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--gris-texte);
}
.aide--alerte { color: var(--alerte-texte); font-weight: 600; }

.mention {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--bordure);
  font-size: 13px;
  color: var(--gris-texte);
}

.progression {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gris-texte);
}

.bloc { border: 0; margin: 0; padding: 0; }

/* ---------- Étoiles ---------- */

.etoiles {
  display: flex;
  gap: 6px;
}
.etoile { position: relative; }
.etoile input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.etoile svg {
  display: block;
  width: 46px;
  height: 46px;
  fill: transparent;
  stroke: var(--gris);
  stroke-width: 1.5;
  transition: fill var(--transition), stroke var(--transition), transform var(--transition);
}
@media (min-width: 640px) { .etoile svg { width: 52px; height: 52px; } }

.etoile input:checked ~ svg,
.etoile.est-allumee svg {
  fill: var(--dore);
  stroke: var(--dore);
}
.etoile input:focus-visible ~ svg {
  outline: 3px solid var(--dore);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (hover: hover) {
  .etoile:hover svg { transform: scale(1.06); }
}

.note-libelle {
  min-height: 22px;
  margin: 12px 0 0;
  font-weight: 700;
  font-size: 15px;
}

/* ---------- Chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip { position: relative; display: inline-flex; }
.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-block;
  padding: 10px 15px;
  border: 1px solid var(--bordure-forte);
  border-radius: var(--rayon-pill);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--encre);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.chips--fin span { font-size: 13px; padding: 8px 13px; }

.chip input:checked ~ span {
  background: var(--vert);
  border-color: var(--vert);
  color: var(--sable);
}
.chip input:focus-visible ~ span {
  outline: 3px solid var(--dore);
  outline-offset: 2px;
}
.chip input:disabled ~ span {
  opacity: .4;
  cursor: not-allowed;
}
@media (hover: hover) {
  .chip input:not(:disabled):not(:checked):hover ~ span { border-color: var(--vert); }
}

/* ---------- Champs ---------- */

.select, .champ {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 16px; /* 16px minimum : évite le zoom auto sur iOS */
  color: var(--encre);
  background: #fff;
  border: 1px solid var(--bordure-forte);
  border-radius: 10px;
  transition: border-color var(--transition);
}
.select:hover, .champ:hover { border-color: var(--vert); }
.champ--zone { resize: vertical; line-height: 1.65; min-height: 140px; }
.champ::placeholder { color: var(--gris-texte); opacity: .8; }

#bloc-ville-libre { margin-top: 16px; }

/* ---------- Boutons ---------- */

.actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.actions--pile { flex-direction: column; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--rayon-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}
.btn--primaire {
  flex: 1;
  background: var(--vert);
  color: var(--sable);
}
.btn--fantome {
  background: transparent;
  border-color: var(--bordure-forte);
  color: var(--encre);
}
@media (hover: hover) {
  .btn--primaire:hover { background: var(--vert-clair); }
  .btn--fantome:hover { border-color: var(--vert); }
}
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
}
.btn--charge::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tourne .7s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

.lien-discret {
  color: var(--gris-texte);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .lien-discret:hover { color: var(--encre); }
}

/* ---------- Consigne de collage ----------
   Rouge assumé, hors charte : c'est le seul point du parcours où le client
   peut décrocher. #96261d sur #fdecea = 7.08:1, largement au-dessus de AA. */

.consigne {
  background: var(--alerte-fond);
  color: var(--alerte-texte);
  border: 1px solid var(--alerte-bord);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.consigne strong { font-weight: 800; }

/* ---------- Précisions (mode pro) ---------- */

.precisions {
  margin-top: 18px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  padding: 12px 14px;
}
.precisions[open] { padding-bottom: 18px; }
.precisions__titre {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--gris-texte);
}
.precisions .label { margin-top: 16px; }

/* ---------- Pied ---------- */

.pied {
  padding: 18px 20px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--gris-texte);
}
.pied p { margin: 0; }

/* ---------- Apparition d'étape ---------- */

.etape { animation: apparait 220ms ease both; }
@keyframes apparait {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
