/*
 * main.css - Styles communs Edulutic
 * Base commune réutilisable par toutes les apps sœurs
 * (Narralis, Nedvriend, Mathégo, Archiméos, Clios, Numégo).
 *
 * Contenu : reset, tokens de design NEUTRES (surchargeables par le thème
 * de chaque app), typographie et composants structurels génériques
 * (bandeau élève, barre de progression, boutons, sections, pied de page).
 *
 * Règle de réutilisabilité : ce fichier ne contient AUCUNE couleur de marque
 * en dur - tout passe par des custom properties. Chaque app fournit son
 * thème (ex. narralis.css) qui redéfinit les valeurs des tokens.
 *
 * Narralis - Edulutic SRL
 */

/* ===== Tokens de design (valeurs neutres par défaut) ===== */
:root {
    /* Typographie */
    --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --sans:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Mesures */
    --rayon: 14px;
    --max:   1120px;

    /* Couleurs sémantiques - surchargées par le thème de l'app */
    --fond:           #101822;   /* fond général               */
    --surface:        #172231;   /* surfaces / cartes          */
    --surface-2:      #1c2b4a;   /* surfaces mises en avant    */
    --voile:          rgba(9, 15, 28, 0.6);   /* bandeaux flous */
    --texte:          #e9e3d3;   /* texte principal            */
    --texte-doux:     #a9b2c4;   /* texte secondaire           */
    --accent:         #c9a227;   /* couleur d'accent de marque */
    --accent-clair:   #e6c65c;   /* variante claire de l'accent*/
    --sur-accent:     #1a1400;   /* texte posé sur l'accent    */
    --bordure:        rgba(255, 255, 255, 0.08);  /* filets discrets      */
    --bordure-accent: rgba(201, 162, 39, 0.25);   /* filets teintés accent*/
    --halo-accent:    rgba(201, 162, 39, 0.5);     /* lueurs / ombres accent*/
    --ombre:          rgba(0, 0, 0, 0.45);
}

/* ===== Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--sans);
    color: var(--texte);
    background: linear-gradient(180deg, var(--surface) 0%, var(--fond) 100%);
    min-height: 100vh;
    line-height: 1.55;
}

.conteneur { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }

/* Évite les orphelins typographiques : jamais une ponctuation (ou un mot) seul
   en dernière ligne dans les blocs de texte / bulles / cadres. */
p, .bulle, .ned-bulle, .doc, .fb, .enonce, .consigne, .memo li, .ned-mini + .ned-bulle {
    text-wrap: pretty;
}

a { color: inherit; }

/* ===== Bandeau élève (en-tête générique) ===== */
.entete {
    border-bottom: 1px solid var(--bordure-accent);
    background: var(--voile);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 10;
}
.entete__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    flex-wrap: wrap;
}

.marque {
    font-family: var(--serif);
    font-size: 2.7rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    text-shadow: 0 0 18px var(--halo-accent);
}
.marque span { color: var(--accent-clair); }

.profil { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.profil__avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(160deg, var(--accent-clair), var(--accent));
    display: grid; place-items: center;
    color: var(--sur-accent); font-weight: 700; font-family: var(--serif);
}
.profil__nom  { font-size: 0.95rem; }
.profil__role { font-size: 0.78rem; color: var(--texte-doux); }

/* ===== Barre de progression (XP) ===== */
.xp { width: 100%; padding: 0 20px 14px; }
.xp__ligne { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--texte-doux); margin-bottom: 6px; }
.xp__barre {
    height: 10px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    border: 1px solid var(--bordure-accent);
}
.xp__remplissage {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-clair));
    box-shadow: 0 0 12px var(--halo-accent);
    border-radius: 999px;
    transition: width 0.6s ease;
}

/* ===== Titres de section ===== */
.section { padding: 34px 0; }
.section__titre {
    font-size: 1.7rem;
    color: var(--accent-clair);
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 12px;
}
.section__titre::before,
.section__titre::after {
    content: ""; height: 1px; flex: 1;
    background: linear-gradient(90deg, transparent, var(--bordure-accent), transparent);
}
.section__soustitre { text-align: center; color: var(--texte-doux); margin-bottom: 26px; font-size: 0.95rem; }

/* ===== Bouton principal ===== */
.bouton {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--serif); font-size: 1rem;
    padding: 12px 24px; border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-clair));
    color: var(--sur-accent); font-weight: 700;
    text-decoration: none; border: none; cursor: pointer;
    box-shadow: 0 8px 22px var(--halo-accent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bouton:hover { transform: translateY(-3px); box-shadow: 0 12px 28px var(--halo-accent); }

/* ===== Pied de page ===== */
.pied {
    border-top: 1px solid var(--bordure-accent);
    margin-top: 30px;
    padding: 22px 0 34px;
    text-align: center;
    color: var(--texte-doux);
    font-size: 0.85rem;
}
.pied__liens { margin-top: 8px; display: inline-flex; gap: 16px; }
.pied__liens a { color: var(--texte-doux); text-decoration: none; }
.pied__liens a:hover { color: var(--accent-clair); text-decoration: underline; }

/* ===== Responsive (composants génériques) ===== */
@media (max-width: 560px) {
    .marque { font-size: 2rem; }
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
