/*
 * Espace eleve Kogitas — habillage « cahier du matin » (septembre 2026).
 *
 * Fond creme, encre marine, orange Kogitas pour tout ce qui vient de la
 * classe, bleu pour tout ce qui vient de la famille. Pense d'abord pour une
 * tablette d'ecole tenue par un enfant de six ans : cibles d'au moins 56 px,
 * textes courts et gros, jamais d'information portee par la seule couleur.
 *
 * Polices hebergees ici (pas de Google Fonts) : aucune requete vers un tiers
 * depuis la tablette d'un eleve, et l'application garde sa typographie hors
 * ligne. Baloo 2 et Nunito, licence SIL OFL.
 */

@font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    src: url('fonts/baloo2.woff2') format('woff2');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('fonts/nunito.woff2') format('woff2');
}

:root {
    --creme: #FFF7EC;
    --blanc: #FFFFFF;
    --bord: #EFE3D0;
    --bord-fonce: #D8CCB8;
    --encre: #1D2140;
    --encre-doux: #5B607D;
    --encre-pale: #4A4F6E;
    --orange: #FF6B35;
    --orange-action: #D9480F;
    --orange-ombre: #9C3308;
    --orange-pale: #FFE3D6;
    --orange-texte: #B23A0A;
    --bleu: #2F5BEA;
    --bleu-ombre: #1F3FB0;
    --bleu-pale: #E3EAFF;
    --bleu-bord: #C9D5FF;
    --soleil: #FFC23D;
    --nuit: #1D2140;
    --nuit-2: #262B52;
    --nuit-bord: #3A4078;
    --nuit-texte: #D9DCF0;
    --titre: 'Baloo 2', 'Trebuchet MS', sans-serif;
    --texte: 'Nunito', 'Trebuchet MS', sans-serif;
    --marge: clamp(16px, 4vw, 48px);
}

/* [hidden] l'emporte toujours : sans cela, une regle display d'un ecran le
   laissait affiche par-dessus les autres (defaut trouve en aout 2026). */
[hidden] { display: none !important; }

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

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--creme);
    color: var(--encre);
    font-family: var(--texte);
    font-size: 18px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

button, input { font-family: inherit; }
a { color: var(--orange-texte); }

:focus-visible {
    outline: 4px solid var(--bleu);
    outline-offset: 3px;
}

/* ================================================================ LOGO */
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo span:nth-child(1) { width: 14px; height: 14px; border-radius: 50%; background: #FFB08F; }
.logo span:nth-child(2) { width: 24px; height: 24px; border-radius: 50%; background: var(--orange); }
.logo b { font-family: var(--titre); font-weight: 800; font-size: 30px; line-height: 1; }
.logo-grand span:nth-child(1) { width: 20px; height: 20px; }
.logo-grand span:nth-child(2) { width: 36px; height: 36px; }
.logo-grand b { font-size: 48px; }

/* ================================================================ DEMARRAGE */
#splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
}
.splash-bar { width: 180px; height: 8px; border-radius: 4px; background: var(--bord); overflow: hidden; }
.splash-bar-fill {
    width: 40%;
    height: 100%;
    border-radius: 4px;
    background: var(--orange);
    animation: glisse 1.1s ease-in-out infinite alternate;
}
@keyframes glisse { from { transform: translateX(-10%); } to { transform: translateX(160%); } }

/* ================================================================ BOUTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    padding: 0 26px;
    border: none;
    border-radius: 20px;
    font-family: var(--texte);
    font-size: 19px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-bloc { width: 100%; }
.btn-geant { min-height: 84px; font-family: var(--titre); font-size: 34px; border-radius: 24px; }
.btn-petit { min-height: 44px; padding: 0 16px; font-size: 16px; border-radius: 14px; }
.btn-orange { background: var(--orange-action); color: #fff; box-shadow: 0 8px 0 var(--orange-ombre); }
.btn-bleu { background: var(--bleu); color: #fff; box-shadow: 0 6px 0 var(--bleu-ombre); }
.btn-blanc { background: var(--blanc); color: var(--encre); border: 3px solid var(--bord); }
.btn-fantome-nuit { background: transparent; color: #fff; border: 3px solid var(--nuit-bord); }

.btn-retour {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    border: 3px solid var(--bord);
    background: var(--creme);
    color: var(--encre);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn-fermer {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--encre-doux);
    font-size: 28px;
    cursor: pointer;
}
.lien {
    padding: 0;
    border: none;
    background: none;
    color: var(--bleu-ombre);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}

/* ================================================================ ECRANS */
.ecran { min-height: 100vh; min-height: 100dvh; position: relative; }
.ecran-centre {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 96px var(--marge) 64px;
    overflow: hidden;
}
.pile {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    text-align: center;
}
.entete-centre { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.titre-geant { margin: 0; font-family: var(--titre); font-weight: 800; font-size: clamp(44px, 8vw, 64px); line-height: 1.02; }
.titre-moyen { margin: 0; font-family: var(--titre); font-weight: 800; font-size: clamp(32px, 5vw, 42px); line-height: 1.1; }
.sous-titre { margin: 0; font-size: clamp(19px, 2.6vw, 24px); font-weight: 700; color: var(--encre-doux); }
.aide { margin: 0; font-size: 17px; color: var(--encre-doux); }

.coin-logo { position: absolute; left: var(--marge); top: 32px; z-index: 1; }

/* Taches de couleur du fond : de la gaiete sans degrade ni motif. */
.deco { position: absolute; border-radius: 50%; pointer-events: none; }
.deco-orange { width: 460px; height: 460px; background: var(--orange-pale); left: -170px; top: -190px; }
.deco-bleu { width: 380px; height: 380px; background: var(--bleu-pale); right: -120px; bottom: -150px; }
.deco-soleil { width: 90px; height: 90px; background: var(--soleil); right: 16%; top: 13%; }

.carte-blanche {
    width: 100%;
    background: var(--blanc);
    border-radius: 32px;
    box-shadow: 0 10px 0 var(--bord);
}

/* ================================================================ LE CODE */
.form-code {
    padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}
.etiquette {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--encre-doux);
}
.champ-code {
    width: 100%;
    height: 104px;
    border: 4px solid var(--encre);
    border-radius: 24px;
    background: var(--creme);
    color: var(--encre);
    font-family: var(--titre);
    font-size: clamp(40px, 7vw, 56px);
    font-weight: 800;
    letter-spacing: .3em;
    text-align: center;
    text-transform: uppercase;
    padding: 0 0 0 .3em;
}
.champ-code::placeholder { color: var(--bord-fonce); }
.champ-code:focus { outline: none; box-shadow: 0 0 0 5px var(--bleu-pale); }
.champ-code[aria-invalid="true"] { border-style: dashed; border-color: var(--orange-texte); background: #FFF1EA; }

.alerte {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 18px;
    background: var(--nuit);
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
}
.alerte svg { flex-shrink: 0; }

.essais { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 700; color: var(--encre-doux); }
.points { display: flex; gap: 8px; }
.points i { display: block; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--orange); }
.points i.point-vide { background: transparent; border: 3px solid var(--bord-fonce); }

/* ================================================================ BLOQUE */
.ecran-nuit { background: var(--nuit); color: #fff; }
.ecran-nuit::before, .ecran-nuit::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: var(--nuit-2);
    pointer-events: none;
}
.ecran-nuit::before { width: 520px; height: 520px; left: -180px; bottom: -220px; }
.ecran-nuit::after { width: 300px; height: 300px; right: -60px; top: -90px; }
.sous-titre-nuit { color: var(--nuit-texte); line-height: 1.4; }
.cadenas-rond {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--soleil);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 0 #B7861A;
}
.minuteur {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 44px;
    border-radius: 28px;
    background: var(--nuit-2);
    border: 2px solid var(--nuit-bord);
}
.minuteur-etiquette { font-size: 16px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #AEB3D6; }
.minuteur-chiffres { font-family: var(--titre); font-size: 64px; font-weight: 800; line-height: 1; color: var(--soleil); font-variant-numeric: tabular-nums; }
.note-bas { position: absolute; left: var(--marge); right: var(--marge); bottom: 24px; margin: 0; text-align: center; font-size: 15px; color: #AEB3D6; z-index: 1; }

/* ================================================================ BANDEAU */
.bandeau {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px var(--marge);
    background: var(--blanc);
    border-bottom: 3px solid var(--bord);
}
.bandeau-titre { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; min-width: 0; }
.bandeau-nom { font-family: var(--titre); font-size: clamp(26px, 4vw, 34px); font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.bandeau-nom-grand { font-size: clamp(28px, 4.4vw, 38px); }
.bandeau-sous { font-size: 17px; font-weight: 700; color: var(--encre-doux); }
.badge-famille {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 14px;
    background: var(--bleu-pale);
    color: var(--bleu-ombre);
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}
.puce-hors {
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--nuit);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.pastille-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    padding: 0;
    border-radius: 50%;
    border: 4px solid var(--blanc);
    box-shadow: 0 0 0 3px var(--orange);
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}
.pastille-image { display: block; width: 100%; height: 100%; }

.retour-admin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px var(--marge);
    background: var(--nuit);
    color: #fff;
    font-size: 15px;
}
.retour-admin .btn { background: var(--soleil); color: var(--encre); }

/* ================================================================ CORPS */
.corps { padding: 28px var(--marge) 56px; display: flex; flex-direction: column; gap: 30px; max-width: 1280px; margin: 0 auto; }
.titre-section-grand { margin: 0; font-family: var(--titre); font-size: clamp(32px, 5vw, 44px); font-weight: 800; line-height: 1.05; }
.titre-section { margin: 0; font-family: var(--titre); font-size: 26px; font-weight: 800; }
.erreur { margin: 0; padding: 14px 18px; border-radius: 16px; background: var(--nuit); color: #fff; font-weight: 800; }

.carte-progression {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    padding: 22px 30px;
    border-radius: 28px;
    background: var(--nuit);
    color: #fff;
}
.progression-etoiles { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; color: var(--nuit-texte); }
.progression-etoiles strong { font-family: var(--titre); font-size: 46px; font-weight: 800; line-height: 1; color: #fff; }
.progression-jauge { flex: 1 1 240px; display: flex; flex-direction: column; gap: 10px; font-size: 18px; font-weight: 800; }
.jauge { height: 18px; border-radius: 9px; background: var(--nuit-bord); overflow: hidden; }
.jauge-remplie { width: 0; height: 100%; border-radius: 9px; background: var(--soleil); transition: width .6s ease; }

.section { display: flex; flex-direction: column; gap: 18px; }
.section-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.section-icone { width: 48px; height: 48px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.section-icone-orange { background: var(--orange-pale); color: var(--orange-texte); }
.section-icone-bleu { background: var(--bleu); color: #fff; }
.section-titre { margin: 0; font-family: var(--titre); font-size: clamp(28px, 4vw, 34px); font-weight: 800; line-height: 1; }
.section-sous { font-size: 17px; font-weight: 700; color: var(--encre-doux); }

/* Titre d'un jeu, en programme par defaut (tout le contenu de l'enseignant). */
.titre-jeu {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 0;
    font-family: var(--titre);
    font-size: 24px;
    font-weight: 800;
}
.titre-jeu-compteur { margin-left: auto; font-family: var(--texte); font-size: 16px; font-weight: 800; color: var(--encre-doux); }

/* ================================================================ EXERCICES */
.grille-exercices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}
.carte-exercice {
    position: relative;
    min-height: 188px;
    padding: 18px;
    border-radius: 26px;
    background: var(--blanc);
    border: 3px solid var(--bord);
    box-shadow: 0 6px 0 var(--bord);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    color: var(--encre);
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease;
}
a.carte-exercice[href]:active { transform: translateY(4px); box-shadow: none; }
.carte-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.carte-num { font-family: var(--titre); font-size: 46px; font-weight: 800; line-height: 1; }
.carte-emoji { font-size: 30px; line-height: 1; }
/* Image du produit a la place de l'emoji : vignette sur un exercice, couverture sur un ouvrage. */
.carte-image {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-color: var(--bord);
    background-size: cover;
    background-position: center;
}
.carte-ouvrage .carte-haut { justify-content: center; }
.carte-ouvrage .carte-num { display: none; }
.carte-ouvrage .carte-image { width: 100%; height: 150px; background-color: transparent; background-size: contain; background-repeat: no-repeat; }
.carte-cadenas {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--nuit);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.carte-bas { display: flex; flex-direction: column; gap: 4px; }
.carte-jeu { font-size: 17px; font-weight: 800; line-height: 1.25; }
.carte-etat { font-size: 16px; font-weight: 700; color: var(--encre-pale); }
.carte-etoiles { display: flex; gap: 3px; margin-top: 2px; }
.carte-etoiles i {
    width: 22px;
    height: 22px;
    background: var(--bord-fonce);
    clip-path: polygon(50% 4%, 62% 36%, 96% 38%, 69% 59%, 79% 93%, 50% 73%, 21% 93%, 31% 59%, 4% 38%, 38% 36%);
}
.carte-etoiles i.pleine { background: var(--soleil); }

.carte-a-faire { background: var(--orange-pale); border-color: var(--orange); box-shadow: 0 6px 0 var(--orange); }
.carte-verrouillee, .carte-fermee, .carte-hors-ligne { background: #F4EEE4; border-color: #E2D8C6; box-shadow: 0 6px 0 #E2D8C6; }
.carte-fermee { background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(29,33,64,.05) 14px 28px); }
.carte-verrouillee .carte-num, .carte-fermee .carte-num { color: var(--encre-pale); }

.vide { padding: 28px; border-radius: 26px; background: var(--blanc); border: 3px dashed var(--bord-fonce); text-align: center; }
.vide h3 { margin: 0 0 6px; font-family: var(--titre); font-size: 28px; }
.vide p { margin: 0; color: var(--encre-doux); font-weight: 600; }

/* ================================================================ FAMILLE */
.section-famille { padding: 26px clamp(18px, 3vw, 32px) 30px; border-radius: 32px; background: var(--bleu-pale); }
.section-famille .section-sous { color: #3C4270; }
.grille-famille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.carte-famille {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 26px;
    background: var(--blanc);
    border: 3px solid var(--bleu-bord);
    box-shadow: 0 6px 0 var(--bleu-bord);
    color: var(--encre);
    text-decoration: none;
}
.carte-famille:active { transform: translateY(4px); box-shadow: none; }
.carte-famille-couv {
    position: relative;
    flex-shrink: 0;
    width: 96px;
    height: 120px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bleu);
    background-size: cover;
    background-position: center;
}
.carte-famille-couv.jeu { background-color: #8E44AD; }
.carte-famille-type {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--nuit);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}
.carte-famille-texte { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.carte-famille-titre { font-family: var(--titre); font-size: 23px; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.carte-famille-action {
    min-height: 44px;
    padding: 0 20px;
    border-radius: 14px;
    background: var(--bleu);
    color: #fff;
    display: inline-flex;
    align-items: center;
    font-size: 18px;
    font-weight: 800;
}
/* ---- Tout Kogitas ---- */
.carte-tout {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 18px 22px;
    border: 0;
    border-radius: 28px;
    background: var(--nuit);
    box-shadow: 0 6px 0 #0E1130;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.carte-tout:active { transform: translateY(4px); box-shadow: none; }
.carte-tout:focus-visible { outline: 4px solid var(--soleil); outline-offset: 3px; }
.carte-tout-icone {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 20px;
    background: var(--soleil);
    color: var(--encre);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.carte-tout-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.carte-tout-texte strong { font-family: var(--titre); font-size: 28px; font-weight: 800; line-height: 1.1; }
.carte-tout-texte span { font-size: 18px; font-weight: 600; color: var(--nuit-texte); }
.carte-tout-fleche { flex-shrink: 0; color: var(--soleil); }

.filtres-tout { display: flex; flex-wrap: wrap; gap: 10px; }
.filtre {
    min-height: 48px;
    padding: 0 22px;
    border-radius: 16px;
    border: 3px solid var(--bord);
    background: var(--blanc);
    color: var(--encre);
    font-family: var(--titre);
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}
.filtre-actif { background: var(--encre); border-color: var(--encre); color: #fff; }
.tout-message { margin: 0; font-size: 18px; font-weight: 600; color: var(--encre-doux); }
.carte-tout-ferme { border-color: var(--bord); box-shadow: 0 6px 0 var(--bord); background: #FBF6EE; }
.carte-tout-ferme .carte-famille-couv { filter: grayscale(.55); opacity: .75; }
.carte-tout-ferme .carte-famille-action { background: var(--bord); color: var(--encre-pale); font-size: 16px; }
.carte-tout-ferme:active { transform: none; box-shadow: 0 6px 0 var(--bord); }

.famille-vide { margin: 0; font-size: 18px; font-weight: 600; color: #3C4270; }

.carte-plus {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 28px;
    padding: 26px 30px;
    border-radius: 28px;
    background: var(--bleu-pale);
    border: 3px dashed var(--bleu);
}
.carte-attente { border-style: solid; border-color: var(--bleu-bord); }
.carte-plus-icone {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: 26px;
    background: var(--bleu);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.carte-plus-texte { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.carte-plus-texte h2 { margin: 0; font-family: var(--titre); font-size: clamp(26px, 3.6vw, 32px); font-weight: 800; line-height: 1.1; }
.carte-plus-texte p { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.4; color: #3C4270; }

/* ================================================================ CLASSE */
.grille-eleves { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.carte-eleve {
    min-height: 196px;
    padding: 16px;
    border: 3px solid var(--bord);
    border-radius: 28px;
    background: var(--blanc);
    box-shadow: 0 6px 0 var(--bord);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--encre);
    cursor: pointer;
}
.carte-eleve:active { transform: translateY(4px); box-shadow: none; }
.carte-eleve-image { width: 104px; height: 104px; }
.carte-eleve-nom { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.carte-eleve-attente { opacity: .6; }

/* ================================================================ AVATAR */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    line-height: 1;
}
.avatar-img { width: 100%; height: 100%; object-fit: contain; }
/* Halo clair sous l'emoji : garde le contraste sur les fonds sombres. */
.avatar-emoji {
    font-size: 2.2em;
    background-image: radial-gradient(circle, rgba(255,255,255,.55) 0 42%, transparent 43%);
}
.pastille-image.avatar-emoji { font-size: 40px; }
.carte-eleve-image.avatar-emoji { font-size: 56px; }

.apercu-avatar { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.apercu-image { width: 170px; height: 170px; border: 6px solid var(--blanc); box-shadow: 0 0 0 4px var(--orange); }
.apercu-image.avatar-emoji { font-size: 90px; }
.apercu-nom { margin: 0; font-family: var(--titre); font-size: 30px; font-weight: 800; }
.grille-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px; }
.grille-couleurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.choix {
    min-height: 120px;
    padding: 12px 8px;
    border: 3px solid var(--bord);
    border-radius: 22px;
    background: var(--blanc);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--encre);
    cursor: pointer;
}
.choix-image { width: 72px; height: 72px; border-radius: 50%; }
.choix-image.avatar-emoji { font-size: 40px; }
.choix-nom { font-size: 15px; font-weight: 800; }
.choix-actif { border-color: var(--orange); background: var(--orange-pale); box-shadow: 0 0 0 3px var(--orange); }

/* ================================================================ PARENTS */
.ecran-parents { display: flex; background: var(--blanc); }
.parents-cote {
    width: min(480px, 42%);
    flex-shrink: 0;
    padding: 36px var(--marge);
    background: var(--bleu-pale);
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.lien-retour {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: none;
    color: var(--bleu-ombre);
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}
.surtitre { font-size: 15px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--bleu-ombre); }
.parents-titre { margin: 0; font-family: var(--titre); font-size: clamp(34px, 4.4vw, 44px); font-weight: 800; line-height: 1.05; }
.parents-intro { margin: 0; font-size: 18px; line-height: 1.5; color: #3C4270; }
.parents-liste { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.parents-liste li { position: relative; padding-left: 46px; font-size: 17px; line-height: 1.45; }
.parents-liste li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bleu) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.parents-principal { flex-grow: 1; display: flex; align-items: center; justify-content: center; padding: 40px var(--marge); }
.form-parents { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 18px; }
.form-titre { margin: 0 0 4px; font-family: var(--titre); font-size: 32px; font-weight: 800; line-height: 1.1; }
.form-rang { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-champ { display: flex; flex-direction: column; gap: 8px; }
.form-champ label { font-size: 16px; font-weight: 800; }
.form-champ input {
    height: 56px;
    padding: 0 18px;
    border: 2px solid #D5D9EC;
    border-radius: 14px;
    font-size: 18px;
    color: var(--encre);
    background: var(--blanc);
}
.form-champ input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 4px var(--bleu-pale); }
.form-aide { font-size: 15px; color: var(--encre-doux); }
.form-case { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; color: #3C4270; cursor: pointer; }
.form-case input { width: 24px; height: 24px; margin: 0; flex-shrink: 0; accent-color: var(--bleu); }
.form-case a { color: var(--bleu-ombre); }
.form-note { margin: 0; font-size: 15px; color: var(--encre-doux); line-height: 1.5; }
.erreur-parents { margin: 0; padding: 12px 16px; border-radius: 12px; background: #FFF1EA; color: #8A2C07; font-weight: 700; }

.ecran-bleu { background: var(--bleu-pale); }
.carte-confirmation {
    max-width: 640px;
    padding: clamp(28px, 5vw, 52px) clamp(22px, 5vw, 56px);
    box-shadow: 0 10px 0 var(--bleu-bord);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.rond-bleu { width: 120px; height: 120px; border-radius: 50%; background: var(--bleu); color: #fff; display: flex; align-items: center; justify-content: center; }
.texte-confirmation { margin: 0; font-size: 19px; line-height: 1.5; color: #3C4270; }
.etapes {
    margin: 0;
    padding: 18px 22px 18px 48px;
    width: 100%;
    border-radius: 22px;
    background: #F5F7FF;
    text-align: left;
    font-size: 17px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.etapes li::marker { color: var(--bleu); font-weight: 800; }

/* ================================================================ INSTALLATION */
#install-bar {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 50;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 20px;
    border-radius: 20px;
    background: var(--blanc);
    border: 3px solid var(--bord);
    box-shadow: 0 8px 24px rgba(29,33,64,.15);
    font-weight: 800;
    max-width: calc(100% - 32px);
}

/* ================================================================ PETITS ECRANS */
@media (max-width: 820px) {
    .ecran-parents { flex-direction: column; }
    .parents-cote { width: 100%; }
    .parents-liste { display: none; }
}
@media (max-width: 640px) {
    html, body { font-size: 17px; }
    .bandeau { flex-wrap: wrap; gap: 12px; }
    .pastille-avatar { width: 64px; height: 64px; }
    .badge-famille { order: 5; }
    .grille-exercices { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
    .carte-exercice { min-height: 160px; padding: 14px; }
    .grille-eleves { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .grille-famille { grid-template-columns: 1fr; }
    .form-rang { grid-template-columns: 1fr; }
    .btn-geant { font-size: 28px; min-height: 76px; }
    .coin-logo b { font-size: 24px; }
    .deco-soleil { display: none; }
    .carte-plus .btn { width: 100%; }
    .note-bas { position: static; margin-top: 24px; }
    .ecran-nuit { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Espace famille en attente : corriger l'adresse e-mail du parent */
.attente-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.btn-lien { background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 16px; font-weight: 700; color: var(--bleu); text-decoration: underline; cursor: pointer; }
.attente-changer { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; }
.attente-changer label { font-size: 17px; font-weight: 800; }
.attente-changer-ligne { display: flex; flex-wrap: wrap; gap: 10px; }
.attente-changer input { flex: 1 1 240px; min-width: 0; padding: 12px 14px; border: 3px solid var(--bleu-bord); border-radius: 14px; font: inherit; font-size: 18px; background: var(--blanc); color: var(--encre); }
.attente-changer input:focus { outline: none; box-shadow: 0 0 0 5px var(--bleu-pale); }
