/* La Manivelle — pages publiques (inscription, connexion, compte). */

/* Police Plus Jakarta Sans hébergée sur notre serveur : aucun appel à Google (confidentialité des visiteurs). */
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --police: 'Plus Jakarta Sans', system-ui, sans-serif;
  --fond: #f1f2f5;
  --carte: #ffffff;
  /* Couleurs de manivelle.ch : texte #2A313C, orange des boutons d'action #F3A00A. */
  --texte: #2a313c;
  --texte-doux: #5c6371;
  --bordure: #cfd3da;
  --bordure-forte: #9aa1ad;
  --accent: #f3a00a;          /* boutons d'action (CTA), étape en cours, choix sélectionné */
  --accent-fonce: #db8f08;    /* survol */
  --accent-clair: #fdf4e3;    /* fonds légers */
  --texte-sur-accent: #2a313c;/* texte foncé sur orange : contraste ~7:1 (le blanc n'atteint que 2,3:1) */
  --lien: #9a5b00;            /* liens : orange foncé, lisible sur blanc (contraste ≥ 4,5:1) */
  --erreur: #a8322a;          /* refus / interdiction : rouge sobre, pas flashy */
  --erreur-fond: #fbeeec;
  --ok: #1d7a47;              /* validation : vert (convention internationale) */
  --ok-fond: #e8f5ee;
  --attente: #8a5a00;
  --attente-fond: #fdf4e3;
  --rayon: 10px;
}

* { box-sizing: border-box; }
html { background: var(--fond); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 var(--police);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 48px;
}
[hidden] { display: none !important; }
p { margin: 0; }
a { color: var(--lien); }

.logo { display: block; width: 190px; margin-bottom: 28px; }
.logo img { display: block; width: 100%; height: auto; }

.carte {
  width: 100%;
  max-width: 480px;
  background: var(--carte);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 4px 16px rgb(16 24 40 / 0.06);
}
h1 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
h1 .h1-note { font-size: 0.8rem; font-weight: 500; letter-spacing: 0; color: var(--texte-doux); white-space: nowrap; }
h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.sous-titre { color: var(--texte-doux); margin-bottom: 22px; }

/* Indicateur d'étapes */
.etapes { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 24px; }
.etapes li { flex: 1; font-size: 0.78rem; color: var(--texte-doux); }
.etapes li::before {
  content: ''; display: block; height: 4px; border-radius: 4px; background: var(--bordure); margin-bottom: 6px;
}
.etapes li.faite::before { background: var(--ok); }
.etapes li.active { color: var(--texte); font-weight: 600; }
.etapes li.active::before { background: var(--accent); }

/* Encadré « Comment ça marche » */
.explication { background: var(--accent-clair); border-radius: var(--rayon); padding: 16px 18px; margin-bottom: 24px; }
.explication summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.explication summary::-webkit-details-marker { display: none; }
.explication summary::after { content: '+'; font-weight: 400; font-size: 1.2rem; line-height: 1; }
.explication[open] summary::after { content: '–'; }
.explication ol { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 0.93rem; }
.explication small { display: block; margin-top: 10px; }

.etape { display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.93rem; font-weight: 600; }
.obl { color: var(--erreur); font-weight: 600; margin-left: 2px; }
.legende { color: var(--texte-doux); font-size: 0.82rem; margin-top: -6px; }
small { color: var(--texte-doux); font-size: 0.82rem; font-weight: 400; }
.ligne { display: flex; gap: 12px; }
.ligne > label { flex: 1; min-width: 0; }
.ligne > label.court { flex: 0 0 110px; }

input, select {
  font: inherit; font-weight: 400; color: inherit;
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--bordure); border-radius: var(--rayon); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover { border-color: var(--bordure-forte); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(243 160 10 / 0.3); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--erreur); }
select {
  appearance: none; padding-right: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231b1f27' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
}

.case { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 400; cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

button, .bouton {
  font: inherit; font-weight: 600; height: 48px; padding: 0 20px;
  border: 0; border-radius: var(--rayon); cursor: pointer;
  background: var(--accent); color: var(--texte-sur-accent); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
button:hover, .bouton:hover { background: var(--accent-fonce); }
button:disabled { opacity: 0.6; cursor: wait; }
.secondaire { background: transparent; color: var(--lien); border: 1px solid var(--bordure); }
.secondaire:hover { background: var(--accent-clair); }
button.lien { background: none; color: var(--lien); height: auto; padding: 4px; font-weight: 500; text-decoration: underline; }
button.lien:disabled { color: var(--texte-doux); text-decoration: none; cursor: default; }

.suggestions-titre { display: block; margin: 10px 0 6px; font-weight: 600; }
.suggestion { display: block; width: 100%; height: auto; min-height: 40px; margin-top: 6px; padding: 8px 12px; text-align: left;
  background: #fff; color: var(--texte); border: 1px solid var(--bordure); font-weight: 500; }
.suggestion:hover { background: var(--accent-clair); border-color: var(--accent); }
.erreur { background: var(--erreur-fond); color: var(--erreur); border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 20px; font-size: 0.93rem; }
.info { background: var(--accent-clair); border-radius: var(--rayon); padding: 12px 14px; font-size: 0.93rem; }
.info.neutre { background: #f3f4f6; }
.documents { margin: 8px 0 0; padding-left: 20px; }
.confidentialite { font-size: 0.88rem; color: var(--texte-doux); }

/* Choix en boutons (Genre) */
.choix { border: 0; padding: 0; margin: 0; min-width: 0; }
.choix legend { padding: 0; margin-bottom: 8px; font-size: 0.93rem; font-weight: 600; }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastilles label { display: block; font-weight: 500; cursor: pointer; }
.pastilles input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pastilles span {
  display: inline-block; padding: 10px 14px; border: 1px solid var(--bordure); border-radius: 999px;
  font-size: 0.9rem; transition: background 0.15s, border-color 0.15s;
}
.pastilles label:hover span { border-color: var(--bordure-forte); }
.pastilles input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--texte-sur-accent); font-weight: 600; }
.pastilles input:focus-visible + span { box-shadow: 0 0 0 3px rgb(243 160 10 / 0.35); }
.champ-naissance input { max-width: 200px; }

/* Autocomplétion de l'adresse */
.autocompletion { position: relative; }
.propositions {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 6px; list-style: none; max-height: 280px; overflow-y: auto;
  background: #fff; border: 1px solid var(--bordure); border-radius: var(--rayon);
  box-shadow: 0 8px 24px rgb(16 24 40 / 0.12);
}
.propositions li { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 0.93rem; }
.propositions li span { color: var(--texte-doux); }
.propositions li:hover, .propositions li[aria-selected="true"] { background: var(--accent-clair); }

/* Champ piège : hors de l'écran (certains robots ignorent display:none). */
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.champ-code { height: 60px; font-size: 1.8rem; letter-spacing: 0.45em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Dépôt de facture */
.depot {
  border: 2px dashed var(--bordure); border-radius: var(--rayon); padding: 24px 16px;
  text-align: center; cursor: pointer; align-items: center; position: relative; font-weight: 400;
}
.depot:hover, .depot:focus-within { border-color: var(--accent); background: var(--accent-clair); }
.depot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.depot-texte { color: var(--lien); font-weight: 700; }
.info-fichier { font-size: 0.88rem; color: var(--texte-doux); }

.resultat { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.resultat .icone { font-size: 2.6rem; line-height: 1; }
.pass { color: var(--ok); font-weight: 700; }

/* Espace membre */
.statuts { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.statut { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--rayon); background: #f6f7f9; }
.statut .pastille { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; color: #fff; background: var(--bordure-forte); }
.statut.ok .pastille { background: var(--ok); }
.statut.attente .pastille { background: #d4930d; }
.statut.a-faire .pastille { background: var(--accent); color: var(--texte-sur-accent); }
.statut strong { display: block; }
.statut span { color: var(--texte-doux); font-size: 0.9rem; }
.statut button.lien { display: block; margin-top: 4px; padding: 0; font-size: 0.88rem; }

.liens-bas { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; font-size: 0.93rem; }
.liens-bas a { text-decoration: none; font-weight: 600; }
.liens-bas a:hover { text-decoration: underline; }

.texte-long { display: flex; flex-direction: column; gap: 14px; }
.texte-long ul { margin: 0; padding-left: 20px; }
.provisoire { background: var(--attente-fond); border-radius: var(--rayon); padding: 12px 14px; font-size: 0.9rem; }

@media (max-width: 480px) {
  body { padding-top: 20px; }
  .logo { width: 160px; margin-bottom: 20px; }
  .carte { padding: 24px 18px; border-radius: 14px; }
  .ligne:not(.garder) { flex-direction: column; gap: 18px; }
  .ligne > label.court { flex: none; }
}

/* « Merci Prénom ! » : entre le titre (25,6 px) et le texte (16 px). */
.remerciement { font-size: 1.25rem; font-weight: 700; }
