/* Portail des parents : une colonne étroite, lisible sur petit Android. */
.portail-corps { background: var(--papier); }
.portail-entete { background: var(--vert-800); color: #fff; padding: .8rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.portail-marque { display: inline-flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font: 700 1.15rem/1 var(--police-titre); }
.portail-marque svg { width: 26px; height: 26px; }
.portail-entete-note { font-size: .85rem; color: var(--vert-100); }
.portail { max-width: 32rem; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
.portail-pied { max-width: 32rem; margin: 0 auto; padding: 0 1rem 2rem; font-size: .85rem; color: var(--encre-3); }
.portail-titre { font-size: clamp(1.6rem, 6vw, 2rem); margin-bottom: .4rem; }
.portail-intro { color: var(--encre-2); margin: 0 0 1.25rem; }
.sous-titre { font-size: 1.15rem; margin-top: 1.75rem; }
.bouton-grand { min-height: 56px; font-size: 1.1rem; }
.lien-discret { display: block; text-align: center; margin-top: 1rem; color: var(--encre-2); }
.aide-centre { text-align: center; }
.sr-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Saisie du code */
.forme-code { margin-bottom: 2rem; }
.champ-code { font: 700 1.9rem/1 var(--police-titre); letter-spacing: .3em; text-align: center; text-transform: uppercase; min-height: 64px; margin-bottom: .5rem; }
.champ-invalide, .a-erreur input { border-color: var(--danger); }
.erreur-champ { color: var(--danger); font-weight: 600; font-size: .92rem; margin: 0 0 .8rem; }
.erreur-champ:empty { display: none; }
.etapes ol { margin: 0; padding-left: 1.3rem; color: var(--encre-2); }
.etapes li { margin-bottom: .5rem; }

/* Fiche de l'élève et reste dû */
.fiche { margin-bottom: 1.25rem; }
.fiche-ecole { margin: 0 0 .2rem; color: var(--encre-3); font-size: .9rem; }
.fiche-nom { font-size: clamp(1.7rem, 7vw, 2.2rem); margin-bottom: .1rem; }
.fiche-classe { margin: 0; color: var(--encre-2); }
.reste { background: var(--vert-800); color: #fff; border-radius: var(--rayon-l); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.reste-libelle { margin: 0; color: var(--vert-100); font-size: .95rem; }
.reste-montant { display: block; font: 800 clamp(2rem, 10vw, 2.6rem)/1.1 var(--police-titre); color: var(--or-500); margin: .2rem 0; }
.reste-note { margin: 0; font-size: .88rem; color: var(--vert-100); }
.detail-frais { margin-bottom: 1.5rem; }
.detail-frais summary { cursor: pointer; font-weight: 600; padding: .5rem 0; color: var(--vert-700); }

.frais { list-style: none; margin: 0; padding: 0; }
.frais-ligne { padding: .8rem 0; border-bottom: 1px solid var(--trait); }
.frais-ligne:last-child { border-bottom: 0; }
.frais-haut, .frais-bas { display: flex; justify-content: space-between; gap: 1rem; }
.frais-libelle { font-weight: 600; }
.frais-bas { font-size: .85rem; color: var(--encre-3); margin-top: .3rem; }
.frais-jauge { display: block; height: 6px; background: var(--trait); border-radius: 3px; margin-top: .45rem; overflow: hidden; }
.frais-jauge span { display: block; height: 100%; background: var(--succes); }
.est-paye .frais-libelle { color: var(--encre-3); }
.est-en-retard .frais-jauge span { background: var(--alerte); }
.frais-retard { color: var(--alerte); font-weight: 600; }

/* Formulaire de paiement */
.groupe { border: 0; margin: 0 0 1.4rem; padding: 0; min-width: 0; }
.legende { display: block; font: 700 1.05rem/1.2 var(--police-titre); margin-bottom: .6rem; padding: 0; }
.option { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1.5px solid var(--trait); border-radius: var(--rayon-s); padding: .85rem 1rem; margin-bottom: .5rem; cursor: pointer; }
.option input, .tuile input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--vert-800); flex: none; }
.option-texte { flex: 1; }
.option-montant { font-weight: 700; white-space: nowrap; }
.option:has(input:checked) { border-color: var(--vert-800); background: var(--vert-50); }
.libre { margin: -.1rem 0 .5rem 2.6rem; }
.champ-suffixe, .champ-prefixe { display: flex; align-items: stretch; }
.champ-suffixe input { border-radius: var(--rayon-s) 0 0 var(--rayon-s); font-size: 1.15rem; }
.champ-suffixe span, .champ-prefixe span { display: flex; align-items: center; padding: 0 .9rem; background: var(--vert-50); border: 1.5px solid var(--trait); color: var(--encre-2); font-weight: 600; }
.champ-suffixe span { border-left: 0; border-radius: 0 var(--rayon-s) var(--rayon-s) 0; }
.champ-prefixe span { border-right: 0; border-radius: var(--rayon-s) 0 0 var(--rayon-s); }
.champ-prefixe input { border-radius: 0 var(--rayon-s) var(--rayon-s) 0; font-size: 1.2rem; letter-spacing: .06em; }

.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tuile { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .65rem; align-items: center; background: #fff; border: 2px solid var(--trait); border-radius: var(--rayon); padding: .85rem; cursor: pointer; }
.tuile input { position: absolute; opacity: 0; }
.tuile .pastille { grid-row: 1 / 3; }
.tuile-nom { font-weight: 700; font-size: 1.05rem; }
.tuile-note { font-size: .8rem; color: var(--encre-3); }
.tuile-tmoney:has(input:checked) { border-color: #c9a000; background: #fff8d6; }
.tuile-flooz:has(input:checked) { border-color: var(--flooz); background: #e6f0fa; }
.tuile:has(input:focus-visible) { outline: 3px solid var(--or-500); outline-offset: 2px; }

.pastille { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font: 800 1.15rem/1 var(--police-titre); flex: none; }
.pastille-tmoney { background: var(--tmoney); color: #1a1a1a; }
.pastille-flooz { background: var(--flooz); color: #fff; }
.pastille-especes { background: var(--vert-100); color: var(--vert-800); }
.pastille-texte { display: inline-block; padding: .05em .55em; border-radius: 999px; font-weight: 700; font-size: .9em; }
.pastille-texte-tmoney { background: var(--tmoney); color: #1a1a1a; }
.pastille-texte-flooz { background: var(--flooz); color: #fff; }
.pastille-texte-especes { background: var(--vert-100); color: var(--vert-800); }

/* Tout est payé */
.tout-paye { background: var(--vert-50); border: 1.5px solid var(--vert-100); border-radius: var(--rayon-l); padding: 1.25rem; margin-bottom: 1rem; }
.tout-paye-titre { font: 800 1.6rem/1.2 var(--police-titre); color: var(--vert-800); margin: 0; }

/* Simulation : imitation d'un écran de téléphone */
.ecran { background: #1d2420; color: #f2f2f2; border-radius: var(--rayon-l); padding: 1.1rem 1.2rem; margin-bottom: 1.25rem; border-top: 6px solid var(--tmoney); }
.ecran-flooz { border-top-color: var(--flooz); }
.ecran-entete { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: .6rem; }
.ecran-entete .pastille { width: 30px; height: 30px; font-size: .95rem; }
.ecran p { margin: 0 0 .6rem; }
.ecran-code { display: flex; gap: .6rem; margin-top: .8rem; }
.ecran-code span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9aa59f; }
.decision { display: grid; gap: .6rem; }

/* Attente et échec */
.etat .bouton { margin-top: .5rem; }
.attente-signe { margin-bottom: 1rem; }
.attente-signe .pastille { width: 56px; height: 56px; font-size: 1.5rem; animation: battement 1.6s ease-in-out infinite; }
@keyframes battement { 50% { transform: scale(.88); opacity: .7; } }
.attente-etat { font-weight: 600; color: var(--vert-700); }

/* Reçu : un ticket perforé, tamponné « Payé » */
.ticket { position: relative; background: #fff; padding: 1.5rem 1.25rem 1.25rem; margin: .5rem 0 1.5rem; box-shadow: var(--ombre);
  border-radius: 4px; }
.ticket::before, .ticket::after { content: ""; position: absolute; left: 0; right: 0; height: 8px; background: radial-gradient(circle at 8px 8px, var(--papier) 6px, transparent 6.5px) 0 0 / 16px 16px repeat-x; }
.ticket::before { top: -8px; transform: translateY(0); background-position: 0 -8px; }
.ticket::after { bottom: -8px; background-position: 0 0; transform: rotate(180deg); }
.ticket-tete { text-align: center; border-bottom: 2px dashed var(--trait); padding-bottom: 1rem; margin-bottom: 1rem; }
.ticket-ecole { font: 700 1.2rem/1.2 var(--police-titre); margin: 0; }
.ticket-coord { margin: .2rem 0 0; font-size: .85rem; color: var(--encre-3); }
.ticket-titre { font-size: 1rem; font-family: var(--police); font-weight: 600; color: var(--encre-2); margin: .6rem 0 0; letter-spacing: 0; }
.ticket-montant { position: relative; text-align: center; padding: .5rem 0 1rem; }
.ticket-montant .montant { font: 800 clamp(2.1rem, 11vw, 2.8rem)/1 var(--police-titre); color: var(--vert-800); }
.tampon { position: absolute; right: .2rem; top: -.4rem; transform: rotate(-12deg); border: 3px solid var(--succes); color: var(--succes); border-radius: 8px; padding: .1rem .55rem; font: 800 1.15rem/1.2 var(--police-titre); opacity: .85; }
.ticket-demo .tampon { border-color: var(--alerte); color: var(--alerte); }
.ticket-mention { text-align: center; color: var(--alerte); font-weight: 600; font-size: .9rem; margin: -.4rem 0 .8rem; }
.ticket-lignes { margin: 0; border-top: 2px dashed var(--trait); padding-top: .8rem; }
.ticket-lignes div { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.ticket-lignes dt { color: var(--encre-3); }
.ticket-lignes dd { margin: 0; text-align: right; font-weight: 600; }
.ticket-lignes .ref { font-variant-numeric: tabular-nums; letter-spacing: .03em; word-break: break-all; }
.ticket-reste { border-top: 2px dashed var(--trait); margin: .8rem 0 0; padding-top: .8rem; text-align: center; }
.ticket-verif { font-size: .78rem; color: var(--encre-3); text-align: center; margin: .6rem 0 0; word-break: break-all; }
.actions-recu { display: grid; gap: .6rem; }
.bouton-whatsapp { background: #1f8f4e; color: #fff; }
.bouton-whatsapp:hover { background: #18773f; }

@media (prefers-reduced-motion: reduce) {
  .attente-signe .pastille { animation: none; }
  .bouton:active { transform: none; }
}
@media print {
  .portail-entete, .portail-pied, .bandeau-simulation, .actions-recu { display: none !important; }
  body, .portail-corps { background: #fff; }
  .portail { padding: 0; }
  .ticket { box-shadow: none; border: 1px solid #999; }
  .ticket::before, .ticket::after { display: none; }
}
