@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;1,8..60,300&display=swap");

/* ════════════════════════════════════════════════════════════════
   SuperMarc — base.css
   Tokens + reset + composants génériques
   ════════════════════════════════════════════════════════════════ */

/* ── 1. TOKENS ── */
:root {
    --serif: 'Playfair Display', Georgia, serif;
    --body:  'Source Serif 4', Georgia, serif;
    --mono:  'Courier New', monospace;

    /* Échelle */
    --xs:   0.70rem;
    --sm:   0.84rem;
    --base: 0.95rem;
    --md:   1.05rem;
    --lg:   1.30rem;
    --xl:   1.70rem;
    --2xl:  2.00rem;
    --3xl:  2.80rem;

    /* Espacements */
    --s1: 0.25rem;  --s2: 0.50rem;  --s3: 0.75rem;
    --s4: 1.00rem;  --s5: 1.25rem;  --s6: 1.50rem;
    --s8: 2.00rem;  --s12: 3.00rem; --s16: 4.00rem;

    /* Forme */
    --r:  3px;
    --rl: 8px;
    --rf: 50%;

    /* Ombres */
    --sh-sm: 0 1px  3px rgba(0,0,0,0.08);
    --sh-md: 0 2px 12px rgba(0,0,0,0.08);
    --sh-lg: 0 8px 24px rgba(0,0,0,0.12);
    --sh-xl: 0 20px 50px rgba(0,0,0,0.20);

    /* Transitions */
    --t: 0.15s ease;
    --tf: 0.10s ease;

    /* Largeurs */
    --max:      980px;
    --max-text: 640px;
    --max-form: 460px;

    /* Palette Roland — Jour */
    --bg:      #f7f3ee;
    --surface: #ffffff;
    --border:  #d9cfc3;
    --text:    #2a2318;
    --muted:   #7a6e62;
    --accent:  #8b2e0f;
    --accent2: #c45a1a;
    --hl:      #fdf0e0;
    --vert:    #3d6b4a;
    --vert-bg: #eef4f0;
    --vert-bd: #b8d4c2;

    /* Notes bibliothèque */
    --note-a: #3d6b4a; --note-b: #7c8b3a;
    --note-c: #b9821a; --note-d: #c45a1a; --note-e: #8b2e0f;

    /* Heatmap */
    --niv0: #ede8e1; --niv1: #f5c4a8;
    --niv2: #d97a4a; --niv3: #8b2e0f;

    /* Entête */
    --header-bg: #2a2318;
    --header-bd: #8b2e0f;
}

/* ── Palette nuit ── */
[data-theme="nuit"] {
    --bg:      #1c1812;
    --surface: #262019;
    --border:  #3d3526;
    --text:    #ece4d6;
    --muted:   #a89a82;
    --accent:  #d2693a;
    --accent2: #e08a4f;
    --hl:      #3a2c1a;
    --vert:    #4a8a60;
    --vert-bg: #1a2e22;
    --vert-bd: #2a4a34;
    --note-a:  #4a8a60; --note-b: #8a9a40;
    --note-c:  #c8921a; --note-d: #d06a2a; --note-e: #c04030;
    --niv0: #3d3020; --niv1: #5a3520;
    --niv2: #c45a1a; --niv3: #e07a3a;
    --header-bg: #100d09;
    --header-bd: #d2693a;
}

/* ── 2. RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── 3. BASE ── */
body {
    background: var(--bg); color: var(--text);
    font-family: var(--body); font-size: 16px;
    line-height: 1.7; letter-spacing: 0.01em; min-height: 100vh;
}
a { color: var(--accent2); }
a:hover { text-decoration: none; }
strong { font-weight: 600; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }
h1 { font-size: var(--2xl); margin-bottom: var(--s3); }
h2 { font-size: var(--xl);  margin-bottom: var(--s3); }
h3 { font-size: var(--lg);  margin-bottom: var(--s4); }
p  { margin-bottom: var(--s4); }
p:last-child { margin-bottom: 0; }

/* ── 4. LAYOUT ── */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--s8); }
main  { max-width: var(--max); margin-inline: auto; padding: 2rem var(--s8) var(--s16); }
@media (max-width: 480px) {
    .wrap, main { padding-inline: var(--s4); }
}

/* ── 5. ENTÊTE ── */
.entete {
    background: var(--header-bg);
    border-bottom: 4px solid var(--header-bd);
    position: sticky; top: 0; z-index: 100;
}
.entete-int {
    max-width: var(--max); margin-inline: auto;
    padding: 0 var(--s8); height: 56px;
    display: flex; align-items: center; gap: var(--s4);
}
.logo {
    display: flex; align-items: center; gap: var(--s3);
    text-decoration: none; flex-shrink: 0;
    font-family: var(--serif); font-size: var(--xl);
    font-weight: 700; color: #f7f3ee;
}
.logo:hover { color: #f7f3ee; text-decoration: none; }
.logo img { width: 32px; height: 32px; border-radius: var(--rf); object-fit: cover; }
.logo:hover .logo img { animation: spin-bounce 0.7s cubic-bezier(0.34,1.56,0.64,1) forwards; }
@keyframes spin-bounce {
    0%  { transform: rotate(0deg) scale(1); }
    15% { transform: rotate(-15deg) scale(1.3); }
    30% { transform: rotate(20deg) scale(1.25); }
    60% { transform: rotate(8deg) scale(1.1); }
    100%{ transform: rotate(0deg) scale(1); }
}
.entete-droite { margin-left: auto; display: flex; align-items: center; gap: var(--s2); position: relative; }
.btn-theme {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; padding: var(--s1); color: #c9bfae; line-height: 1;
}
.btn-user {
    display: flex; align-items: center; gap: var(--s2);
    background: none; border: 1px solid #4a3f2e; border-radius: 20px;
    padding: 0.2rem var(--s3) 0.2rem var(--s1);
    color: #f7f3ee; font-size: var(--sm); cursor: pointer;
    font-family: var(--body); transition: border-color var(--t);
}
.btn-user:hover { border-color: #c9bfae; }
.initiale {
    width: 26px; height: 26px; border-radius: var(--rf);
    background: var(--accent); color: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-weight: 700; font-size: 0.85rem;
}
.dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); box-shadow: var(--sh-lg);
    min-width: 180px; z-index: 200;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all var(--t);
}
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
    display: block; padding: 0.5rem var(--s4);
    font-size: var(--sm); color: var(--text); text-decoration: none;
    transition: background var(--tf);
}
.dropdown a:hover { background: var(--hl); }
.dropdown-sep { height: 1px; background: var(--border); margin: var(--s1) 0; }
.dropdown-danger { color: var(--accent) !important; }

/* Boutons connexion visiteur */
.btn-cnx {
    color: #c9bfae; text-decoration: none; font-size: var(--sm);
    padding: 0.3rem var(--s3); border: 1px solid #4a3f2e;
    border-radius: var(--r); transition: all var(--t);
}
.btn-cnx:hover { border-color: #c9bfae; color: #fff; }
.btn-inscr {
    color: #fff; text-decoration: none; font-size: var(--sm);
    padding: 0.3rem var(--s3); background: var(--accent2);
    border-radius: var(--r); transition: background var(--t);
}
.btn-inscr:hover { background: var(--accent); color: #fff; }

/* ── 6. COMPOSANTS ── */

/* Carte */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); padding: var(--s5) var(--s6);
    margin-bottom: var(--s4);
}
.card-accent { border-left: 3px solid var(--accent2); }
.card-vert   { border-left: 3px solid var(--vert); }
.card-warn   { border-left: 3px solid var(--accent); }

/* Eyebrow */
.eyebrow {
    font-size: var(--xs); text-transform: uppercase;
    letter-spacing: 0.10em; font-weight: 700;
    color: var(--muted); display: block; margin-bottom: var(--s2);
}
.eyebrow-accent { color: var(--accent2); }
.eyebrow-vert   { color: var(--vert); }

/* Lien retour */
.retour {
    display: inline-flex; align-items: center; gap: var(--s1);
    font-size: var(--sm); color: var(--muted);
    text-decoration: none; margin-bottom: var(--s6);
}
.retour:hover { color: var(--accent); }

/* Score */
.score-ok    { color: var(--vert);    font-weight: 600; }
.score-moyen { color: var(--accent2); font-weight: 600; }
.score-echec { color: var(--accent);  font-weight: 600; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; gap: var(--s2);
    font-family: var(--body); font-size: var(--sm); font-weight: 600;
    padding: 0.55rem var(--s4); border-radius: var(--r);
    border: 1px solid transparent; cursor: pointer;
    text-decoration: none; white-space: nowrap; transition: all var(--t);
}
.btn-primary   { background: var(--accent);  color: #fff; border-color: var(--accent); }
.btn-primary:hover   { background: #6e2309; color: #fff; }
.btn-secondary { background: none; color: var(--muted); border-color: var(--border); }
.btn-secondary:hover { background: var(--hl); color: var(--accent); border-color: var(--accent); }
.btn-outline   { background: none; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover   { background: var(--accent); color: #fff; }
.btn:disabled  { opacity: 0.6; cursor: not-allowed; }

/* Badge */
.badge {
    display: inline-block; font-size: var(--xs); font-weight: 600;
    padding: 0.1rem 0.5rem; border-radius: var(--r); border: 1px solid;
}
.badge-ok      { background: var(--vert-bg);  color: var(--vert);   border-color: var(--vert-bd); }
.badge-pending { background: #fdf3ea;          color: var(--accent2); border-color: #f0c9a0; }
.badge-off     { background: var(--bg);        color: var(--muted);   border-color: var(--border); }

/* Flash */
.flash {
    padding: 0.7rem var(--s4); border-radius: var(--r);
    border-left: 3px solid; margin-bottom: var(--s4);
    font-size: var(--sm); font-weight: 500;
}
.flash-ok    { background: var(--vert-bg); color: var(--vert);   border-color: var(--vert); }
.flash-error { background: #f7e6df;        color: var(--accent);  border-color: var(--accent); }

/* Champ formulaire */
.field { margin-bottom: var(--s4); }
.field label {
    display: block; font-weight: 600; font-size: var(--sm);
    margin-bottom: var(--s2); color: var(--text);
}
.field input,
.field select,
.field textarea {
    width: 100%; padding: 0.6rem 0.85rem;
    border: 1px solid var(--border); border-radius: var(--r);
    background: var(--bg); color: var(--text);
    font-family: var(--body); font-size: 0.92rem;
    transition: border-color var(--t);
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--accent2); }
.field-error input,
.field-error select { border-color: var(--accent); }
.field-msg { font-size: 0.8rem; margin-top: var(--s1); color: var(--muted); }
.field-msg-error { color: var(--accent); display: none; }
.field-error .field-msg-error { display: block; }
.optional { font-weight: 400; color: var(--muted); font-size: var(--xs); }

/* Ligne de liste */
.row {
    display: flex; align-items: center; gap: var(--s3);
    padding: 0.6rem var(--s4); background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 2px;
    font-size: var(--sm); text-decoration: none; color: inherit;
    transition: background var(--tf);
}
.row:hover { background: var(--hl); }
.row-ok     { border-left: 3px solid var(--vert);   background: var(--vert-bg); }
.row-due    { border-left: 3px solid var(--accent2); background: var(--hl); cursor: pointer; }
.row-locked { opacity: 0.6; cursor: default; }

/* Barre de progression */
.progress { height: 6px; background: var(--border); border-radius: var(--rl); overflow: hidden; }
.progress-fill {
    height: 100%; border-radius: var(--rl);
    background: linear-gradient(90deg, var(--vert), #5a9e70);
    transition: width 0.6s ease;
}
.progress-fill-accent { background: var(--accent2); }

/* Avatar */
.avatar {
    --av: 48px;
    width: var(--av); height: var(--av); border-radius: var(--rf);
    background: var(--accent); color: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-weight: 700;
    font-size: calc(var(--av) * 0.4);
}

/* Stat (chiffre + label) */
.stat { text-align: center; }
.stat-nb    { font-family: var(--serif); font-size: var(--2xl); font-weight: 700; color: var(--accent2); display: block; line-height: 1.1; }
.stat-label { font-size: var(--xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Modal */
.overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(20,16,9,0.5); z-index: 200;
    align-items: center; justify-content: center; padding: var(--s4);
}
.overlay.open { display: flex; }
.modal {
    background: var(--surface); border-radius: var(--r);
    padding: 1.6rem; width: 100%; max-width: var(--max-form);
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--sh-xl); border: 1px solid var(--border);
}
.modal h2 { font-family: var(--serif); font-size: var(--lg); margin-bottom: var(--s4); }

/* Choix QCM */
.choix {
    padding: 0.3rem 0.7rem; border-radius: var(--r);
    margin-bottom: 0.15rem; font-size: var(--sm);
}
.choix-bonne {
    background: var(--vert-bg); border: 1px solid var(--vert-bd);
    color: var(--vert); font-weight: 600;
}
.choix-autre { color: var(--muted); }

/* Remarque pédagogique */
.remarque {
    margin-top: var(--s4); padding-top: var(--s4);
    border-top: 1px solid var(--border);
    font-size: var(--sm); color: var(--muted); font-style: italic;
}

/* État vide */
.empty { text-align: center; padding: var(--s12) var(--s4); color: var(--muted); }
.empty-icon  { font-size: 2.3rem; margin-bottom: 0.9rem; opacity: 0.5; display: block; }
.empty-title { font-family: var(--serif); color: var(--text); margin-bottom: var(--s2); }
.empty-text  { max-width: 300px; margin-inline: auto; }

/* Eyebrow section */
.section-title {
    font-family: var(--serif); font-style: italic;
    font-size: 1rem; font-weight: 400; letter-spacing: 0.04em;
    color: var(--muted); margin: 0 0 var(--s4);
}
.section-title:not(:first-child) { margin-top: 2.6rem; }

/* Tag monospace */
.tag-code {
    font-family: var(--mono); font-size: 0.76rem;
    background: var(--bg); padding: 0.1rem 0.4rem;
    border-radius: 2px; color: var(--muted);
}

/* ── 7. PIED ── */
.logo-fin { display: flex; justify-content: center; padding: var(--s4) 0 0; }
.logo-fin img { width: 40px; height: 40px; border-radius: var(--rf); opacity: 0.6; object-fit: cover; }
footer.pied {
    background: var(--header-bg); padding: var(--s8) 0 0; margin-top: var(--s16);
}
.pied-int {
    max-width: var(--max); margin-inline: auto; padding: 0 var(--s8);
    display: grid; grid-template-columns: repeat(3,1fr); gap: 1.8rem;
}
.pied-col-titre {
    font-size: var(--xs); text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--accent2);
    font-weight: 600; margin-bottom: 0.7rem;
}
.pied-int a {
    display: block; font-size: var(--sm); color: #c9bfae;
    text-decoration: none; padding: 0.2rem 0; transition: color var(--t);
}
.pied-int a:hover { color: var(--bg); }
.pied-bas {
    max-width: var(--max); margin: 1.5rem auto 0;
    padding: var(--s4) var(--s8);
    border-top: 1px solid #4a3f2e;
    font-size: var(--xs); color: #8a7d68;
}
@media (max-width: 640px) { .pied-int { grid-template-columns: 1fr 1fr; } }


/* ── PIED DE PAGE ──────────────────────────────────────── */
footer.pied { background: var(--text); padding: 2.2rem 0 0; margin-top: var(--s16); }
.pied-int { max-width: var(--max); margin-inline: auto; padding: 0 var(--s8); display: grid; grid-template-columns: repeat(3,1fr); gap: 1.8rem; }
.pied-colonne__titre { font-size: var(--xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent2); font-weight: 600; margin-bottom: 0.7rem; }
.pied-colonne a { display: block; font-size: var(--sm); color: #c9bfae; text-decoration: none; padding: 0.25rem 0; transition: color var(--t); }
.pied-colonne a:hover { color: var(--bg); }
.pied-bas { max-width: var(--max); margin: 1.6rem auto 0; padding: var(--s4) var(--s8); border-top: 1px solid #4a3f2e; font-size: var(--xs); color: #8a7d68; }
[data-theme="nuit"] footer.pied { background: #100d09; }
@media (max-width:640px) { .pied-int { grid-template-columns: 1fr 1fr; } }

/* ── Typographie QCM français ──────────────────────────── */
.exo-souligne { text-decoration: underline; text-underline-offset: 3px; }
.exo-gras { font-weight: 700; color: var(--text); }

/* Tableau QCM (lecture de données, tableaux/graphiques en énoncé) */
.exo-tableau {
    border-collapse: collapse; margin: 0.6rem 0; font-size: 0.92em; width: 100%;
}
.exo-tableau th, .exo-tableau td {
    border: 1px solid var(--border); padding: 0.35rem 0.65rem; text-align: left;
}
.exo-tableau th { background: var(--hl); font-weight: 600; }

/* Graphique en barres (calculé, pas dessiné par l'IA — largeurs toujours justes) */
.exo-graphique-barres { margin: 0.7rem 0; display: flex; flex-direction: column; gap: 0.45rem; }
.exo-barre-ligne { display: flex; align-items: center; gap: 0.6rem; font-size: 0.92em; }
.exo-barre-label { min-width: 110px; flex-shrink: 0; }
.exo-barre-piste { flex: 1; height: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.exo-barre-remplissage { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: var(--r); transition: width 0.4s ease; }
.exo-barre-valeur { min-width: 26px; text-align: right; font-weight: 600; flex-shrink: 0; }
