/* ============================================================
   INTÉGRATION FRANCE — compléments au système de design Learneo
   Tout passe par les variables des thèmes (style.css).
   ============================================================ */

.brand-tricolore { display: inline-flex; width: 26px; height: 18px; border-radius: 3px; overflow: hidden; margin-right: .5rem; vertical-align: middle; }
.brand-tricolore span { flex: 1; }
.brand-tricolore span:nth-child(1) { background: #1f4fb8; }
.brand-tricolore span:nth-child(2) { background: #f4f4f4; }
.brand-tricolore span:nth-child(3) { background: #d7263d; }

.header-nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.nav-lien { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.nav-lien:hover { color: var(--ink); }
@media (max-width: 900px) { .header-nav { display: none; } }

.titre-page { font-size: 1.8rem; margin-bottom: .4rem; }
.sous-titre-page { color: var(--text-muted); margin-bottom: 1.6rem; max-width: 820px; }
.meta { color: var(--text-muted); font-size: .88rem; }
.pied-note { font-size: .8rem; opacity: .8; }
.texte-accent { color: var(--accent-text); }

/* ---------- Accueil ---------- */
.hero-simple { padding: 5.5rem 0 3.5rem; text-align: center; }
.hero-surtitre { color: var(--accent-text); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .82rem; }
.hero-titre { font-family: var(--font-display); font-size: clamp(1.9rem, 5vw, 3.2rem); line-height: 1.15; margin: .8rem 0 1.2rem; color: var(--ink); }
.hero-texte { max-width: 720px; margin: 0 auto 2rem; color: var(--ink-soft); font-size: 1.08rem; }
.hero-actions { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.4rem; align-items: start; }
.carte-epreuve h3 { margin-top: 0; }
.liste-chiffres { list-style: none; padding: 0; }
.liste-chiffres li { padding: .35rem 0; border-bottom: 1px solid var(--paper-line); }
.liste-chiffres strong { font-family: var(--font-display); color: var(--accent-text); }

.tableau-simple { width: 100%; border-collapse: collapse; margin: .6rem 0; }
.tableau-simple th, .tableau-simple td { padding: .55rem .7rem; border-bottom: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
.tableau-simple th { color: var(--text-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 600px) { .tableau-simple { font-size: .85rem; } .tableau-simple th, .tableau-simple td { padding: .45rem .35rem; } }

.encadre-info { display: flex; gap: .6rem; padding: .8rem 1rem; border-radius: var(--radius-s); background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--info-text); font-size: .92rem; }

.badge-niveau { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-weight: 700; font-size: .8rem; background: var(--royal); color: #fff; }
.badge-reussi, .badge-echec { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; margin-left: .3rem; }
.badge-reussi { background: var(--teal-dark); color: #fff; }
.badge-echec { background: var(--crimson-fill); color: var(--on-crimson); }
.statut-actif { background: var(--teal-dark) !important; color: #fff !important; }
.statut-inactif { background: var(--glass-bg-strong) !important; color: var(--ink) !important; }
.statut-email_valide { background: var(--gold) !important; color: #222 !important; }
.statut-suspendu { background: var(--crimson-fill) !important; color: #fff !important; }

.alerte { padding: .8rem 1rem; border-radius: var(--radius-s); margin-bottom: 1rem; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.alerte-succes { color: var(--success-text); }
.alerte-erreur { color: var(--danger-text); }

/* ---------- Espace apprenant ---------- */
.liste-exigences { list-style: none; padding: 0; }
.liste-exigences li { padding: .3rem 0; }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.carte-action { display: block; padding: 1.3rem; border-radius: var(--radius-m); background: var(--glass-bg-card); border: 1px solid var(--glass-border); color: var(--ink); text-decoration: none; transition: transform .2s, border-color .2s; }
a.carte-action:hover { transform: translateY(-3px); border-color: var(--glass-border-strong); }
.carte-action > i { font-size: 1.7rem; color: var(--accent-text); }
.carte-action h3 { margin: .5rem 0 .3rem; font-size: 1.05rem; }
.carte-action p { color: var(--text-muted); font-size: .9rem; margin: .2rem 0 .6rem; }

.titre-theme { margin: 1.2rem 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.numero-chapitre { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--glass-bg-strong); font-weight: 700; font-size: .85rem; margin-right: .4rem; }
.actions-chapitre { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.actions-bas { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; margin: 2rem 0; }
.actions-bas form { margin: 0; }

/* ---------- Exercices ---------- */
.lecteur-audio { margin: 0 0 1.2rem; padding: 1rem; border-radius: var(--radius-m); background: var(--glass-bg); border: 1px dashed var(--glass-border-strong); }
.lecteur-cours { margin-bottom: 1.2rem; }
.lecteur-titre { margin: 0 0 .6rem; font-weight: 700; }
.lecteur-boutons { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.lecteur-info, .lecteur-etat { margin: .5rem 0 0; font-size: .85rem; color: var(--text-muted); }
.btn-tts:disabled { opacity: .45; cursor: not-allowed; }

.document-support { white-space: pre-line; padding: 1.1rem 1.2rem; margin: 0 0 1.2rem; border-radius: var(--radius-s); background: var(--glass-bg-strong); border-left: 4px solid var(--royal); line-height: 1.6; font-size: .97rem; color: var(--ink); }

.badge-categorie { display: inline-block; margin-bottom: .6rem; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.badge-categorie.connaissance { background: var(--glass-bg-strong); color: var(--info-text); }
.badge-categorie.mise_en_situation { background: var(--gold); color: #222; }
.choix-lettre { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--glass-border-strong); font-size: .78rem; font-weight: 700; flex-shrink: 0; }

.compteur-mots { text-align: right; font-size: .85rem; color: var(--text-muted); margin: .3rem 0 0; }
.compteur-mots.hors-bornes { color: var(--warning-text); }
.enregistreur audio { width: 100%; margin: .8rem 0; }
.chrono-oral { font-size: 1.1rem; }
.btn-enregistrer.en-cours { background: var(--crimson-fill); color: #fff; animation: pulse-rec 1.2s infinite; }
@keyframes pulse-rec { 50% { opacity: .7; } }
.confirmation-oral { margin-top: .6rem; }

.production-bloc { margin: 1rem 0; }
.production-bloc.modele .production-texte { border-left-color: var(--teal); }
.production-titre { font-weight: 700; margin: 0 0 .4rem; }
.production-texte { white-space: pre-line; padding: .9rem 1rem; border-radius: var(--radius-s); background: var(--glass-bg); border-left: 4px solid var(--glass-border-strong); line-height: 1.55; }
.note-auto { font-size: 1.05rem; }
.transcription { margin: 1rem 0; }
.transcription summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
.grille-autoeval { margin: 1.2rem 0; }

/* ---------- Examens blancs ---------- */
.barre-examen { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.1rem; margin-bottom: 1rem; border-radius: var(--radius-m); background: var(--glass-bg-card); border: 1px solid var(--glass-border); position: sticky; top: .5rem; z-index: 20; backdrop-filter: blur(var(--glass-blur)); }
.chrono-examen { font-size: 1.4rem; font-weight: 700; }
.chrono-examen.urgent { color: var(--danger-text); animation: pulse-rec 1s infinite; }
.remettre-copie { text-align: center; margin-top: 1.5rem; }
.carte-examen-entete { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.carte-examen-entete h2 { margin-top: 0; }
.verdict { font-weight: 700; font-size: 1.1rem; }
.verdict-ok { color: var(--success-text); }
.verdict-ko { color: var(--danger-text); }
.bloc-autoeval { border-top: 1px solid var(--paper-line); padding-top: 1rem; margin-top: 1rem; }
.correction-question { border-bottom: 1px solid var(--paper-line); padding: .6rem 0; }
.correction-question summary { cursor: pointer; display: flex; gap: .5rem; align-items: baseline; }
.detail-ligne { display: flex; gap: .7rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--paper-line); }
.detail-ligne a { color: var(--ink); text-decoration: none; }
.ok { color: var(--success-text); font-weight: 700; }
.ko { color: var(--danger-text); font-weight: 700; }

/* ============================================================
   LANGUE : selecteur et lecture de droite a gauche (arabe)
   ============================================================ */

.lang-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

/* L'arabe se lit de droite a gauche : l'attribut dir sur <html> retourne le
   texte et les listes, ces regles retournent ce que la mise en page fige. */
[dir="rtl"] .header-nav,
[dir="rtl"] .header-actions,
[dir="rtl"] .header-left {
    flex-direction: row-reverse;
}

[dir="rtl"] .user-menu-dropdown {
    left: 0;
    right: auto;
}

[dir="rtl"] .panneau,
[dir="rtl"] .formulaire,
[dir="rtl"] .titre-page {
    text-align: right;
}

[dir="rtl"] .theme-card,
[dir="rtl"] .lang-picker {
    text-align: center;
}

/* Les contenus pedagogiques restent en francais : ils se lisent toujours de
   gauche a droite, meme quand l'interface est en arabe. */
[dir="rtl"] .cours-contenu,
[dir="rtl"] .question-enonce,
[dir="rtl"] .mono {
    direction: ltr;
    text-align: left;
}
