/* Ezzouhoure — feuille de style. Palette : parchemin, encre, vert d'émeraude, or. */
:root {
  --fond: #F6F1E7; --papier: #FFFDF8; --encre: #1D2A24; --doux: #5C6B63; --ligne: #E3DACA;
  --vert: #0F5132; --vert-2: #E6F0EA; --or: #B88A2E; --or-2: #F5ECD7; --rouge: #B3261E; --rouge-2: #FBE9E7;
  --bleu: #1F4E8C; --bleu-2: #E7EEF8; --orange: #A65F00; --orange-2: #FFF1DC; --gris-2: #EEEBE4;
  --r: 14px; --ombre: 0 1px 2px rgba(29,42,36,.06), 0 6px 22px rgba(29,42,36,.06);
  --ar: 'Amiri', 'Sakkal Majalla', 'Traditional Arabic', 'Noto Naskh Arabic', 'Geeza Pro', 'Arabic Typesetting', serif;
  --fr: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 17px/1.55 var(--fr); }
a { color: var(--vert); }
h1, h2, h3 { line-height: 1.2; margin: .2em 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -.01em; }
h1 small, h2 small, h3 small { font-size: .55em; color: var(--doux); font-weight: 400; }
.enveloppe { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.enveloppe { padding-top: 22px; padding-bottom: 50px; min-height: 70vh; }
.ar, [lang="ar"] { font-family: var(--ar); direction: rtl; unicode-bidi: isolate; }
.ar.grand { font-size: 1.6em; } .ar.tres-grand { font-size: 2.4em; line-height: 1.5; }
.aide { color: var(--doux); font-size: .92em; }
.surtitre { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--doux); margin: 0 0 .3em; font-weight: 600; }

/* En-tête */
.entete { background: var(--vert); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.entete-in { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.logo { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.logo-ar { font-family: var(--ar); font-size: 1.9rem; color: #F3E3B5; line-height: 1; }
.logo-fr { font-weight: 700; letter-spacing: .02em; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.nav a { color: #E3EFE8; text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a.actif { background: rgba(255,255,255,.13); color: #fff; }
.nav .nav-compte { margin-left: 8px; border: 1px solid rgba(255,255,255,.3); }
.nav .bouton.petit { background: var(--or); color: #fff; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }
@media (max-width: 960px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--vert); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  body.menu-ouvert .nav { display: flex; }
  .nav .nav-compte { margin-left: 0; }
}

/* Pied */
.pied { border-top: 1px solid var(--ligne); color: var(--doux); font-size: .9rem; padding: 18px 0; }
.pied .enveloppe { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Éléments */
.carte { background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r); padding: 20px 22px; margin: 0 0 18px; box-shadow: var(--ombre); }
.carte.etroit, .etroit { max-width: 520px; margin-left: auto; margin-right: auto; }
.centre { text-align: center; }
.deux-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.bouton { display: inline-block; background: var(--vert); color: #fff; border: 0; border-radius: 10px; padding: 11px 20px; font: 600 1rem var(--fr); cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; }
.bouton:hover { background: #0B3F27; } .bouton:active { transform: translateY(1px); }
.bouton:disabled { opacity: .45; cursor: default; }
.bouton.clair { background: var(--vert-2); color: var(--vert); } .bouton.clair:hover { background: #D6E8DD; }
.bouton.petit { padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.lien-danger { background: none; border: 0; color: var(--rouge); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.flash { padding: 11px 15px; border-radius: 10px; margin: 0 0 14px; border: 1px solid transparent; }
.flash.ok { background: var(--vert-2); border-color: #BCD8C7; } .flash.ko { background: var(--rouge-2); border-color: #F1C1BC; color: #7d1a14; }
.flash.att { background: var(--orange-2); border-color: #F0D3A6; } .flash.info { background: var(--bleu-2); border-color: #C6D5EC; }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--vert-2); color: var(--vert); } .badge.info { background: var(--bleu-2); color: var(--bleu); }
.badge.att { background: var(--orange-2); color: var(--orange); } .badge.ko { background: var(--rouge-2); color: var(--rouge); } .badge.gris { background: var(--gris-2); color: var(--doux); }
.coches { padding-left: 0; list-style: none; } .coches li { padding-left: 26px; position: relative; margin: 6px 0; }
.coches li::before { content: '✓'; position: absolute; left: 4px; color: var(--vert); font-weight: 700; }
.jauge { height: 10px; background: var(--gris-2); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.jauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--vert), #2E8B57); border-radius: 99px; transition: width .4s; }
.jauge.petite { height: 6px; display: inline-block; width: 120px; vertical-align: middle; margin: 0 6px 0 0; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 18px; }
.stats > div { background: var(--papier); border: 1px solid var(--ligne); border-radius: 12px; padding: 12px 16px; min-width: 150px; flex: 1; }
.stats b { display: block; font-size: 1.35rem; } .stats.grandes b { font-size: 1.6rem; color: var(--vert); } .stats small { color: var(--doux); }
b.ko { color: var(--rouge) !important; }
code, .bloc-code { background: var(--gris-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; word-break: break-all; }
.bloc-code { display: block; padding: 10px 12px; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; background: var(--papier); font-size: .95rem; }
.tableau th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); border-bottom: 2px solid var(--ligne); padding: 8px; }
.tableau td { border-bottom: 1px solid var(--ligne); padding: 8px; vertical-align: top; }
.tableau tr.total td { font-weight: 700; border-top: 2px solid var(--ligne); background: var(--or-2); }
.tableau .num { text-align: right; white-space: nowrap; }
.tableau tr.inactif td { opacity: .55; } .tableau tr.annule td { text-decoration: line-through; opacity: .55; }
.defile { overflow-x: auto; }
.matrice th, .matrice td { text-align: center; padding: 4px 3px; font-size: .8rem; min-width: 26px; }
.matrice td:first-child, .matrice th:first-child { text-align: left; min-width: 150px; }
td.etat-valide, .cel.etat-valide { background: #D7EBDF; } td.etat-ouvert, .cel.etat-ouvert { background: var(--bleu-2); }
td.etat-verrouille, .cel.etat-verrouille { background: var(--gris-2); color: #999; } td.etat-verrouille_paiement, .cel.etat-verrouille_paiement { background: var(--orange-2); }

/* Formulaires */
.formulaire label { display: block; margin: 10px 0; font-size: .92rem; color: var(--doux); font-weight: 600; }
.formulaire input:not([type=radio]):not([type=checkbox]):not([type=file]), .formulaire select, .formulaire textarea, .filtres input, .filtres select, .ligne-form input, .ligne-form select {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #CFC5B3; border-radius: 9px; background: #fff; font: 400 1rem var(--fr); color: var(--encre); }
.formulaire textarea { resize: vertical; }
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus { outline: 2px solid #9BC6AE; border-color: var(--vert); }
.formulaire fieldset { border: 1px solid var(--ligne); border-radius: 12px; padding: 8px 14px 12px; margin: 14px 0; }
.formulaire legend { font-weight: 700; padding: 0 6px; color: var(--vert); }
.formulaire .choix { font-weight: 400; color: var(--encre); display: flex; gap: 9px; align-items: flex-start; }
.formulaire .choix input { margin-top: 5px; }
.ligne2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .ligne4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
@media (max-width: 700px) { .ligne2, .ligne4 { grid-template-columns: 1fr; } }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.filtres input, .filtres select { width: auto; margin: 0; padding: 7px 10px; }
.ligne-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.ligne-form input, .ligne-form select { width: auto; margin: 0; padding: 5px 8px; font-size: .9rem; }
.ligne-form .large { flex: 1; min-width: 200px; }
form.inline { display: inline; }
.encadre { border: 1px dashed var(--ligne); border-radius: 12px; padding: 4px 16px 10px; margin-top: 14px; }
.zone-ar { font-family: var(--ar), var(--fr) !important; font-size: 1.35rem !important; line-height: 1.8; }

/* Onglets */
.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.onglets a { text-decoration: none; padding: 8px 14px; border-radius: 99px; background: var(--papier); border: 1px solid var(--ligne); color: var(--encre); font-size: .93rem; }
.onglets a.actif { background: var(--c, var(--vert)); border-color: var(--c, var(--vert)); color: #fff; }

/* Accueil */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center; padding: 26px 0 30px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); margin-bottom: .35em; }
.chapo { font-size: 1.15rem; color: #3a4a42; max-width: 36em; }
.hero-ar { text-align: center; background: radial-gradient(circle at 50% 40%, #fff 0, var(--or-2) 70%); border-radius: 30px; padding: 30px 10px; border: 1px solid var(--ligne); }
.hero-ar span { display: block; font-family: var(--ar); font-size: clamp(5rem, 13vw, 9rem); color: var(--vert); line-height: 1.3; }
.hero-ar small { color: var(--or); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } .hero-ar { order: -1; padding: 10px; } }
.parcours-annees { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 10px 0 34px; }
@media (max-width: 900px) { .parcours-annees { grid-template-columns: 1fr 1fr; } }
.annee { position: relative; display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--encre); background: var(--papier); border-radius: var(--r); padding: 18px; border: 1px solid var(--ligne); border-top: 5px solid var(--c); box-shadow: var(--ombre); transition: transform .15s; }
.annee:hover { transform: translateY(-3px); }
.annee-num { position: absolute; top: 10px; right: 14px; font-size: 2.6rem; font-weight: 700; color: var(--c); opacity: .18; }
.annee-ar { font-family: var(--ar); font-size: 1.9rem; color: var(--c); }
.annee small { color: var(--doux); }
.bloc { margin: 0 0 30px; }
.methode { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.methode li { display: flex; gap: 12px; background: var(--papier); border: 1px solid var(--ligne); border-radius: 12px; padding: 14px; }
.methode p { margin: .3em 0 0; font-size: .92rem; color: var(--doux); }
.methode-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--vert); color: #fff; display: grid; place-items: center; font-weight: 700; }
.prix { font-size: 2.2rem; font-weight: 700; color: var(--vert); margin: .2em 0; } .prix small { font-size: .45em; color: var(--doux); font-weight: 400; }

/* Programme / tuiles */
.intro-niveau { border-top: 5px solid var(--c); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.intro-niveau .meta { display: flex; flex-direction: column; gap: 6px; } .intro-niveau .meta span { background: var(--or-2); border-radius: 8px; padding: 4px 10px; font-size: .9rem; }
.grille-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tuile-module { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; background: var(--papier); border: 1px solid var(--ligne); border-radius: 12px; text-decoration: none; color: var(--encre); min-height: 130px; transition: transform .12s, box-shadow .12s; }
a.tuile-module:hover { transform: translateY(-2px); box-shadow: var(--ombre); }
.tm-num { position: absolute; top: 8px; left: 10px; font-size: .8rem; font-weight: 700; color: var(--doux); }
.tm-ar { font-family: var(--ar); font-size: 1.7rem; text-align: right; color: var(--vert); line-height: 1.4; min-height: 1.5em; }
.tm-titre { font-size: .9rem; font-weight: 600; }
.tm-etat { margin-top: auto; font-size: .85rem; }
.tuile-module.etat-verrouille, .tuile-module.etat-verrouille_paiement { opacity: .6; background: #F7F4EE; }
.tuile-module.etat-verrouille .tm-ar, .tuile-module.etat-verrouille_paiement .tm-ar { color: #999; }
.tuile-module.etat-valide { border-color: #BCD8C7; background: linear-gradient(180deg, #fff, #F0F7F2); }
.tuile-module.etat-ouvert { border: 2px solid var(--bleu); }

/* Espace élève */
.niveau-carte { border-left: 6px solid var(--c); }
.nc-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.reprendre { display: flex; align-items: center; gap: 16px; background: var(--vert); color: #fff; text-decoration: none; border-radius: 12px; padding: 12px 18px; margin: 10px 0; }
.reprendre .ar { color: #F3E3B5; } .reprendre small { display: block; opacity: .8; } .reprendre .fleche { margin-left: auto; font-size: 1.6rem; }
.seance { display: flex; gap: 16px; } .seance-date { flex: none; width: 62px; text-align: center; background: var(--or-2); border-radius: 10px; padding: 8px 0; height: fit-content; }
.seance-date b { display: block; font-size: 1.5rem; } .seance-date small { color: var(--doux); }
.travail { background: var(--orange-2); padding: 8px 12px; border-radius: 8px; }
.rendu { background: #fff; border: 1px solid var(--ligne); border-radius: 10px; padding: 12px 14px; white-space: normal; font-size: 1.05rem; }
.rendu.ar, .ar.rendu { font-size: 1.4rem; line-height: 1.9; }
.consigne { background: var(--or-2); border-radius: 10px; padding: 12px 14px; }
.grille-prog { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin: 8px 0 16px; }
.cel { border-radius: 8px; padding: 5px; text-align: center; font-size: .85rem; } .cel b { display: block; } .cel small { display: block; min-height: 1.2em; }
.cel select { width: 100%; font-size: .75rem; padding: 1px; border-radius: 5px; border: 1px solid #ccc; background: rgba(255,255,255,.7); }
.ins-bloc { border-bottom: 1px solid var(--ligne); padding: 6px 0 14px; margin-bottom: 10px; }

/* Module */
.module-tete { display: flex; align-items: center; gap: 20px; background: var(--papier); border: 1px solid var(--ligne); border-left: 6px solid var(--c); border-radius: var(--r); padding: 16px 20px; margin-bottom: 14px; flex-wrap: wrap; }
.module-tete h1 { margin: 0; } .module-tete .retour { font-size: .9rem; text-decoration: none; width: 100%; }
.module-ar { margin-left: auto; font-family: var(--ar); font-size: clamp(2.6rem, 8vw, 4.2rem); color: var(--c); line-height: 1.2; }
.etapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 18px; position: sticky; top: 62px; z-index: 5; background: var(--fond); padding: 6px 0; }
.etapes button { border: 1px solid var(--ligne); background: var(--papier); border-radius: 10px; padding: 9px 6px; cursor: pointer; font: 600 .92rem var(--fr); color: var(--encre); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.etapes button span { width: 24px; height: 24px; border-radius: 50%; background: var(--gris-2); display: grid; place-items: center; font-size: .8rem; }
.etapes button small { font-family: var(--ar); font-weight: 400; color: var(--doux); font-size: .95rem; }
.etapes button.actif { background: var(--vert); color: #fff; border-color: var(--vert); } .etapes button.actif span { background: #fff; color: var(--vert); } .etapes button.actif small { color: #D9EADF; }
@media (max-width: 640px) { .etapes button { font-size: .72rem; padding: 6px 2px; } .etapes button small { display: none; } }
.etape { display: none; } .etape.actif { display: block; animation: apparait .25s ease; }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.suite { text-align: right; }
.module-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.lettre-carte { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.lettre-geante { font-family: var(--ar); font-size: 9rem; line-height: 1.1; color: var(--vert); background: var(--or-2); border-radius: 22px; min-width: 170px; text-align: center; padding: 0 20px 14px; }
.formes { display: flex; gap: 10px; flex-wrap: wrap; direction: rtl; }
.forme { background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: 4px 16px 8px; text-align: center; }
.forme span { display: block; font-family: var(--ar); font-size: 3.2rem; line-height: 1.5; color: var(--encre); }
.forme small { color: var(--doux); direction: ltr; display: block; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.items-phrases { grid-template-columns: 1fr; }
.item { background: var(--papier); border: 1px solid var(--ligne); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; text-align: center; font: inherit; color: inherit; transition: border-color .15s, background .15s; }
.items-phrases .item { text-align: right; } .items-phrases .item small { text-align: left; }
.item:hover { border-color: var(--vert); } .item.joue, .bulle.joue { background: var(--vert-2); border-color: var(--vert); }
.item small { color: var(--doux); font-size: .9rem; }
.cacher-fr .item small, .cacher-fr .bulle small { visibility: hidden; }
.hl { color: #C0392B; }
.dialogue { display: flex; flex-direction: column; gap: 10px; }
.bulle { max-width: 82%; background: #fff; border: 1px solid var(--ligne); border-radius: 16px; padding: 8px 14px; cursor: pointer; display: flex; flex-direction: column; }
.bulle.cote0 { align-self: flex-end; border-bottom-right-radius: 4px; background: #F0F7F2; } .bulle.cote1 { align-self: flex-start; border-bottom-left-radius: 4px; }
.bulle b { font-size: .95rem; color: var(--or); } .bulle .ar { font-size: 1.45rem; line-height: 1.8; } .bulle small { color: var(--doux); }
.conseil { background: var(--bleu-2); border-color: #C6D5EC; }
.texte p { max-width: 70ch; }
.tableau-v21 { border-left: 6px solid var(--or); }

/* Exercices */
.exo-tete { display: flex; justify-content: space-between; align-items: center; color: var(--doux); font-size: .9rem; margin-bottom: 8px; }
.exo { background: #fff; border: 1px solid var(--ligne); border-radius: 14px; padding: 18px; }
.exo-consigne { font-weight: 600; font-size: 1.08rem; margin-top: 0; }
.exo-sujet { font-size: 1.3rem; text-align: center; padding: 12px; background: var(--or-2); border-radius: 12px; margin: 10px 0 16px; }
.exo-sujet.ar { font-size: 2.6rem; line-height: 1.6; cursor: pointer; }
.exo-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.option { border: 2px solid var(--ligne); background: var(--papier); border-radius: 12px; padding: 12px; font: 1.05rem var(--fr); cursor: pointer; color: var(--encre); transition: border-color .12s, background .12s; }
.exo-options.ar .option { font-family: var(--ar); font-size: 1.7rem; line-height: 1.5; padding: 6px 12px; }
.option:hover { border-color: #9BC6AE; } .option.choisi { border-color: var(--bleu); background: var(--bleu-2); }
.option.bonne { border-color: var(--vert); background: #D7EBDF; } .option.fausse { border-color: var(--rouge); background: var(--rouge-2); }
.audio-grand { font-size: 1.2rem; margin: 6px 0 14px; }
.ordre-zone, .ordre-reserve { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 12px; margin: 8px 0; }
.ordre-zone { border: 2px dashed #9BC6AE; background: #F7FBF8; } .ordre-zone.bonne { border-color: var(--vert); background: #D7EBDF; } .ordre-zone.fausse { border-color: var(--rouge); background: var(--rouge-2); }
.ordre-reserve { background: var(--gris-2); }
.etiquette { font-family: var(--ar); font-size: 1.6rem; background: #fff; border: 1px solid #CFC5B3; border-radius: 10px; padding: 0 14px 4px; cursor: pointer; }
.exo-retour { margin: 14px 0 0; padding: 0; border-radius: 10px; } .exo-retour.ok, .exo-retour.ko { padding: 10px 14px; }
.exo-retour.ok { background: var(--vert-2); } .exo-retour.ko { background: var(--rouge-2); }
.exo-retour .ar { font-size: 1.5rem; }
.exo-pied { text-align: right; margin-top: 14px; }
.score { font-size: 2.6rem; font-weight: 700; text-align: center; padding: 14px; border-radius: 14px; margin: 6px 0 10px; }
.score.ok { color: var(--vert); background: var(--vert-2); } .score.ko { color: var(--orange); background: var(--orange-2); }
.correction { margin: 14px 0; } .correction summary { cursor: pointer; font-weight: 600; color: var(--vert); }
.corr { border-left: 4px solid; padding: 6px 12px; margin: 8px 0; background: #fff; border-radius: 0 8px 8px 0; } .corr.ok { border-color: var(--vert); } .corr.ko { border-color: var(--rouge); }
.corr .ar { font-size: 1.3rem; } .corr small { display: block; color: var(--doux); }
.grand-ok { font-size: 4rem; color: var(--vert); }

/* Tableau blanc */
.tb-barre { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tb-barre select, .tb-barre input:not([type=range]) { padding: 6px 8px; border: 1px solid #CFC5B3; border-radius: 8px; font: 1rem var(--fr); max-width: 220px; }
.tb-barre select { font-family: var(--ar), var(--fr); }
.tb-barre button { border: 1px solid var(--ligne); background: #fff; border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: .95rem; }
.tb-barre button.actif { outline: 2px solid var(--vert); } .tb-barre button.barre { text-decoration: line-through; opacity: .6; }
.tb-c { width: 28px; height: 28px; border-radius: 50% !important; padding: 0 !important; }
.tb-cadre { position: relative; border: 1px solid var(--ligne); border-radius: 12px; overflow: hidden; touch-action: none; background: #fffdf7; }
.tb-cadre canvas { position: absolute; inset: 0; } .tb-dessin { cursor: crosshair; }
.tb.plein { position: fixed; inset: 0; z-index: 100; background: var(--fond); padding: 10px; }
body.tb-plein { overflow: hidden; }

/* Impression (reçus, relevés) */
body.impression { background: #eee; }
.feuille { background: #fff; max-width: 820px; margin: 20px auto; padding: 36px 40px; box-shadow: var(--ombre); }
.feuille .droite { text-align: right; }
@media print { body.impression { background: #fff; } .feuille { box-shadow: none; margin: 0; max-width: none; padding: 0; } .non-imprime, .entete, .pied { display: none !important; } }
/* Ajustements */
.lettre-geante { line-height: 1.45; padding: 10px 24px 6px; }
.audio { border: 1px solid var(--ligne); background: var(--vert-2); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 1rem; vertical-align: middle; }
@media (min-width: 961px) { .nav a { padding: 6px 8px; font-size: .9rem; } }
/* Images ezzouhoure.fr / ACML4 */
.logo { align-items: center; }
.logo-acml4 { height: 45px; width: auto; background: #fff; border-radius: 10px; padding: 3px 5px; }
.hero-image { margin: 0; position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--ligne); box-shadow: var(--ombre); }
.hero-image img { display: block; width: 100%; height: auto; }
.hero-image figcaption { position: absolute; right: 14px; bottom: 12px; background: rgba(255,253,248,.92); color: var(--vert); font-family: var(--ar); font-size: 2.2rem; line-height: 1.3; padding: 2px 16px 6px; border-radius: 14px; }
.hero-image figcaption small { font-family: var(--fr); font-size: .8rem; color: var(--or); font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.pied-acml4 { display: inline-flex; align-items: center; gap: 8px; }
.pied-acml4 img { height: 36px; width: auto; }
@media (max-width: 800px) { .hero-image { order: -1; } .logo-acml4 { height: 36px; } .logo-fr { display: none; } }
/* Documents juridiques */
.onglets-legal a { font-size: .88rem; }
.legal { max-width: 900px; }
.legal h2 { font-size: 1.2rem; color: var(--vert); margin-top: 1.6em; }
.legal h3 { font-size: 1.02rem; margin-top: 1.2em; }
.legal p, .legal li { max-width: none; }
.chapo-legal { font-size: 1.05rem; color: #3a4a42; }
.formulaire-legal { border: 1px dashed var(--ligne); border-radius: 10px; padding: 6px 16px; background: #fff; }
.pied-liens a { white-space: nowrap; }
.formulaire .choix.acces { background: var(--or-2); border-radius: 8px; padding: 8px 10px; }
.formulaire .choix { display: block; position: relative; padding-left: 28px; }
.formulaire .choix input { position: absolute; left: 4px; top: 3px; margin: 0; }
.formulaire .choix.acces { padding-left: 36px; } .formulaire .choix.acces input { left: 10px; top: 11px; }

/* v1.4 — offre fondateur, essai, parrainage */
.offre-fondateur { border: 2px solid var(--or); background: var(--or-2); }
.offre-fondateur h2 s, .prix s { color: var(--doux); font-weight: 400; font-size: .7em; }
.essai-niveaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.parrainage { border-left: 4px solid var(--or); }
.code-parrain { font-size: 1.3em; letter-spacing: .08em; background: var(--or-2); padding: 2px 10px; border-radius: 8px; }
.lien-parrain { width: min(100%, 460px); padding: 7px 9px; border: 1px solid var(--ligne); border-radius: 8px; font: inherit; font-size: .9em; }

/* v1.4 — messagerie */
.messagerie { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.msg-liste { padding: 12px; max-height: 75vh; overflow-y: auto; }
.msg-nouveau label { display: block; font-size: .9em; color: var(--doux); }
.msg-nouveau select { width: 100%; margin: 4px 0 12px; padding: 8px; border: 1px solid var(--ligne); border-radius: 8px; font: inherit; background: #fff; }
.msg-conv { display: block; padding: 9px 10px; border-radius: 10px; color: var(--encre); text-decoration: none; border-bottom: 1px solid var(--ligne); }
.msg-conv:hover, .msg-conv.actif { background: var(--vert-2); }
.msg-conv small { color: var(--doux); }
.msg-extrait { display: block; color: var(--doux); font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-sup-titre { margin-top: 18px; font-size: 1rem; }
.msg-fil { min-height: 50vh; display: flex; flex-direction: column; }
.bulles { display: flex; flex-direction: column; gap: 8px; flex: 1; max-height: 58vh; overflow-y: auto; padding: 4px 2px 10px; }
.bulle-msg { max-width: 78%; background: var(--gris-2); padding: 9px 13px; border-radius: 14px 14px 14px 4px; align-self: flex-start; overflow-wrap: anywhere; }
.bulle-msg.moi { background: var(--vert-2); align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.bulle-msg b { display: block; font-size: .85em; color: var(--vert); }
.bulle-msg small { display: block; color: var(--doux); font-size: .78em; margin-top: 3px; }
.msg-envoi { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--ligne); padding-top: 10px; }
.msg-envoi textarea { flex: 1; padding: 9px; border: 1px solid var(--ligne); border-radius: 10px; font: inherit; resize: vertical; min-width: 0; }
.retour-liste { display: none; }
@media (max-width: 760px) {
  .messagerie { grid-template-columns: 1fr; }
  .messagerie.fil-ouvert .msg-liste { display: none; }
  .retour-liste { display: inline; }
  .bulle-msg { max-width: 90%; }
  .msg-envoi { flex-direction: column; align-items: stretch; }
}
/* v1.5 — comptes et présences */
.tableau td.actions { white-space: nowrap; }
.tableau td.actions form.inline { margin-left: 6px; }
.tableau tr.inactif td { opacity: .6; }

/* ---------- v1.6 : vidéos interactives ---------- */
.onglets a { display: inline-block; padding: 6px 14px; margin: 0 4px 6px 0; border-radius: 99px; background: var(--gris-2); color: var(--encre); text-decoration: none; font-weight: 600; font-size: .95rem; }
.onglets a.actif { background: var(--vert); color: #fff; }
.grille-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.carte-video { display: flex; flex-direction: column; gap: 4px; background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--ombre); color: var(--encre); text-decoration: none; transition: transform .1s, border-color .15s; }
a.carte-video:hover { transform: translateY(-2px); border-color: var(--or); }
.carte-video.verrou { opacity: .6; } .carte-video.finie { border-left: 5px solid var(--vert); }
.cv-code { font-size: .8rem; font-weight: 700; color: var(--or); } .cv-ar { font-size: 1.5rem; line-height: 1.6; }
.carte-video small { color: var(--doux); } .cv-score { color: var(--vert) !important; font-weight: 600; }
.vlect { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(250px, 1fr); grid-template-areas: "zone cote" "barre cote"; gap: 10px 16px; margin: 0 0 18px; }
.vlect.compact { grid-template-columns: 1fr; grid-template-areas: "zone" "barre" "cote"; }
.vlect-zone { grid-area: zone; position: relative; background: #000; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; }
.vlect-zone video { width: 100%; height: 100%; display: block; }
.vlect-barre { grid-area: barre; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: .95rem; }
.vlect-score { font-weight: 700; color: var(--vert); margin-right: auto; }
.vlect-cote { grid-area: cote; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.vlect-chap { display: flex; flex-wrap: wrap; gap: 6px; }
.vlect-chap button { border: 1px solid var(--ligne); background: var(--papier); border-radius: 99px; padding: 4px 10px; font: .85rem var(--fr); cursor: pointer; color: var(--encre); }
.vlect-chap button.actif { background: var(--vert); color: #fff; border-color: var(--vert); }
.vlect-texte { background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--r); padding: 6px; overflow-y: auto; max-height: 430px; }
.vlect.compact .vlect-texte { max-height: 260px; }
.vlect-texte p { margin: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.vlect-texte p:hover { background: var(--gris-2); } .vlect-texte p.actif { background: var(--or-2); }
.vlect-texte .ar { display: block; font-size: 1.35rem; line-height: 1.7; }
.vlect-texte small { color: var(--doux); } .vlect.sans-fr .vlect-texte small, .vlect.sans-fr .vq-fr { display: none; }
.vlect-q { position: absolute; inset: 0; background: rgba(15, 30, 22, .88); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; overflow-y: auto; }
.vlect-q[hidden] { display: none; }
.vq-ar { font-family: var(--ar); font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1.5; direction: rtl; }
.vq-fr { font-size: clamp(.95rem, 2vw, 1.15rem); opacity: .9; }
.vq-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: min(100%, 640px); }
.vq-choix button { background: #fff; color: var(--encre); border: 3px solid transparent; border-radius: 12px; padding: 10px 12px; font: 600 1.05rem var(--fr); cursor: pointer; min-height: 52px; }
.vq-choix button.ar-c { font: 1.6rem/1.4 var(--ar); }
.vq-choix button.bonne { border-color: #3FB97A; background: #E6F7EE; } .vq-choix button.fausse { border-color: #E5534B; background: #FDECEB; }
.vq-choix button.indice { outline: 3px dashed #F3C969; }
.vq-msg { font-weight: 700; font-size: 1.15rem; min-height: 1.4em; }
.vlect-q .bouton { background: var(--or); }
.vlect:fullscreen { background: var(--fond); padding: 12px; grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
.vlect:fullscreen .vlect-zone { aspect-ratio: auto; height: calc(100vh - 80px); }
.vlect:fullscreen .vlect-texte { max-height: calc(100vh - 160px); }
.depot { border: 3px dashed var(--ligne); border-radius: var(--r); padding: 26px; text-align: center; background: var(--fond); }
.depot.survol { border-color: var(--vert); background: var(--vert-2); }
.depot input[type=file] { display: none; }
#journal-envoi p { margin: 4px 0; font-size: .92rem; } #journal-envoi .ok { color: var(--vert); } #journal-envoi .ko { color: var(--rouge); }
.defile { overflow-x: auto; } .suivi-videos td, .suivi-videos th { white-space: nowrap; }
button.lien { background: none; border: 0; color: var(--rouge); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }
@media (max-width: 860px) { .vlect { grid-template-columns: 1fr; grid-template-areas: "zone" "barre" "cote"; } .vlect-texte { max-height: 300px; } }

/* v1.7 : modules de français (texte étudié en français, aide en arabe) */
.fr-cible { font-family: var(--fr); direction: ltr; unicode-bidi: isolate; color: var(--encre, #1b2a22); }
.fr-cible.grand { font-size: 1.35em; font-weight: 600; } .fr-cible.tres-grand { font-size: 1.7em; font-weight: 600; line-height: 1.35; }
.item .fr-cible { display: block; } .item small[lang="ar"] { font-family: var(--ar); font-size: 1.05rem; direction: rtl; }
.items-phrases .item .fr-cible { text-align: left; } .items-phrases .item small[lang="ar"] { text-align: right; }
.bulle .fr-cible { font-size: 1.2rem; line-height: 1.5; } .bulle small[lang="ar"] { font-family: var(--ar); font-size: 1.05rem; text-align: right; }
.exo-sujet.fr-cible { font-size: 1.7rem; font-weight: 600; cursor: pointer; } .exo-sujet.ar { direction: rtl; }
.exo-options.fr-cible .option { font-size: 1.25rem; } .exo-options.ar:not(.fr-cible) .option[lang="ar"] { font-family: var(--ar); font-size: 1.4rem; }
.ordre-zone.fr-cible .etiquette, .ordre-reserve.fr-cible .etiquette { font-family: var(--fr); font-size: 1.15rem; }
.zone-fr { font-size: 1.15rem !important; line-height: 1.7; } .fr-rendu { font-size: 1.15rem; line-height: 1.7; white-space: normal; }
.groupe-langue { margin: 18px 0 6px; font-size: 1.05rem; color: var(--doux); text-transform: uppercase; letter-spacing: .06em; }

.tm-fr { margin-top: 1.1rem; font-size: 1.15rem; font-weight: 700; color: var(--vert); line-height: 1.3; }
.tm-ar-petit { font-family: var(--ar); font-size: 1.05rem; text-align: right; color: #555; }

/* v1.8 : vidéos de français (texte français, traduction arabe) */
.vlect.langue-fr .vlect-texte .fr-cible { display: block; font-size: 1.12rem; line-height: 1.5; direction: ltr; text-align: left; }
.vlect.langue-fr .vlect-texte small.trad-ar { display: block; font-family: var(--ar); font-size: 1.1rem; direction: rtl; text-align: right; }
.vlect.langue-fr.sans-fr .vq-fr { display: block; } .vlect.langue-fr.sans-fr .vq-trad { display: none; }
.vlect.langue-fr .vq-principal { font-size: 1.3rem; font-weight: 700; } .vlect.langue-fr .vq-invite { font-size: 1.8rem; }
