/* CSB IA Tools — feuille de style unique, écrite à la main.
   Charte officielle de Clermont School of Business (kit de marque, novembre 2026).
   Toutes les couleurs et polices passent par les variables ci-dessous. */

/* ---------- Variables ---------- */
:root {
    /* Couleurs de la charte */
    --marine: #08335C;          /* Pantone 648 C — en-têtes, texte, navigation */
    --orange: #F07F13;          /* 151 C — action principale, quotas à surveiller ; texte marine, jamais blanc */
    --rose: #E9426D;            /* 184 C — alertes, quotas épuisés */
    --bleu-roi: #27348B;        /* 2746 C */
    --turquoise: #47BCCA;       /* 631 C */
    --petrole: #1D7997;         /* 633 C — liens, jauges en état normal */
    --bleu-clair: #5593CF;      /* 7688 C — part des versions dans les jauges empilées */

    /* Neutres */
    --blanc: #FFFFFF;
    --fond: #F4F6F9;
    --fond-doux: #EDF0F4;
    --piste: #E1E6ED;           /* fond des jauges */
    --bordure: #D5DCE5;
    --bordure-champ: #9AA8B8;
    --texte: #08335C;
    --texte-2: #33475B;
    --texte-3: #4A5B6E;
    --texte-4: #6B7C90;
    --sur-marine: #C9D4E3;      /* texte secondaire sur fond marine */

    /* Fonds teintés */
    --fond-info: #E5F3F6;
    --fond-alerte: #FDE8EE;
    --fond-orange: #FDF1E3;

    /* DIN PRO est sous licence : Barlow sert de repli tant que les fichiers ne sont pas fournis. */
    --police: 'DIN Pro', Barlow, Tahoma, sans-serif;
    --police-code: ui-monospace, 'Cascadia Mono', 'DejaVu Sans Mono', Consolas, monospace;
}

@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(../fonts/barlow-400.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 500; font-display: swap; src: url(../fonts/barlow-500.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(../fonts/barlow-600.woff2) format('woff2'); }
@font-face { font-family: Barlow; font-weight: 700; font-display: swap; src: url(../fonts/barlow-700.woff2) format('woff2'); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); font-size: 15px; line-height: 1.4; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--petrole); font-weight: 600; }
a:hover { color: var(--marine); }
img { max-width: 100%; }
code, .code { font-family: var(--police-code); }
code { padding: 2px 6px; border-radius: 5px; background: var(--blanc); font-size: .95em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--bleu-clair); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Utilitaires de mise en page ---------- */
.pile { display: flex; flex-direction: column; gap: 12px; }
.pile--serree { gap: 4px; }
.pile--large { gap: 20px; }
.rangee { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rangee--entre { justify-content: space-between; }
.rangee--haut { align-items: flex-start; }
.rangee--base { align-items: baseline; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.pousse { margin-left: auto; }
.doux { color: var(--texte-3); }
.petit { font-size: 13px; }
.gras { font-weight: 700; }
.demi-gras { font-weight: 600; }
.centre { text-align: center; }
.sans-retour { white-space: nowrap; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--bordure-champ); border-radius: 8px; background: var(--blanc); color: var(--marine); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--fond); color: var(--marine); }
.btn--principal { border: 0; background: var(--orange); font-weight: 700; }
.btn--principal:hover { background: #E07209; }
.btn--marine { border: 0; background: var(--marine); color: var(--blanc); font-weight: 700; }
.btn--marine:hover { background: #0B4276; color: var(--blanc); }
.btn--contour { border: 2px solid var(--marine); font-weight: 700; }
.btn--danger { border-color: var(--rose); }
.btn--grand { min-height: 52px; border-radius: 10px; font-size: 17px; }
.btn--petit { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn--bloc { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.lien-bouton { padding: 0; border: 0; background: none; color: var(--petrole); font-weight: 600; text-decoration: underline; cursor: pointer; }
.lien-bouton:hover { color: var(--marine); }

/* Filtres en pastilles : « Tous · 18 », « À aider · 3 » */
.pastille { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--bordure-champ); border-radius: 999px; background: var(--blanc); color: var(--marine); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.pastille[aria-pressed="true"], .pastille[aria-current="true"], .pastille--active { border-color: var(--marine); background: var(--marine); color: var(--blanc); }

/* ---------- Formulaires ---------- */
.champ-groupe { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.libelle { font-size: 14px; font-weight: 600; }
.libelle .facultatif, .facultatif { font-weight: 400; color: var(--texte-3); }
.champ { width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 1px solid var(--bordure-champ); border-radius: 8px; background: var(--blanc); color: var(--marine); font-size: 16px; }
.champ::placeholder { color: var(--texte-4); }
textarea.champ { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
select.champ { appearance: auto; }
.champ--erreur { border: 2px solid var(--rose); }
.champ--court { width: auto; max-width: 140px; }
.aide { font-size: 13px; color: var(--texte-3); }
.erreur-champ { font-size: 14px; font-weight: 600; color: var(--marine); }
.case { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.case input { width: 18px; height: 18px; accent-color: var(--marine); }

/* ---------- Cartes ---------- */
.carte { background: var(--blanc); border: 1px solid var(--bordure); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.carte--grande { border-radius: 16px; padding: 30px; gap: 18px; }
.carte--compacte { border-radius: 12px; padding: 16px; gap: 2px; }
.carte--alerte { border: 2px solid var(--rose); }
.carte--alerte.carte--compacte { background: var(--fond-alerte); padding: 15px; }
.carte__titre { font-size: 20px; font-weight: 700; }
.carte__entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.encart { padding: 14px 16px; border-radius: 10px; background: var(--fond); }
.encart--info { background: var(--fond-info); font-size: 14px; line-height: 1.5; }
.encart--alerte { background: var(--fond-alerte); }
.encart--orange { background: var(--fond-orange); border-left: 4px solid var(--orange); font-size: 14px; }
.encart--note { background: var(--blanc); border: 1px solid var(--bordure); border-left: 4px solid var(--petrole); }
.surtitre { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-2); }
.separe { padding-top: 14px; border-top: 1px solid var(--bordure); }

/* Chiffre clé : « 14 sur 18 » */
.chiffre { font-size: 30px; font-weight: 700; line-height: 1.15; }
.chiffre small { font-size: 16px; font-weight: 500; color: var(--texte-3); }
.chiffre-libelle { font-size: 14px; color: var(--texte-3); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; align-self: flex-start; padding: 6px 10px; border-radius: 8px; background: var(--fond-info); color: var(--marine); font-size: 14px; font-weight: 700; }
.badge--alerte { background: var(--fond-alerte); }
.badge--alerte-contour { background: var(--fond-alerte); border: 2px solid var(--rose); padding: 4px 8px; }
.badge--marine { background: var(--marine); color: var(--blanc); }
.badge--orange { background: var(--orange); }
.badge--neutre { background: var(--fond-doux); font-weight: 600; }
.badge--petit { padding: 3px 8px; border-radius: 6px; font-size: 13px; }
.badge--rond { border-radius: 999px; padding: 8px 16px; }

/* ---------- Jauges ---------- */
/* La couleur ne porte jamais l'information seule : chaque jauge est doublée d'un libellé. */
.jauge { height: 12px; border-radius: 6px; background: var(--piste); overflow: hidden; display: flex; }
.jauge > span { display: block; height: 100%; border-radius: 6px; background: var(--petrole); }
.jauge--fine { height: 6px; border-radius: 3px; }
.jauge--fine > span { border-radius: 3px; }
.jauge--epaisse { height: 18px; border-radius: 6px; }
.jauge--surveiller > span { background: var(--orange); }
.jauge--epuise > span { background: var(--rose); }
/* Jauge empilée : site en ligne (marine), versions (bleu clair), libre (piste). */
.jauge--empilee > span { border-radius: 0; }
.jauge--empilee > .jauge__site { background: var(--marine); }
.jauge--empilee > .jauge__versions { background: var(--bleu-clair); }
.jauge-ligne { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jauge-ligne__tete { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.jauge-ligne__tete strong { font-weight: 600; white-space: nowrap; }
.jauge-ligne--grande .jauge-ligne__tete { font-size: 16px; }
.jauge-ligne--grande .jauge-ligne__tete strong { font-weight: 700; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.legende span { display: inline-flex; align-items: center; gap: 8px; }
.legende i { width: 12px; height: 12px; border-radius: 3px; background: var(--piste); border: 1px solid var(--bordure-champ); }
.legende .l-marine { background: var(--marine); border-color: var(--marine); }
.legende .l-bleu { background: var(--bleu-clair); border-color: var(--bleu-clair); }
.legende .l-orange { background: var(--orange); border-color: var(--orange); }
.legende .l-rose { background: var(--fond-alerte); border: 2px solid var(--rose); }
.legende .l-petrole { background: var(--petrole); border-color: var(--petrole); }
.legende .l-trait { width: 24px; height: 8px; border: 0; border-radius: 4px; }

/* Les cinq étapes : cinq segments */
.etapes { display: flex; gap: 5px; }
.etapes span { flex: 1; height: 8px; border-radius: 4px; background: var(--piste); }
.etapes .faite { background: var(--marine); }

/* ---------- Tableaux ---------- */
.tableau-cadre { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { padding: 10px 10px; border-bottom: 2px solid var(--bordure); text-align: left; font-size: 14px; font-weight: 600; color: var(--texte-2); vertical-align: bottom; }
.tableau td { padding: 12px 10px; border-bottom: 1px solid var(--fond-doux); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .ligne-alerte td { background: var(--fond-alerte); }
.tableau .num { text-align: right; white-space: nowrap; }

/* ---------- Bloc de code sur fond marine ---------- */
.console { padding: 14px 16px; border-radius: 10px; background: var(--marine); color: var(--blanc); font-family: var(--police-code); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; }
.adresse { display: flex; align-items: center; min-height: 52px; padding: 0 18px; border-radius: 8px; background: var(--marine); color: var(--blanc); font-family: var(--police-code); font-size: 18px; overflow-wrap: anywhere; }

/* ---------- Messages ---------- */
.message { padding: 12px 16px; border-radius: 10px; background: var(--fond-info); font-size: 15px; font-weight: 600; }
.message--erreur { background: var(--fond-alerte); border: 2px solid var(--rose); }
.message--succes { background: var(--fond-info); border-left: 4px solid var(--petrole); }

/* ---------- Gabarit public (csb.otomae.com) ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 5%; background: var(--marine); color: var(--blanc); border-bottom: 6px solid var(--orange); }
.entete__marque { display: flex; align-items: center; gap: 14px; color: var(--blanc); text-decoration: none; }
.entete__marque img { display: block; height: 60px; width: auto; }
.entete__nom { font-size: 22px; font-weight: 700; }
.entete__contexte { font-size: 15px; color: var(--sur-marine); }
.principal { flex: 1; padding: 48px 5%; }
.pied { padding: 16px 5%; border-top: 1px solid var(--bordure); background: var(--blanc); color: var(--texte-3); font-size: 13px; }

/* ---------- Gabarit d'administration (admin.csb.otomae.com) ---------- */
.admin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 0 230px; max-width: 260px; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; background: var(--marine); color: var(--blanc); }
.nav__marque { display: flex; flex-direction: column; gap: 10px; }
.nav__marque img { display: block; height: 64px; width: auto; }
.nav__nom { font-size: 20px; font-weight: 700; }
.nav__zone { font-size: 13px; color: var(--sur-marine); }
.nav__liens { display: flex; flex-direction: column; gap: 4px; }
.nav__lien { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--blanc); font-size: 15px; font-weight: 400; text-decoration: none; }
.nav__lien:hover { background: rgba(255, 255, 255, .1); color: var(--blanc); }
.nav__lien[aria-current="page"] { background: var(--orange); color: var(--marine); font-weight: 700; }
.nav__pied { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--sur-marine); }
.nav__pied button { padding: 0; border: 0; background: none; color: var(--sur-marine); font-size: 13px; text-align: left; text-decoration: underline; cursor: pointer; }
.admin__corps { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; }
.barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 28px; background: var(--blanc); border-bottom: 1px solid var(--bordure); }
.barre__titres { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.barre__fil { font-size: 14px; }
.barre h1 { font-size: 26px; font-weight: 700; }
.barre__sous { font-size: 15px; color: var(--texte-3); }
.barre__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.contenu { flex: 1; display: flex; flex-direction: column; gap: 20px; padding: 22px 28px; }
.contenu h2 { font-size: 20px; font-weight: 700; }
.note-bas { font-size: 14px; color: var(--texte-3); }

/* Onglets d'exercice : clos, en cours, à venir */
.exercices { display: flex; flex-wrap: wrap; gap: 10px; }
.exercice { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--blanc); color: var(--marine); font-weight: 400; text-decoration: none; }
.exercice__etat { font-size: 13px; color: var(--texte-3); }
.exercice__titre { font-size: 16px; font-weight: 600; }
.exercice--courant { border-color: var(--marine); background: var(--marine); color: var(--blanc); }
.exercice--courant .exercice__etat { color: var(--sur-marine); }
.exercice--courant .exercice__titre { font-weight: 700; }
.exercice--a-venir { border-style: dashed; border-color: var(--bordure-champ); }
.exercices--compacts .exercice { flex: 0 1 auto; }

/* Fenêtre de confirmation (élément <dialog>) */
dialog.fenetre { width: min(520px, 92vw); padding: 26px; border: 1px solid var(--bordure); border-radius: 14px; color: var(--marine); }
dialog.fenetre::backdrop { background: rgba(8, 51, 92, .45); }
dialog.fenetre h2 { font-size: 20px; margin-bottom: 10px; }

@media (max-width: 760px) {
    .nav { max-width: none; flex-basis: 100%; }
    .nav__liens { flex-direction: row; flex-wrap: wrap; }
    .nav__pied { display: none; }
    .barre, .contenu { padding-left: 16px; padding-right: 16px; }
    .principal { padding: 28px 5%; }
}

/* ---------- Connexion et pages d'erreur ---------- */
.connexion { display: flex; justify-content: center; }
.connexion .carte { width: 100%; max-width: 460px; }
