/* Mise en page de l'app, par-dessus le design system (bundle.css). Uniquement des variables des jetons. */
html { background: var(--fond); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); }
:where(.mjp a) { color: var(--vert-texte); }
:where(.mjp a:not(.mjp-btn--principal)):hover { color: var(--encre); }
.mjp ul, .mjp ol { margin: 0; padding: 0; list-style: none; }
.mjp b, .mjp strong { font-weight: 700; }
.mjp em, .mjp i, .mjp cite { font-style: normal; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app[data-taille="1"] { zoom: 1.15; }
#app[data-taille="2"] { zoom: 1.3; }
#app[data-taille="3"] { zoom: 1.5; }

.mjp-evitement { position: absolute; left: 8px; top: -200px; padding: var(--espace-3) var(--espace-4); background: var(--surface); border-radius: var(--rayon-champ); z-index: 10; font-weight: 700; }
.mjp-evitement:focus { top: 8px; }

.mjp-barre { width: 100%; max-width: var(--largeur-colonne); margin: 0 auto; padding: var(--espace-4) var(--espace-5) 0; }
.mjp-barre .mjp-outils { justify-content: space-between; }
.mjp-outils__taille button:disabled { color: var(--texte-2); background: var(--surface-2); cursor: not-allowed; }
.mjp-outils .mjp-btn[aria-disabled="true"] { color: var(--texte-2); cursor: not-allowed; }

.mjp-ecran { width: 100%; flex: 1; gap: 20px; padding-top: var(--espace-5); }
.mjp-ecran:focus { outline: none; }
.mjp-ecran h1:focus, .mjp-ecran legend h1:focus { outline: none; }
.mjp-ecran h1:focus-visible { outline: var(--focus-epaisseur) solid var(--focus); outline-offset: 3px; }
.mjp-pied-page { width: 100%; max-width: var(--largeur-colonne); margin: 0 auto; padding: var(--espace-5); border-top: 2px solid var(--ligne-douce); display: flex; flex-direction: column; gap: var(--espace-2); }

.mjp-logo { display: block; height: 40px; width: auto; align-self: flex-start; }
.mjp-pile { display: flex; flex-direction: column; gap: var(--espace-3); }
.mjp-pile--serree { gap: var(--espace-2); }
.mjp-centre { text-align: center; align-self: center; }

/* Accueil */
.mjp-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mjp-themes li { display: flex; align-items: center; gap: 10px; min-height: var(--cible-min); padding: 0 14px; background: var(--surface); border: 2px solid var(--ligne-douce); border-radius: var(--rayon-choix); font-weight: 700; overflow-wrap: anywhere; }
.mjp-themes .mjp-ico, .mjp-coches .mjp-ico { color: var(--vert-texte); }
.mjp-coches { display: flex; flex-direction: column; gap: var(--espace-2); }
.mjp-coches li { display: flex; gap: var(--espace-3); align-items: center; }

/* Question */
.mjp-choix legend { font-size: 32px; line-height: 1.22; }
.mjp-choix legend h1 { font: inherit; margin: 0; }
.mjp-choix legend.mjp-titre-3 { font-size: 23px; line-height: 1.3; margin-bottom: var(--espace-2); }
.mjp-choix__aide { font-size: 17px; color: var(--texte-2); margin-top: -10px; }
.mjp-choix label > span { display: block; }
.mjp-erreur { display: flex; gap: var(--espace-3); align-items: flex-start; padding: var(--espace-3) var(--espace-4); border-radius: var(--rayon-choix); background: var(--alerte-doux); border: 2px solid var(--alerte); color: var(--encre); font-weight: 700; }
.mjp-erreur .mjp-ico { color: var(--alerte); }
.mjp-erreur[hidden] { display: none; }
.mjp-champ__ou[aria-expanded="false"] .mjp-champ__ou-reponse { display: none; }
.mjp-champ__ou .mjp-champ__ou-titre { font-size: 19px; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.mjp-champ__ou .mjp-champ__ou-reponse { font-size: 17px; color: var(--texte-2); }
.mjp-champ__saisie input::placeholder { color: var(--texte-2); }
.mjp-btn--lien { font-size: 20px; }

/* Pastille « N pistes trouvées · Voir » */
.mjp-pastille-pistes { align-self: flex-start; display: flex; align-items: center; gap: 10px; min-height: var(--cible-min); padding: 0 18px 0 12px; border-radius: var(--rayon-pastille); background: var(--surface); border: 2px solid var(--ligne-douce); color: var(--encre); text-decoration: none; font-weight: 700; }
.mjp a.mjp-pastille-pistes { color: var(--encre); }
.mjp-pastille-pistes__voir { color: var(--vert-texte); text-decoration: underline; text-underline-offset: 4px; }
.mjp-bandeau { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-radius: var(--rayon-choix); background: var(--vert-doux); }
.mjp-bandeau .mjp-ico { color: var(--vert-texte); margin-top: 2px; }

/* Bilan */
.mjp-heros--carte { background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); padding: var(--espace-5) var(--espace-4); }
.mjp-heros__une-fois { font-family: var(--font-titre); font-weight: 800; font-size: 24px; margin-top: var(--espace-2); }
.mjp-heros__une-fois span { font-family: var(--font-texte); font-size: 20px; font-weight: 700; color: var(--texte-2); }
.mjp-encart { background: var(--surface-2); border-radius: var(--rayon-choix); padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.mjp-encart p + p { font-size: 18px; line-height: 1.5; }
.mjp-resultat--ligne .mjp-resultat__montant { grid-row: 1 / span 4; }
.mjp-resultat__surtitre { display: flex; align-items: center; gap: var(--espace-2); }
.mjp-resultat__surtitre .mjp-ico { width: 22px; height: 22px; }
a.mjp-resultat { text-decoration: none; color: var(--encre); }
.mjp a.mjp-resultat { color: var(--encre); }
a.mjp-resultat .mjp-resultat__detail { text-decoration: underline; text-underline-offset: 4px; }
.mjp-exemple { font-size: 17px; color: var(--texte-2); }
.mjp-piste__tete { display: flex; justify-content: space-between; align-items: center; gap: var(--espace-2); flex-wrap: wrap; }
.mjp-resultat .mjp-btn--lien { align-self: flex-start; padding-left: 0; }

/* Détail d'une aide */
.mjp-etapes { display: flex; flex-direction: column; gap: 10px; counter-reset: etape; }
.mjp-etapes li { display: flex; gap: var(--espace-3); align-items: flex-start; }
.mjp-etapes li::before { counter-increment: etape; content: counter(etape); width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; flex: none; }

/* Mon espace */
.mjp-carte { background: var(--surface); border: 2px solid var(--ligne-douce); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); padding: 20px; display: flex; flex-direction: column; gap: var(--espace-3); }
.mjp-carte--pointilles { border: 2px dashed var(--ligne); box-shadow: none; background: transparent; }
.mjp-enveloppe { display: flex; justify-content: space-between; align-items: baseline; gap: var(--espace-3); flex-wrap: wrap; }
.mjp-enveloppe > span { display: flex; flex-direction: column; }
.mjp-enveloppe__obtenu { font-family: var(--font-titre); font-weight: 800; font-size: 40px; color: var(--vert-texte); line-height: 1.1; }
.mjp-enveloppe__possible { font-family: var(--font-titre); font-weight: 800; font-size: 28px; line-height: 1.1; }
.mjp-barre-progres { height: 16px; border-radius: 8px; background: var(--surface-2); overflow: hidden; display: flex; border: 1px solid var(--ligne); }
.mjp-barre-progres span { background: var(--vert-action); }
.mjp-pistes li { display: flex; justify-content: space-between; align-items: center; gap: var(--espace-3); min-height: 64px; padding: 10px 16px; background: var(--surface); border: 2px solid var(--ligne-douce); border-radius: var(--rayon-choix); }
.mjp-pistes { display: flex; flex-direction: column; gap: 10px; }
.mjp-pistes b { display: block; }
.mjp-texte-encre { color: var(--encre); }
.mjp-statut { flex: none; }
.mjp-statut--obtenu { background: var(--or); color: var(--sur-or); }

@media (max-width: 420px) {
  .mjp { font-size: 18px; }
  .mjp-barre { padding-left: var(--espace-4); padding-right: var(--espace-4); }
  .mjp-ecran { padding-left: var(--espace-4); padding-right: var(--espace-4); }
  .mjp-titre-1 { font-size: 32px; }
  .mjp-outils .mjp-btn { padding: 0 var(--espace-4); }
}

.mjp [hidden] { display: none !important; }
.mjp-droite { text-align: right; }

/* Mes réponses : libellé et réponse à gauche, « Modifier » à droite */
.mjp-reponses li > span { display: flex; flex-direction: column; min-width: 0; }
.mjp-reponses .mjp-btn--lien { flex: none; padding: 0 var(--espace-2); }
.mjp-message--alerte .mjp-pile { flex: 1; min-width: 0; }
.mjp-message--alerte .mjp-btn--secondaire { background: var(--surface); }

/* ---------- « Le révélateur » (21/11/2026) : la marque plus présente, toujours avec les jetons du design system ---------- */

/* Le petit rond et sa part, en écho au logo (décor). */
.mjp-part { flex: none; }
.mjp-part__rond { fill: var(--nuit); }
.mjp-part__part { fill: var(--vert); }

/* Accueil */
.mjp-badge { align-self: flex-start; display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border-radius: var(--rayon-pastille); background: var(--vert-doux); color: var(--vert-texte); font-weight: 700; font-size: 17px; margin: 0; }
.mjp-accueil__titre { font-size: 38px; line-height: 1.12; letter-spacing: -0.015em; }
.mjp-signature { font-family: var(--font-titre); font-weight: 800; font-size: 21px; line-height: 1.3; margin: 0; }
.mjp-signature__vert { color: var(--vert-texte); }
.mjp-signature__or { color: var(--or-texte); }
.mjp-defile { display: flex; gap: var(--espace-3); overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px var(--espace-2); margin: 0 -2px; border-radius: var(--rayon-carte); }
.mjp-defile:focus-visible { outline: var(--focus-epaisseur) solid var(--focus); outline-offset: 3px; }
.mjp-saviez { flex: 0 0 min(270px, 78%); box-sizing: border-box; scroll-snap-align: start; border-radius: var(--rayon-carte); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.mjp-saviez__texte { font-family: var(--font-titre); font-weight: 800; font-size: 22px; line-height: 1.2; margin: 0; }
.mjp-saviez__sous { font-size: 17px; margin: 0; }
.mjp-saviez--nuit { background: var(--nuit); color: var(--sur-nuit); }
.mjp-saviez--nuit .mjp-saviez__sous { color: var(--surface-2); }
.mjp-saviez--nuit .mjp-part__rond { fill: var(--or); }
.mjp-saviez--nuit .mjp-part__part { fill: var(--sur-nuit); }
.mjp-saviez--or { background: var(--or-doux); color: var(--encre); }
.mjp-saviez--or .mjp-part__part { fill: var(--or); }
.mjp-saviez--vert { background: var(--vert-doux); color: var(--encre); }
.mjp-saviez--or .mjp-saviez__sous, .mjp-saviez--vert .mjp-saviez__sous { color: var(--texte-2); }

/* Question : l'enveloppe qui se remplit, et la piste qui s'allume */
.mjp-enveloppe-pastille { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; min-height: var(--cible-min); padding: 0 18px 0 10px; border-radius: var(--rayon-pastille); background: var(--nuit); color: var(--sur-nuit); font-weight: 700; font-size: 17px; text-decoration: none; }
.mjp a.mjp-enveloppe-pastille, .mjp a.mjp-enveloppe-pastille:hover { color: var(--sur-nuit); }
.mjp-enveloppe-pastille .mjp-part { width: 28px; height: 28px; }
.mjp-enveloppe-pastille .mjp-part__rond { fill: var(--or); }
.mjp-enveloppe-pastille .mjp-part__part { fill: var(--sur-nuit); }
.mjp-enveloppe-pastille__nombre { display: inline-block; font-family: var(--font-titre); font-weight: 800; font-size: 20px; }
.mjp-allume { display: flex; gap: var(--espace-3); align-items: flex-start; padding: 14px 16px; border-radius: var(--rayon-choix); background: var(--or-doux); border: 2px solid var(--or); }
.mjp-allume:empty { display: block; padding: 0; border: 0; background: none; }
.mjp-allume .mjp-ico { color: var(--or-texte); margin-top: 2px; }
.mjp-allume p { margin: 0; font-size: 17px; }
.mjp-allume .mjp-allume__titre { font-family: var(--font-titre); font-weight: 800; font-size: 19px; }

/* Le mouvement n'arrive qu'après un geste, et jamais pour qui a réduit les animations. */
@media (prefers-reduced-motion: no-preference) {
  .mjp-hop { animation: mjp-hop 0.5s ease-out; }
  .mjp-allume:not(:empty) { animation: mjp-arrive 0.3s ease-out; }
}
@keyframes mjp-hop { 0% { transform: scale(1); } 40% { transform: scale(1.45) translateY(-3px); } 100% { transform: scale(1); } }
@keyframes mjp-arrive { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Bilan : le révélateur */
.mjp-revele { position: relative; overflow: hidden; background: var(--nuit); color: var(--sur-nuit); border-radius: 24px; padding: 24px 22px 22px; display: flex; flex-direction: column; gap: var(--espace-2); }
.mjp-revele p { margin: 0; }
.mjp-revele__symbole { position: absolute; right: 18px; top: 18px; width: 56px; height: 56px; box-sizing: border-box; padding: 6px; background: var(--surface); border-radius: 16px; }
.mjp-revele__surtitre { font-weight: 700; font-size: 17px; color: var(--surface-2); padding-right: 70px; }
.mjp-revele__titre { font-family: var(--font-titre); font-weight: 800; font-size: 30px; line-height: 1.15; margin: 0; padding-right: 64px; }
.mjp-revele__titre:focus { outline: none; }
.mjp-revele__titre:focus-visible { outline: var(--focus-epaisseur) solid var(--sur-nuit); outline-offset: 3px; }
.mjp-revele__enveloppe { margin-top: 10px; background: var(--or); color: var(--sur-or); border-radius: var(--rayon-choix); padding: 14px 16px; display: flex; flex-direction: column; }
.mjp-revele__libelle { font-weight: 700; font-size: 17px; }
.mjp-revele .mjp-heros__montant { color: var(--sur-or); font-size: 48px; }
.mjp-revele .mjp-heros__unite { color: var(--sur-or); }
.mjp-revele .mjp-heros__une-fois, .mjp-revele .mjp-heros__une-fois span { color: var(--sur-or); }
.mjp-surprise { background: var(--or-doux); border-radius: var(--rayon-carte); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.mjp-surprise p, .mjp-surprise h2 { margin: 0; }
.mjp-surprise .mjp-titre-2 { font-size: 24px; line-height: 1.2; }
.mjp-surprise__etiquette { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--espace-2); background: var(--nuit); color: var(--sur-nuit); font-weight: 700; font-size: 17px; border-radius: var(--rayon-pastille); padding: 4px 14px 4px 6px; }
.mjp-surprise__etiquette .mjp-part { width: 26px; height: 26px; }
.mjp-surprise__etiquette .mjp-part__rond { fill: var(--or); }
.mjp-surprise__etiquette .mjp-part__part { fill: var(--sur-nuit); }
.mjp-surprise .mjp-btn--secondaire { background: var(--surface); }
.mjp-encore { background: var(--surface-2); border-radius: var(--rayon-carte); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.mjp-encore p { margin: 0; font-size: 17px; }
.mjp-encore__lien { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: var(--rayon-choix); background: var(--surface); border: 2px solid var(--ligne); padding: 0 16px; font-weight: 700; text-decoration: none; }
.mjp a.mjp-encore__lien { color: var(--encre); }
.mjp a.mjp-encore__lien:hover { border-color: var(--encre); }
.mjp-encore__lien .mjp-petit { flex: none; color: var(--texte-2); font-weight: 400; }

/* Une aide : pourquoi vous, et des étapes à cocher */
.mjp-surtitre--or { color: var(--or-texte); }
.mjp-raisons { display: flex; flex-direction: column; gap: 10px; }
.mjp-raisons li { display: flex; gap: 10px; align-items: flex-start; }
.mjp-raisons .mjp-ico { color: var(--vert-texte); flex: none; margin-top: 3px; }
.mjp-comment__tete { display: flex; justify-content: space-between; align-items: baseline; gap: var(--espace-2); flex-wrap: wrap; }
.mjp-etapes-cocher { display: flex; flex-direction: column; gap: 10px; }
.mjp-etapes-cocher label { min-height: var(--cible-min); box-sizing: border-box; display: flex; gap: var(--espace-3); align-items: flex-start; background: var(--surface); border: 2px solid var(--ligne-douce); border-radius: var(--rayon-choix); padding: 14px 16px; cursor: pointer; }
.mjp-etapes-cocher input { width: 26px; height: 26px; margin: 2px 0 0; flex: 0 0 26px; accent-color: var(--vert-action); }
.mjp-etapes-cocher input:focus-visible { outline: var(--focus-epaisseur) solid var(--focus); outline-offset: 2px; }
.mjp-etapes-cocher label:has(input:checked) { background: var(--vert-doux); border-color: var(--vert-action); }
.mjp-etapes-cocher label:has(input:checked) span { color: var(--texte-2); }

@media (max-width: 480px) {
  /* Cartes du bilan : le montant passe sous le texte, pour ne pas écraser la colonne. */
  .mjp-resultat--ligne { grid-template-columns: minmax(0, 1fr); }
  .mjp-resultat--ligne .mjp-resultat__montant, .mjp-resultat--ligne p:not(.mjp-resultat__montant) { grid-column: 1; grid-row: auto; }
  .mjp-resultat--ligne .mjp-resultat__montant { margin-top: var(--espace-2); }
}
@media (max-width: 420px) {
  .mjp-accueil__titre { font-size: 34px; }
  .mjp-revele__titre { font-size: 27px; }
}
