/* =====================================================================
   MATALO - MATALO EN FAMILLE (lot 106, PROD ; repris de la maquette des lots 096 et 105)
   1. Page de présentation (section « Côté parents », onglets des tarifs)
   2. Commande famille et pages de paiement (avec css/vitrine.css + commande.css)
   3. Espace parent et pages admin (avec css/matalo.css)
   ===================================================================== */

/* ---------- niveaux (vitrine.css n'a que CE2, CM1, CM2) ---------- */
.niv-CP { background: #e76f51; } .niv-CE1 { background: #f4a261; } .niv-CE2 { background: #2a9d8f; } .niv-CM1 { background: #457b9d; } .niv-CM2 { background: #6a4c93; }

/* =====================================================================
   1. PAGE DE PRESENTATION
   ===================================================================== */
.parents-hero { margin: 16px 0 8px; font-size: 1rem; color: #d7f3f6; }
.parents-hero i { color: var(--or-300); margin-right: 6px; }
/* le lien « Familles » allonge le menu : « Données & sécurité » (aussi dans le pied de page) se cache plus tôt */
@media (min-width: 1061px) and (max-width: 1440px) { .nav a[href="#confiance"] { display: none; } }
.parents-hero a { color: var(--or-300); font-weight: 700; }

.apercu-parent { padding: 22px; color: var(--encre); display: grid; gap: 12px; align-self: start; }
.ap-haut { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px dashed #e0cda3; }
.ap-haut i { color: var(--bois-300); }
.ap-haut b { font-size: 1.05rem; }
.ap-haut small { margin-left: auto; color: var(--encre-3); font-weight: 600; }
.ap-enfant { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px rgba(154,91,46,.18); }
.ap-enfant img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; background: var(--parchemin-2); }
.ap-enfant b { margin-right: 6px; }
.ap-enfant small { display: block; color: var(--encre-3); font-size: .8rem; }
.ap-enfant .barre-av { margin: 6px 0 2px; }
.ap-note { margin: 0; font-size: .88rem; color: var(--encre-2); }
.ap-note i { color: var(--or-700); margin-right: 4px; }
@media (max-width: 520px) { .ap-enfant { grid-template-columns: 48px minmax(0, 1fr); } .ap-enfant img { width: 48px; height: 48px; } .ap-enfant .pastille-pass { grid-column: 1 / -1; justify-self: start; } }

.pastille-pass { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pastille-pass.ok { background: var(--succes-clair); color: var(--succes-fonce); }
.pastille-pass.bientot { background: #fff1c7; color: var(--or-700); }
.pastille-pass.fini { background: var(--erreur-clair); color: var(--erreur-fonce); }

.cta-familles { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: center; margin-top: 34px; }
.cta-familles span { width: 100%; text-align: center; color: var(--encre-2); font-size: .92rem; }

.onglets-tarifs { display: flex; justify-content: center; gap: 6px; margin: 0 auto 26px; padding: 5px; width: max-content; max-width: 100%; border-radius: 999px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.onglets-tarifs button { border: 0; background: transparent; color: #d7f3f6; font: 600 1rem var(--police); padding: 10px 20px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.onglets-tarifs button[aria-selected="true"] { background: var(--or-500); color: var(--bois-900); box-shadow: 0 3px 0 var(--or-700); }
.onglets-tarifs button:focus-visible { outline: 3px solid var(--or-300); outline-offset: 2px; }
@media (max-width: 520px) { .onglets-tarifs { width: 100%; } .onglets-tarifs button { flex: 1; justify-content: center; padding: 10px 8px; font-size: .9rem; } }
.sous-titre-tarifs { text-align: center; color: #d7f3f6; margin: -8px auto 30px; max-width: 640px; }
.panneau-tarifs[hidden] { display: none; }

/* =====================================================================
   2. COMMANDE FAMILLE
   ===================================================================== */
.choix-mode { margin-bottom: 0; }
.choix-mode b i { color: var(--bois-300); margin-right: 4px; }
.choix-mode .option-annee { box-shadow: var(--ombre-s); }

#lignes-enfants { display: grid; gap: 12px; margin-bottom: 14px; }
.ligne-enfant { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) 40px; grid-template-areas: "titre prenom formule retirer" "titre niveau niveau retirer"; gap: 10px 12px; align-items: end; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.65); box-shadow: inset 0 0 0 1px rgba(154,91,46,.18); }
.ligne-enfant .num-classe { grid-area: titre; }
.ligne-enfant .champ-prenom { grid-area: prenom; }
.ligne-enfant .champ-niveau { grid-area: niveau; }
.ligne-enfant .champ-formule { grid-area: formule; }
.ligne-enfant .btn-retirer { grid-area: retirer; align-self: center; }
.ligne-enfant .champ label { font-size: .8rem; margin-bottom: 4px; }
.ligne-enfant .champ input[type=text] { padding: 9px 11px; }
@media (max-width: 700px) {
  .ligne-enfant { grid-template-columns: minmax(0, 1fr) 40px; grid-template-areas: "titre retirer" "prenom prenom" "niveau niveau" "formule formule"; }
}
.champ.erreur .case-niv span { border-color: var(--erreur); }

.choix-formule { display: flex; gap: 6px; }
.formule { position: relative; cursor: pointer; flex: 1; }
.formule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.formule span { display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border-radius: 10px; background: #fff; border: 2px solid #e3d3b2; line-height: 1.2; transition: .15s; }
.formule b { font-size: .92rem; }
.formule small { font-size: .78rem; color: var(--encre-3); font-weight: 600; }
.formule input:checked + span { border-color: var(--succes); background: var(--succes-clair); }
.formule input:checked + span small { color: var(--succes-fonce); }
.formule input:focus-visible + span { outline: 3px solid var(--ocean-500); outline-offset: 2px; }

#enfants-inscrits { display: grid; gap: 10px; }
.inscrit { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #fff; border: 2px solid #e3d3b2; transition: .15s; }
.inscrit.coche { border-color: var(--succes); box-shadow: 0 0 0 3px var(--succes-clair); }
.inscrit:not(.coche) .choix-formule { opacity: .45; pointer-events: none; }
.coche-inscrit { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.coche-inscrit input { width: 22px; height: 22px; accent-color: var(--succes); margin-top: 2px; flex: none; }
.coche-inscrit small { display: block; color: var(--encre-2); font-size: .85rem; }
@media (max-width: 600px) { .inscrit { grid-template-columns: 1fr; } }
.bandeau-parent { padding: 14px 18px; }
.bandeau-parent p { margin: 0; color: var(--encre-2); }
.bandeau-parent i { color: var(--succes); margin-right: 4px; }

.recap-enfants { list-style: none; margin: 0 0 6px; padding: 0; }
.recap-enfants li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #e0cda3; }
.recap-enfants li small { display: block; color: var(--encre-3); font-size: .82rem; }
.recap-enfants li > b { white-space: nowrap; }
.recap-enfants li.vide { color: var(--encre-3); font-style: italic; }
.recap-enfants .niv { margin-left: 4px; vertical-align: 1px; }

.carte-fin-famille .titre-codes { font-family: var(--police); font-size: 1.05rem; color: var(--bois-700); margin: 22px 0 6px; }
.carte-fin-famille .titre-codes i { color: var(--or-700); margin-right: 4px; }
.liste-codes { list-style: none; padding: 0; margin: 0 auto; max-width: 480px; text-align: left; }
.liste-codes li { display: grid; grid-template-columns: 48px 1fr auto; grid-template-areas: "niv nom code" "niv fin code"; align-items: center; gap: 0 10px; padding: 9px 12px; border-radius: 12px; background: #fff; margin-bottom: 8px; box-shadow: inset 0 0 0 1px rgba(154,91,46,.18); }
.liste-codes .niv { grid-area: niv; }
.liste-codes b { grid-area: nom; }
.liste-codes small { grid-area: fin; color: var(--encre-3); }
.liste-codes code, .liste-codes .code-inchange { grid-area: code; }
.liste-codes code { background: var(--or-300); color: var(--bois-900); border-radius: 8px; padding: 4px 10px; font: 700 1.05rem var(--police); letter-spacing: .5px; }
.code-inchange { font-size: .82rem; color: var(--encre-3); }
.aide-codes { font-size: .9rem; }

/* =====================================================================
   3. ESPACE PARENT ET PAGES ADMIN (back-office, css/matalo.css)
   ===================================================================== */
.avatar-parent { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ocean-100, #d7f3f6); color: var(--ocean-700, #0a6e86); }

.alerte-pass { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: 16px; background: #fff1c7; color: #7a5600; margin: 18px 0; border: 1px solid #f2d27a; }
.alerte-pass i { font-size: 1.3rem; }
.alerte-pass span { flex: 1; min-width: 220px; }
.alerte-pass.fini { background: #fde4d6; color: #b9501f; border-color: #f4b99a; }

.enfants-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; margin-top: 18px; }
@media (max-width: 420px) { .enfants-grille { grid-template-columns: minmax(0, 1fr); } }
.carte-enfant { display: flex; flex-direction: column; overflow: hidden; }
.carte-enfant .bandeau-univers { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: #fff; background: linear-gradient(135deg, #457b9d, #1d3557); }
.carte-enfant.u-CP .bandeau-univers { background: linear-gradient(135deg, #e76f51, #9c3d24); }
.carte-enfant.u-CE1 .bandeau-univers { background: linear-gradient(135deg, #7a1f2f, #3a5aa8); }
.carte-enfant.u-CE2 .bandeau-univers { background: linear-gradient(135deg, #2a9d8f, #1b5e3b); }
.carte-enfant.u-CM2 .bandeau-univers { background: linear-gradient(135deg, #6a4c93, #1b1b3a); }
.bandeau-univers img { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.2); box-shadow: 0 0 0 3px rgba(255,255,255,.6); object-fit: cover; flex: none; }
.bandeau-univers h2 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.bandeau-univers small { display: block; opacity: .9; }
.bandeau-univers .niv { background: rgba(255,255,255,.22); margin-left: 6px; vertical-align: 3px; }
.carte-enfant .corps { padding: 16px 18px; display: grid; gap: 14px; flex: 1; }
.chiffres-enfant { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chiffres-enfant div { background: #fbf7ee; border-radius: 12px; padding: 8px 10px; text-align: center; }
.chiffres-enfant b { display: block; font-size: 1.1rem; white-space: nowrap; }
.chiffres-enfant small { color: var(--encre-3); font-size: .75rem; font-weight: 600; }
.avancement-enfant small { color: var(--encre-2); font-size: .85rem; }
.barre-enfant { height: 10px; border-radius: 999px; background: #f0e7d5; overflow: hidden; margin: 6px 0 4px; }
.barre-enfant span { display: block; height: 100%; border-radius: 999px; background: var(--succes); }
.ligne-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .92rem; flex-wrap: wrap; }
.ligne-info > span:first-child { color: var(--encre-3); font-weight: 600; }
.code-secret { display: inline-flex; align-items: center; gap: 8px; }
.code-secret code { background: #fff3c4; border-radius: 8px; padding: 2px 10px; font-weight: 700; letter-spacing: .5px; font-family: inherit; }
.code-secret button { border: 0; background: none; color: var(--ocean-700, #0a6e86); cursor: pointer; padding: 4px; }
.a-retravailler { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .88rem; }
.a-retravailler li { display: flex; gap: 8px; align-items: center; color: var(--encre-2); }
.a-retravailler li i { color: var(--erreur, #e8743b); width: 14px; }
.actions-enfant { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--bord-bo); background: #fbf7ee; }

.carte-ajout { display: grid; place-items: center; text-align: center; padding: 30px 20px; border: 2px dashed var(--bord-bo); border-radius: 18px; color: var(--encre-2); text-decoration: none; min-height: 260px; background: rgba(255,255,255,.5); transition: .15s; }
.carte-ajout:hover { border-color: var(--succes); color: var(--succes-fonce); background: #fff; }
.carte-ajout i { font-size: 2rem; margin-bottom: 8px; }
.carte-ajout b { display: block; font-size: 1.1rem; }

.choix-niveaux-modale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
@media (max-width: 520px) { .choix-niveaux-modale { grid-template-columns: repeat(3, 1fr); } }
.choix-niveaux-modale label { cursor: pointer; }
.choix-niveaux-modale input { position: absolute; opacity: 0; }
.choix-niveaux-modale span { display: block; text-align: center; padding: 10px 4px; border-radius: 12px; border: 2px solid var(--bord-bo); font-weight: 700; }
.choix-niveaux-modale span small { display: block; font-weight: 500; font-size: .7rem; color: var(--encre-3); }
.choix-niveaux-modale input:checked + span { border-color: var(--succes); background: var(--succes-clair); }
.note-modale { font-size: .9rem; color: var(--encre-2); background: #fbf7ee; border-radius: 12px; padding: 10px 12px; }
.pied-modale { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* pages admin */
.p-famille { background: #e5f0fb; color: #2f5d8a; }
.p-ecole { background: #f0ebe1; color: var(--encre-2); }
.p-bientot { background: #fff1c7; color: var(--or-700); }
.segments a { display: inline-block; text-decoration: none; padding: 6px 12px; border-radius: 9px; font-weight: 600; color: var(--encre-2); font-size: .9rem; }
.segments a.actif { background: #fff; color: var(--encre); box-shadow: 0 2px 6px -2px rgba(0,0,0,.25); }
.enfants-cellule { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.enfants-cellule span { white-space: nowrap; font-size: .88rem; }
.automatique { display: inline-flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--succes-fonce); font-weight: 600; }

/* les blocs masques par js/commande_famille.js (display: grid / flex des regles ci-dessus) */
#form-famille [hidden], .carte-fin-famille [hidden] { display: none !important; }
.carte-enfant.termine .bandeau-univers { filter: grayscale(.75); }
.carte-enfant.termine .corps { opacity: .75; }
.alerte-pass + .alerte-pass { margin-top: -6px; }
.bo-contenu > .alerte-pass, .bo-contenu > .enfants-grille { margin: 0; }
.bo-contenu > .alerte-pass + .alerte-pass { margin-top: -10px; }
.ligne-recap.remise { color: var(--succes-fonce); font-weight: 600; border-bottom: 0; }
.ligne-recap.remise[hidden] { display: none; }
.num-famille { display: inline-block; min-width: 46px; text-align: center; padding: 3px 8px; border-radius: 8px; background: #f0ebe1; color: var(--encre-2); font-weight: 700; font-size: .85rem; white-space: nowrap; }
/* lot 105 : 2 offres familles seulement (pass 1 mois, pass 12 mois) */
.tarifs.tarifs-2 { grid-template-columns: repeat(2, minmax(0, 380px)); justify-content: center; }
@media (max-width: 920px) { .tarifs.tarifs-2 { grid-template-columns: 1fr; } }
