/* =========================================================================
   TIICHING — feuille de style
   Interface pensée pour un lycéen : couleurs franches, grandes zones
   tactiles, lecture rapide sur téléphone.
   ========================================================================= */

:root {
    --fond: #1b1140;
    --fond-2: #2a1a5e;
    --carte: #ffffff;
    --carte-2: #f6f4ff;
    --encre: #1a1430;
    --encre-douce: #5b5476;
    --trait: #e7e3f5;

    --violet: #7b3cf0;
    --rose: #f0399b;
    --lime: #b8f02a;
    --cyan: #28d2e8;
    --or: #ffc93c;
    --vert: #2fc46b;
    --rouge: #f0495b;

    --rayon: 22px;
    --rayon-s: 14px;
    --ombre: 0 10px 30px rgba(20, 8, 60, .18);
    --ombre-douce: 0 4px 14px rgba(20, 8, 60, .10);

    --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--police);
    background: var(--fond);
    color: var(--encre);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.cache { display: none !important; }

/* ------------------------------------------------------------------- fond */

.fond {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(120% 90% at 10% 0%, var(--fond-2) 0%, var(--fond) 55%);
}
.fond span {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
}
.fond span:nth-child(1) { width: 320px; height: 320px; background: var(--violet); top: -80px; left: -60px; }
.fond span:nth-child(2) { width: 260px; height: 260px; background: var(--rose); top: 32%; right: -90px; opacity: .35; }
.fond span:nth-child(3) { width: 300px; height: 300px; background: var(--cyan); bottom: -120px; left: 20%; opacity: .25; }

/* -------------------------------------------------------------- connexion */

.ecran {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.bloc-connexion {
    width: 100%;
    max-width: 380px;
    background: var(--carte);
    border-radius: 28px;
    padding: 32px 26px;
    box-shadow: var(--ombre);
    text-align: center;
}

.logo-tiiching {
    width: 76px;
    height: 76px;
    margin: 0 auto 14px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--violet), var(--rose));
    box-shadow: 0 8px 20px rgba(123, 60, 240, .4);
}
.logo-tiiching svg { width: 100%; height: 100%; display: block; }

.titre-tiiching {
    margin: 0;
    font-size: 0;
    line-height: 0;
}
.titre-tiiching .logotype {
    width: 168px;
    max-width: 62%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sous-titre {
    margin: 6px 0 24px;
    color: var(--encre-douce);
    font-size: 15px;
}

/* ------------------------------------------------------------ formulaires */

.formulaire { display: grid; gap: 14px; text-align: left; }

.formulaire label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--encre-douce);
}

.formulaire input[type="text"],
.formulaire input[type="email"],
.formulaire input[type="password"],
.formulaire textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    color: var(--encre);
    background: var(--carte-2);
    border: 2px solid var(--trait);
    border-radius: var(--rayon-s);
    transition: border-color .15s;
}
.formulaire input:focus, .formulaire textarea:focus {
    outline: none;
    border-color: var(--violet);
}

.ligne-case {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.ligne-case input { width: 20px; height: 20px; }

.bouton-principal {
    margin-top: 6px;
    padding: 16px;
    font: 700 17px/1 var(--police);
    color: #fff;
    background: linear-gradient(100deg, var(--violet), var(--rose));
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(123, 60, 240, .35);
    transition: transform .12s, box-shadow .12s;
}
.bouton-principal:active { transform: translateY(2px); box-shadow: 0 4px 10px rgba(123, 60, 240, .3); }
.bouton-principal[disabled] { opacity: .55; cursor: progress; }

.message-erreur { margin: 4px 0 0; color: var(--rouge); font-size: 14px; font-weight: 600; min-height: 18px; }

/* --------------------------------------------------------------- barre haut */

#application { position: relative; z-index: 1; }

.barre-haut {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: rgba(27, 17, 64, .82);
    backdrop-filter: blur(14px);
}

.bouton-retour {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    font-size: 20px;
    color: #fff;
    background: rgba(255,255,255,.14);
    border: 0; border-radius: 12px;
    cursor: pointer;
}

.bloc-rang { flex: 1 1 auto; min-width: 0; }

.ligne-rang {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; margin-bottom: 5px;
}
.rang-titre { color: #fff; font-weight: 700; font-size: 14px; }
.rang-xp { color: rgba(255,255,255,.65); font-size: 12px; font-variant-numeric: tabular-nums; }

.jauge {
    height: 7px;
    background: rgba(255,255,255,.16);
    border-radius: 999px;
    overflow: hidden;
}
.jauge-remplie {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--lime), var(--cyan));
    transition: width .5s cubic-bezier(.3,1.4,.5,1);
}

.pastille-serie {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 4px;
    padding: 8px 12px;
    font: 700 14px var(--police);
    color: var(--or);
    background: rgba(255, 201, 60, .16);
    border: 0; border-radius: 999px;
    cursor: default;
}

/* ------------------------------------------------------------------- vues */

main#vue {
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 16px calc(96px + env(safe-area-inset-bottom));
}

.salut {
    margin: 6px 0 18px;
    color: #fff;
}
.salut h2 { margin: 0; font-size: 26px; letter-spacing: -.4px; }
.salut p { margin: 4px 0 0; color: rgba(255,255,255,.7); font-size: 14px; }

.titre-section {
    margin: 26px 0 12px;
    color: rgba(255,255,255,.85);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ----------------------------------------------------------- tuiles matières */

.grille-matieres {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 620px) {
    .grille-matieres { grid-template-columns: repeat(3, 1fr); }
}

.tuile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 14px 14px;
    text-align: left;
    color: #fff;
    border: 0;
    border-radius: var(--rayon);
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--ombre-douce);
    transition: transform .14s;
}
.tuile:active { transform: scale(.97); }
.tuile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(255,255,255,.26), rgba(0,0,0,.16));
    pointer-events: none;
}
.tuile-icone { font-size: 30px; line-height: 1; }
.tuile-nom { font-size: 15px; font-weight: 700; line-height: 1.25; }
.tuile-info { font-size: 12px; opacity: .85; font-variant-numeric: tabular-nums; }
.tuile-jauge {
    height: 6px; border-radius: 999px;
    background: rgba(0,0,0,.22);
    overflow: hidden;
}
.tuile-jauge > div {
    height: 100%;
    background: #fff;
    border-radius: 999px;
    transition: width .4s;
}
.tuile > * { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ cartes */

.carte {
    background: var(--carte);
    border-radius: var(--rayon);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--ombre-douce);
}

.carte-entete {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 4px;
}
.carte-entete .emoji {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    font-size: 24px;
    border-radius: 14px;
    background: var(--carte-2);
}
.carte-entete h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.carte-entete p { margin: 2px 0 0; font-size: 13px; color: var(--encre-douce); }

/* --------------------------------------------------------- liste de leçons */

.theme-bloc { margin-bottom: 10px; }

.theme-titre {
    width: 100%;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 16px;
    font: 700 15px/1.3 var(--police);
    text-align: left;
    color: #fff;
    background: rgba(255,255,255,.1);
    border: 0;
    border-radius: var(--rayon-s);
    cursor: pointer;
}
.theme-titre .chevron { transition: transform .2s; opacity: .7; }
.theme-titre.ouvert .chevron { transform: rotate(90deg); }

.liste-lecons { display: grid; gap: 8px; padding: 8px 0 4px; }

.lecon-ligne {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 13px 15px;
    text-align: left;
    background: var(--carte);
    border: 0;
    border-radius: var(--rayon-s);
    cursor: pointer;
    box-shadow: var(--ombre-douce);
    transition: transform .12s;
}
.lecon-ligne:active { transform: scale(.985); }
.lecon-ligne .etat {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    font-size: 14px; font-weight: 700;
    border-radius: 50%;
    background: var(--carte-2);
    color: var(--encre-douce);
}
.lecon-ligne .etat.faite { background: rgba(47,196,107,.16); color: var(--vert); }
.lecon-ligne .texte { flex: 1 1 auto; min-width: 0; }
.lecon-ligne .texte strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.lecon-ligne .texte span { font-size: 12px; color: var(--encre-douce); }
.lecon-ligne .fleche { color: var(--trait); font-size: 18px; }

.etoiles { letter-spacing: 1px; font-size: 11px; }

/* -------------------------------------------------------------- leçon vue */

.illustration {
    margin: 0 0 14px;
    border-radius: var(--rayon);
    overflow: hidden;
    background: var(--carte-2);
}
.illustration img { display: block; width: 100%; height: 170px; object-fit: cover; }
.illustration figcaption {
    padding: 7px 12px;
    font-size: 11px;
    color: var(--encre-douce);
    background: var(--carte);
}
.illustration a { color: var(--violet); }

.accroche {
    margin: 0 0 16px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--encre);
    background: linear-gradient(120deg, rgba(123,60,240,.1), rgba(240,57,155,.1));
    border-radius: var(--rayon-s);
}

.essentiel { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.essentiel li {
    display: flex; gap: 11px;
    font-size: 15px; line-height: 1.5;
}
.essentiel li .puce {
    flex: 0 0 auto;
    width: 24px; height: 24px;
    display: grid; place-items: center;
    margin-top: 1px;
    font-size: 12px; font-weight: 700;
    color: #fff;
    background: linear-gradient(140deg, var(--violet), var(--rose));
    border-radius: 50%;
}

.retenir { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.puce-terme {
    padding: 9px 13px;
    font-size: 13px;
    background: var(--carte-2);
    border: 2px solid var(--trait);
    border-radius: 999px;
    cursor: pointer;
}
.puce-terme strong { color: var(--violet); }

.bloc-info {
    margin-bottom: 14px;
    padding: 14px 16px;
    font-size: 14px; line-height: 1.5;
    border-radius: var(--rayon-s);
    background: var(--carte-2);
}
.bloc-info .etiquette {
    display: block;
    margin-bottom: 4px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--encre-douce);
}
.bloc-info.piege { background: rgba(240,201,60,.14); }
.bloc-info.piege .etiquette { color: #a07400; }

/* ------------------------------------------------------------- actions */

.actions { display: grid; gap: 10px; margin: 18px 0 8px; }
@media (min-width: 520px) { .actions { grid-template-columns: 1fr 1fr; } }

.bouton-action {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 15px 16px;
    font: 700 15px var(--police);
    color: var(--encre);
    background: var(--carte);
    border: 2px solid var(--trait);
    border-radius: 999px;
    cursor: pointer;
    transition: transform .12s, border-color .12s;
}
.bouton-action:active { transform: translateY(2px); }
.bouton-action.plein {
    color: #fff;
    background: linear-gradient(100deg, var(--violet), var(--rose));
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(123,60,240,.3);
}
.bouton-action.pleine-largeur { grid-column: 1 / -1; }
.bouton-action[disabled] { opacity: .6; cursor: progress; }

/* --------------------------------------------------------- aller plus loin */

.depliable { margin-top: 10px; }
.depliable > summary {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    font: 700 14px var(--police);
    color: #fff;
    background: rgba(255,255,255,.1);
    border-radius: var(--rayon-s);
    cursor: pointer;
    list-style: none;
}
.depliable > summary::-webkit-details-marker { display: none; }
.depliable[open] > summary { border-radius: var(--rayon-s) var(--rayon-s) 0 0; }
.depliable-corps {
    padding: 14px;
    background: var(--carte);
    border-radius: 0 0 var(--rayon-s) var(--rayon-s);
}

.ressource {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid var(--trait);
    color: inherit;
    text-decoration: none;
}
.ressource:last-child { border-bottom: 0; }
.ressource img { width: 84px; height: 48px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.ressource .icone-res {
    width: 36px; height: 36px; flex: 0 0 auto;
    display: grid; place-items: center;
    font-size: 17px;
    background: var(--carte-2);
    border-radius: 10px;
}
.ressource strong { display: block; font-size: 14px; line-height: 1.35; }
.ressource span { font-size: 12px; color: var(--encre-douce); }

/* -------------------------------------------------------------- sources */

.sources {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--trait);
}
.sources .etiquette {
    display: block; margin-bottom: 8px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: var(--encre-douce);
}
.sources ol { margin: 0; padding-left: 20px; }
.sources li { margin-bottom: 5px; font-size: 12px; line-height: 1.4; }
.sources a { color: var(--violet); word-break: break-word; }

/* ------------------------------------------------------------- exercices */

.exo-entete {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
    color: #fff;
}
.exo-entete .compteur { font-size: 13px; opacity: .75; font-variant-numeric: tabular-nums; }
.exo-entete .niveau {
    padding: 6px 12px;
    font-size: 12px; font-weight: 700;
    background: rgba(255,255,255,.14);
    border-radius: 999px;
}

.exo-points { display: flex; gap: 6px; margin-bottom: 16px; }
.exo-points i {
    flex: 1 1 0;
    height: 6px;
    background: rgba(255,255,255,.2);
    border-radius: 999px;
}
.exo-points i.faite { background: var(--lime); }
.exo-points i.courante { background: #fff; }

.enonce { margin: 0 0 18px; font-size: 18px; line-height: 1.45; font-weight: 600; }

.choix { display: grid; gap: 10px; }
.choix button {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 16px;
    font: 500 15px/1.4 var(--police);
    text-align: left;
    color: var(--encre);
    background: var(--carte-2);
    border: 2px solid var(--trait);
    border-radius: var(--rayon-s);
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.choix button .lettre {
    flex: 0 0 auto;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    font-weight: 700; font-size: 13px;
    background: #fff;
    border-radius: 50%;
}
.choix button.choisi { border-color: var(--violet); background: rgba(123,60,240,.08); }
.choix button.juste { border-color: var(--vert); background: rgba(47,196,107,.12); }
.choix button.faux { border-color: var(--rouge); background: rgba(240,73,91,.1); }
.choix button[disabled] { cursor: default; }

.reponse-libre { display: grid; gap: 10px; }
.reponse-libre input {
    padding: 15px 16px;
    font-size: 17px; font-family: inherit;
    background: var(--carte-2);
    border: 2px solid var(--trait);
    border-radius: var(--rayon-s);
}
.reponse-libre input:focus { outline: none; border-color: var(--violet); }

.indice { font-size: 13px; color: var(--encre-douce); }
.indice button {
    padding: 0; font: inherit; font-weight: 700;
    color: var(--violet); background: none; border: 0; cursor: pointer;
    text-decoration: underline;
}

.verdict {
    margin-top: 16px;
    padding: 14px 16px;
    font-size: 14px; line-height: 1.5;
    border-radius: var(--rayon-s);
}
.verdict.juste { background: rgba(47,196,107,.14); }
.verdict.faux { background: rgba(240,73,91,.12); }
.verdict strong { display: block; margin-bottom: 4px; font-size: 15px; }

/* --------------------------------------------------------------- oral */

.bloc-oral { text-align: center; }
.phrase-oral {
    margin: 0 0 6px;
    font-size: 22px; font-weight: 700; line-height: 1.35;
}
.traduction-oral { margin: 0 0 18px; font-size: 14px; color: var(--encre-douce); }

.bouton-micro {
    width: 92px; height: 92px;
    margin: 0 auto 12px;
    display: grid; place-items: center;
    font-size: 36px;
    color: #fff;
    background: linear-gradient(140deg, var(--violet), var(--rose));
    border: 0; border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(123,60,240,.4);
}
.bouton-micro.ecoute { animation: pulsation 1.1s infinite; }
@keyframes pulsation {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(240,57,155,.5); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(240,57,155,0); }
}
.transcription { min-height: 22px; font-size: 16px; font-weight: 600; }

/* ----------------------------------------------------------- résultat */

.resultat { text-align: center; }
.resultat .score {
    font-size: 54px; font-weight: 800; letter-spacing: -2px;
    background: linear-gradient(100deg, var(--violet), var(--rose));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.resultat .score small { font-size: 22px; color: var(--encre-douce); -webkit-text-fill-color: var(--encre-douce); }
.resultat .mot { margin: 4px 0 16px; font-size: 16px; font-weight: 600; }
.resultat .gain {
    display: inline-block;
    padding: 8px 16px; margin-bottom: 18px;
    font-weight: 700; color: #6b8f00;
    background: rgba(184,240,42,.26);
    border-radius: 999px;
}

.rappel-correction { text-align: left; margin-top: 10px; }
.rappel-correction .ligne {
    padding: 11px 0;
    border-bottom: 1px solid var(--trait);
    font-size: 14px; line-height: 1.45;
}
.rappel-correction .ligne:last-child { border-bottom: 0; }
.rappel-correction .marque { font-weight: 700; margin-right: 6px; }

/* ----------------------------------------------------------- badges */

.grille-badges {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.badge {
    padding: 14px 10px;
    text-align: center;
    background: var(--carte-2);
    border-radius: var(--rayon-s);
    opacity: .4;
    filter: grayscale(1);
}
.badge.obtenu { opacity: 1; filter: none; background: linear-gradient(150deg, rgba(255,201,60,.22), rgba(240,57,155,.14)); }
.badge .icone { font-size: 28px; }
.badge .nom { display: block; margin-top: 5px; font-size: 12px; font-weight: 700; line-height: 1.25; }
.badge .quoi { display: block; margin-top: 2px; font-size: 10px; color: var(--encre-douce); line-height: 1.3; }

.stats-ligne {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    margin-bottom: 14px;
}
.stat {
    padding: 14px 10px;
    text-align: center;
    background: var(--carte);
    border-radius: var(--rayon-s);
    box-shadow: var(--ombre-douce);
}
.stat b { display: block; font-size: 24px; letter-spacing: -1px; }
.stat span { font-size: 11px; color: var(--encre-douce); text-transform: uppercase; letter-spacing: .5px; }

/* ------------------------------------------------------------ barre basse */

.barre-basse {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 30;
    display: flex;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(27, 17, 64, .9);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,.08);
}
.barre-basse button {
    flex: 1 1 0;
    display: grid; justify-items: center; gap: 2px;
    padding: 8px 4px;
    font: 600 10px var(--police);
    font-size: 19px;
    color: rgba(255,255,255,.55);
    background: none; border: 0;
    border-radius: 12px;
    cursor: pointer;
}
.barre-basse button span { font-size: 10px; letter-spacing: .3px; }
.barre-basse button.actif { color: #fff; background: rgba(255,255,255,.1); }

/* ------------------------------------------- navigateur sur grand écran
   Sur ordinateur la barre du bas devient une pastille flottante centrée
   sur la colonne de contenu, au lieu de barrer tout l'écran.
   ---------------------------------------------------------------------- */

@media (min-width: 800px) {
    .barre-basse {
        left: 50%;
        right: auto;
        bottom: 20px;
        width: 420px;
        transform: translateX(-50%);
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, .12);
        border-radius: 999px;
        box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
    }
    .barre-basse button { border-radius: 999px; }
    main#vue { padding-bottom: 120px; }
}

/* ------------------------------------------------------- hors connexion */

.bandeau-hors-ligne {
    position: fixed;
    left: 50%;
    bottom: calc(86px + env(safe-area-inset-bottom));
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90vw;
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 700;
    color: #4a3200;
    background: var(--or);
    border-radius: 999px;
    box-shadow: var(--ombre);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.bandeau-hors-ligne.visible { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------- installation */

.carte-installer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    margin-bottom: 14px;
    color: #fff;
    background: linear-gradient(110deg, rgba(123, 60, 240, .9), rgba(240, 57, 155, .9));
    border-radius: var(--rayon);
    box-shadow: var(--ombre-douce);
}
.carte-installer .texte { flex: 1 1 auto; min-width: 0; }
.carte-installer strong { display: block; font-size: 15px; }
.carte-installer span { font-size: 12.5px; opacity: .85; line-height: 1.4; }
.carte-installer button {
    flex: 0 0 auto;
    padding: 11px 16px;
    font: 700 14px var(--police);
    color: var(--violet);
    background: #fff;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
.carte-installer .fermer {
    flex: 0 0 auto;
    width: 30px; height: 30px; padding: 0;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 255, 255, .2);
}

/* ---------------------------------------------------------------- modale */

.modale {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: end center;
    padding: 0;
    background: rgba(12, 6, 30, .6);
    backdrop-filter: blur(3px);
}
.modale-boite {
    position: relative;
    width: 100%; max-width: 620px;
    max-height: 92vh;
    overflow: auto;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    background: var(--carte);
    border-radius: 26px 26px 0 0;
    animation: monte .22s ease-out;
}
@media (min-width: 620px) {
    .modale { place-items: center; padding: 20px; }
    .modale-boite { border-radius: 26px; }
}
@keyframes monte { from { transform: translateY(26px); opacity: .6; } }

.modale-fermer {
    position: absolute; top: 14px; right: 14px;
    width: 34px; height: 34px;
    font-size: 15px;
    color: var(--encre-douce);
    background: var(--carte-2);
    border: 0; border-radius: 50%;
    cursor: pointer;
}
.modale-contenu h3 { margin: 0 24px 12px 0; font-size: 20px; }
.modale-contenu p { line-height: 1.55; }

.cadre-outil {
    width: 100%;
    height: min(70vh, 520px);
    border: 0;
    border-radius: var(--rayon-s);
    background: var(--carte-2);
}
.credit-outil { margin: 8px 0 0; font-size: 11px; color: var(--encre-douce); }

/* ------------------------------------------------- choix classe et matières */

.titre-groupe {
    margin: 18px 0 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--encre-douce);
}

.liste-choix { display: grid; gap: 8px; }

.choix-niveau,
.choix-matiere {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 15px;
    text-align: left;
    font: inherit;
    color: var(--encre);
    background: var(--carte-2);
    border: 2px solid var(--trait);
    border-radius: var(--rayon-s);
    cursor: pointer;
}
.choix-niveau.actif,
.choix-matiere.actif {
    border-color: var(--violet);
    background: rgba(123, 60, 240, .07);
}
.choix-niveau .ic,
.choix-matiere .ic {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    font-size: 19px;
    background: #fff;
    border-radius: 11px;
}
.choix-niveau > span:nth-child(2),
.choix-matiere > span:last-child { flex: 1 1 auto; min-width: 0; }
.choix-niveau strong,
.choix-matiere strong { display: block; font-size: 15px; }
.choix-niveau span span,
.choix-matiere span span { font-size: 12px; color: var(--encre-douce); line-height: 1.35; }
.choix-niveau .coche { color: var(--violet); font-weight: 700; }
.choix-matiere input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--violet); }

/* ----------------------------------------------------------------- toast */

.toast {
    position: fixed;
    left: 50%; bottom: calc(86px + env(safe-area-inset-bottom));
    z-index: 60;
    transform: translate(-50%, 24px);
    max-width: 88vw;
    padding: 13px 18px;
    font-size: 14px; font-weight: 600;
    color: var(--encre);
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--ombre);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.badge-toast { background: linear-gradient(100deg, var(--or), var(--rose)); color: #3a1200; }

/* -------------------------------------------------------------- attente */

.attente {
    display: grid; place-items: center; gap: 14px;
    padding: 48px 20px;
    text-align: center;
    color: rgba(255,255,255,.8);
}
.attente .roue {
    width: 44px; height: 44px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: var(--lime);
    border-radius: 50%;
    animation: tourne .9s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
.attente p { margin: 0; font-size: 14px; }
.attente small { color: rgba(255,255,255,.5); font-size: 12px; }

.vide {
    padding: 30px 20px;
    text-align: center;
    color: rgba(255,255,255,.65);
    font-size: 14px;
}

.alerte {
    margin: 14px 0;
    padding: 14px 16px;
    font-size: 14px; line-height: 1.5;
    color: #7a1020;
    background: rgba(240,73,91,.14);
    border-radius: var(--rayon-s);
}
.succes {
    margin: 14px 0;
    padding: 14px 16px;
    font-size: 14px;
    color: #10572f;
    background: rgba(47,196,107,.16);
    border-radius: var(--rayon-s);
}

/* ======================================================= pages autonomes
   install.php et parent.php : même identité, mise en page sobre.
   ===================================================================== */

.page-simple {
    display: grid;
    place-items: start center;
    padding: 28px 16px 60px;
    background: radial-gradient(120% 80% at 10% 0%, var(--fond-2), var(--fond));
    min-height: 100vh;
}

.carte-simple {
    width: 100%; max-width: 680px;
    padding: 28px 24px;
    background: var(--carte);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
}
.carte-simple h1 { margin: 0 0 18px; font-size: 26px; }
.carte-simple h2 { margin: 24px 0 10px; font-size: 16px; text-transform: uppercase; letter-spacing: .8px; color: var(--encre-douce); }
.carte-simple code { padding: 2px 6px; font-size: 13px; background: var(--carte-2); border-radius: 6px; }

.liste-checks { margin: 0; padding: 0; list-style: none; }
.liste-checks li { padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--trait); }
.liste-checks li.ko { color: #a1121f; font-weight: 600; }

.etapes { padding-left: 22px; line-height: 1.8; font-size: 15px; }

/* ========================================================== pictogrammes
   Deux jeux de la même famille d'icônes : le jeu blanc pour les tuiles de
   matière et les fonds colorés, le jeu violet pour les cartes claires.
   Le JS choisit le bon dossier, le CSS ne gère que les dimensions. */

img.picto {
    display: block;
    width: 100%; height: 100%;
    object-fit: contain;
}

.tuile-icone.picto { width: 36px; height: 36px; }

.carte-entete .emoji img.picto { width: 27px; height: 27px; }

.choix-matiere .ic img.picto { width: 24px; height: 24px; }

.badge img.picto-badge {
    display: block;
    width: 46px; height: 46px;
    margin: 0 auto;
}

.illustration-resultat {
    display: block;
    width: 116px; height: 116px;
    margin: 0 auto 10px;
    object-fit: contain;
}

.toast.badge-toast {
    display: flex; align-items: center; gap: 10px;
    text-align: left;
}
.toast img.toast-badge { flex: 0 0 auto; width: 30px; height: 30px; }

@media (min-width: 800px) {
    .tuile-icone.picto { width: 42px; height: 42px; }
    .illustration-resultat { width: 136px; height: 136px; }
}

/* ------------------------------------------------- attendus du programme */

.liste-notions { margin: 0; padding-left: 20px; }
.liste-notions li {
    margin-bottom: 7px;
    font-size: 14px; line-height: 1.5;
}
.liste-notions li::marker { color: var(--violet); }
.liste-notions + .indice { margin-top: 10px; }

/* ------------------------------------------------------------ inscription */

.bascule-compte {
    margin: 18px 0 0;
    font-size: 14px;
    color: var(--encre-douce);
    text-align: center;
}
.bascule-compte button {
    padding: 2px 4px;
    font: inherit;
    font-weight: 700;
    color: var(--violet);
    background: none;
    border: 0;
    border-bottom: 2px solid rgba(123, 60, 240, .35);
    cursor: pointer;
}
.bascule-compte button:hover { border-bottom-color: var(--violet); }

#form-inscription select {
    width: 100%;
    padding: 13px 14px;
    font: inherit;
    color: var(--encre);
    background: #fff;
    border: 0;
    border-radius: var(--rayon-s);
    appearance: none;
}

/* ------------------------------------------------------------ mon compte */

.formulaire-modale label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px; font-weight: 600;
    color: var(--encre);
}
.formulaire-modale input {
    width: 100%; margin-top: 5px;
    padding: 12px 14px; font: inherit;
    color: var(--encre);
    background: var(--carte-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-s);
}
.formulaire-modale input:focus { outline: 2px solid var(--violet); outline-offset: 1px; }
.formulaire-modale .message-erreur:empty { display: none; }

.bouton-action.danger {
    color: #c81e2d;
    border-color: rgba(200, 30, 45, .35);
}
.bouton-action.danger:hover { background: rgba(200, 30, 45, .08); }

#mon-compte .depliable-corps > .bouton-action { margin-bottom: 8px; }
#mon-compte .indice { margin: 6px 0 0; }

/* ------------------------------------------------ boutons d'installation */

.bouton-installer-barre {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 6px;
    margin-right: 8px;
    padding: 7px 12px;
    font: inherit; font-size: 13px; font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    cursor: pointer;
}
.bouton-installer-barre:hover { background: rgba(255, 255, 255, .22); }
.bouton-installer-barre:active { transform: scale(.96); }

@media (max-width: 520px) {
    .bouton-installer-barre span { display: none; }
    .bouton-installer-barre { padding: 7px 10px; font-size: 15px; }
}

.bouton-installer-accueil {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    margin-top: 18px;
    padding: 13px 15px;
    font: inherit;
    text-align: left;
    color: var(--encre);
    background: var(--carte-2);
    border: 1px solid var(--trait);
    border-radius: var(--rayon-s);
    cursor: pointer;
}
.bouton-installer-accueil:hover { border-color: var(--violet); }
.bouton-installer-accueil .ic { flex: 0 0 auto; font-size: 23px; }
.bouton-installer-accueil strong { display: block; font-size: 14px; }
.bouton-installer-accueil span span { font-size: 12px; line-height: 1.4; color: var(--encre-douce); }

/* -------------------------------------------------------- recherche */

.barre-recherche {
    position: relative;
    display: flex; align-items: center;
    margin-bottom: 14px;
}
.barre-recherche .loupe {
    position: absolute; left: 14px;
    font-size: 15px; opacity: .6; pointer-events: none;
}
.barre-recherche input {
    width: 100%;
    padding: 13px 42px 13px 40px;
    font: inherit; font-size: 15px;
    color: #fff;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    -webkit-appearance: none;
}
.barre-recherche input::placeholder { color: rgba(255, 255, 255, .55); }
.barre-recherche input:focus {
    outline: none;
    border-color: rgba(184, 240, 42, .6);
    background: rgba(255, 255, 255, .15);
}
.barre-recherche input::-webkit-search-cancel-button { display: none; }
.barre-recherche .vider {
    position: absolute; right: 8px;
    width: 28px; height: 28px;
    font-size: 13px; color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .14);
    border: 0; border-radius: 50%;
    cursor: pointer;
}

.resultat-lecon {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    margin-bottom: 8px;
    padding: 12px 14px;
    font: inherit; text-align: left;
    color: var(--encre);
    background: var(--carte);
    border: 0; border-radius: var(--rayon-s);
    box-shadow: var(--ombre-douce);
    cursor: pointer;
}
.resultat-lecon:active { transform: scale(.99); }
.resultat-lecon .ic {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    font-size: 19px;
    border-radius: 11px;
}
.resultat-lecon .ic img.picto { width: 24px; height: 24px; }
.resultat-lecon .texte { flex: 1 1 auto; min-width: 0; }
.resultat-lecon .texte strong {
    display: block;
    font-size: 15px; line-height: 1.3;
}
.resultat-lecon .texte span {
    display: block; margin-top: 2px;
    font-size: 12px; color: var(--encre-douce);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.resultat-lecon .deja {
    flex: 0 0 auto;
    padding: 3px 9px;
    font-size: 11px; font-weight: 700;
    color: #1a8a4a; background: rgba(47, 196, 107, .14);
    border-radius: 999px;
}

/* ------------------------------------------- décor de l'écran de connexion
   La grille de matières de l'application, floutée à la fabrication plutôt
   qu'au rendu : un filtre CSS plein écran coûte cher sur un téléphone. */

.decor-connexion {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--fond) url('../img/site/decor-connexion-petit.webp') center/cover no-repeat;
    pointer-events: none;
}
@media (min-width: 760px) {
    .decor-connexion {
        background-image: url('../img/site/decor-connexion.webp');
    }
}
.decor-connexion::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center,
        rgba(16, 9, 38, .34) 0%, rgba(16, 9, 38, .72) 72%);
}

#ecran-connexion .bloc-connexion { position: relative; z-index: 1; }
