/* ============================================================
   BilanPro - Charte graphique "La formation pour Réussir"
   Bleu #4285F4 / Rouge #EA4335 / Jaune #FBBC05 / Vert #34A853
   Style sobre, professionnel, sans-serif.
   ============================================================ */

:root {
  --bleu: #4285F4;
  --rouge: #EA4335;
  --jaune: #FBBC05;
  --vert: #34A853;

  --texte: #1a1a1a;
  --texte-clair: #5f6368;
  --fond: #ffffff;
  --fond-alt: #f5f6f8;
  --bordure: #dcdfe3;

  --font-principale: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rayon: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-principale);
  color: var(--texte);
  background: var(--fond);
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

a { color: var(--bleu); }
a:focus, button:focus, input:focus, select:focus, textarea:focus, [tabindex]:focus {
  outline: 3px solid var(--bleu);
  outline-offset: 2px;
}

/* Lien d'évitement pour l'accessibilité clavier */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bleu);
  color: #fff;
  padding: .75em 1.25em;
  z-index: 1000;
  border-radius: 0 0 var(--rayon) 0;
}
.skip-link:focus { left: 0; }

/* Bande colorée signature (4 couleurs), utilisée sous les titres/en-têtes */
.bande-couleur {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: .5em 0 1.5em;
}
.bande-couleur span { flex: 1 1 0; }
.bande-couleur .c1 { background: var(--bleu); }
.bande-couleur .c2 { background: var(--rouge); }
.bande-couleur .c3 { background: var(--jaune); }
.bande-couleur .c4 { background: var(--vert); }

/* En-tête du site */
.entete {
  background: var(--fond);
  border-bottom: 1px solid var(--bordure);
}
.entete-contenu {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1em 1.5em 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1em;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--texte);
  text-decoration: none;
}
.accent { color: var(--bleu); }

.nav-principale { display: flex; gap: 1.5em; flex-wrap: wrap; align-items: center; }
.nav-principale a { color: var(--texte); text-decoration: none; font-weight: 600; }
.nav-principale a:hover, .nav-principale a[aria-current="page"] { color: var(--bleu); }

.entete .bande-couleur { max-width: 1100px; margin: 1em auto 0; }

/* Contenu principal */
.conteneur {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2em 1.5em;
}
.conteneur-etroit { max-width: 640px; }

/* Cartes */
.carte {
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 1.5em;
  margin-bottom: 1.5em;
}
.grille-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1em;
}
.carte-kpi { text-align: center; }
.carte-kpi .valeur { font-size: 2rem; font-weight: 700; color: var(--bleu); }
.carte-kpi .libelle { color: var(--texte-clair); }

/* Boutons */
.btn {
  display: inline-block;
  padding: .65em 1.4em;
  border-radius: var(--rayon);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primaire { background: var(--bleu); color: #fff; }
.btn-primaire:hover { background: #3367d6; }
.btn-secondaire { background: var(--fond); color: var(--texte); border-color: var(--bordure); }
.btn-secondaire:hover { background: var(--fond-alt); }
.btn-danger { background: var(--rouge); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Formulaires */
.champ { margin-bottom: 1.2em; }
label { display: block; font-weight: 600; margin-bottom: .35em; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="file"], select, textarea {
  width: 100%;
  padding: .6em .75em;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  font-size: 1rem;
  font-family: inherit;
  background: var(--fond);
  color: var(--texte);
}
.aide { color: var(--texte-clair); font-size: .9rem; margin-top: .3em; }
.erreur { color: var(--rouge); font-weight: 600; margin-bottom: 1em; }
.succes { color: var(--vert); font-weight: 600; margin-bottom: 1em; }

/* Mise en page espace connecté (sidebar + contenu) */
.espace {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 90px);
}
.barre-laterale {
  background: var(--fond-alt);
  border-right: 1px solid var(--bordure);
  padding: 1.5em 1em;
}
.barre-laterale nav a {
  display: block;
  padding: .6em .75em;
  border-radius: var(--rayon);
  color: var(--texte);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: .25em;
}
.barre-laterale nav a:hover { background: #e8eaed; }
.barre-laterale nav a[aria-current="page"] { background: var(--bleu); color: #fff; }
.contenu-principal { padding: 2em; min-width: 0; }

@media (max-width: 800px) {
  .espace { grid-template-columns: 1fr; }
  .barre-laterale { border-right: none; border-bottom: 1px solid var(--bordure); }
}

/* Fiche bénéficiaire */
.fiche-info dl { display: grid; grid-template-columns: max-content 1fr; gap: .4em 1.5em; margin: 0; }
.fiche-info dt { font-weight: 600; color: var(--texte-clair); }
.fiche-info dd { margin: 0; }

/* Parcours en 6 phases : indicateur d'étapes */
.parcours-etapes { display: flex; flex-wrap: wrap; gap: .5em; list-style: none; margin: 0 0 2em; padding: 0; }
.parcours-etapes li {
  flex: 1 1 140px;
  text-align: center;
  padding: .75em .5em;
  border-radius: var(--rayon);
  border: 2px solid var(--bordure);
  font-weight: 600;
  font-size: .9rem;
  color: var(--texte-clair);
  text-decoration: none;
  display: block;
}
.parcours-etapes li.terminee { border-color: var(--vert); color: var(--vert); background: #eaf7ee; }
.parcours-etapes li.en-cours { border-color: var(--bleu); color: var(--bleu); background: #eaf1fe; }
.parcours-etapes li.verrouillee { opacity: .55; }
.parcours-etapes a { color: inherit; text-decoration: none; display: block; }

/* Checklists */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: flex-start; gap: .6em; padding: .5em 0; border-bottom: 1px solid var(--bordure); }
.checklist li:last-child { border-bottom: none; }
.checklist input[type="checkbox"] { width: 1.2em; height: 1.2em; margin-top: .2em; flex-shrink: 0; }

/* Tableau de traçabilité Qualiopi */
table.qualiopi { width: 100%; border-collapse: collapse; }
table.qualiopi th, table.qualiopi td {
  text-align: left;
  padding: .7em .8em;
  border: 1px solid var(--bordure);
  vertical-align: top;
}
table.qualiopi th { background: var(--fond-alt); width: 220px; }

/* Tableaux génériques (listes bénéficiaires, tests...) */
table.liste { width: 100%; border-collapse: collapse; }
table.liste th, table.liste td { text-align: left; padding: .7em .6em; border-bottom: 1px solid var(--bordure); }
table.liste th { color: var(--texte-clair); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }

.badge { display: inline-block; padding: .2em .7em; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-vert { background: #eaf7ee; color: #1e7b34; }
.badge-bleu { background: #eaf1fe; color: #1a56c4; }
.badge-jaune { background: #fff6e0; color: #9a6b00; }
.badge-rouge { background: #fdecea; color: #c62828; }
.badge-gris { background: #eeeeee; color: #5f6368; }

/* Notation par etoiles (echelle 1-6 du test des schemas de Young) */
.notation-etoiles {
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: .15em;
}
.notation-etoiles input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
}
.notation-etoiles label {
  font-size: 1.7rem;
  line-height: 1;
  color: #dcdfe3;
  cursor: pointer;
  font-weight: normal;
  margin: 0;
  transition: color .1s;
}
.notation-etoiles label::before { content: "\2605"; }
.notation-etoiles input:checked ~ label,
.notation-etoiles label:hover,
.notation-etoiles label:hover ~ label {
  color: var(--jaune);
}
.notation-etoiles input:focus-visible + label {
  outline: 3px solid var(--bleu);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Grille de valeurs (test des valeurs, etape 1) */
.grille-valeurs {
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
}
.chip-valeur {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .5em .9em;
  border: 2px solid var(--bordure);
  border-radius: 999px;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  background: var(--fond);
  color: var(--texte);
  user-select: none;
}
.chip-valeur input { margin: 0; }
.chip-valeur:has(input:checked) {
  border-color: var(--bleu);
  background: #eaf1fe;
  color: #1a56c4;
}
.chip-valeur:has(input:disabled:not(:checked)) {
  opacity: .4;
  cursor: not-allowed;
}
.chip-valeur:has(input:focus-visible) {
  outline: 3px solid var(--bleu);
  outline-offset: 2px;
}

/* Bouton discret micro/upload audio */
.bouton-audio {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  background: var(--fond-alt);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: .35em .9em;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--texte);
}
.bouton-audio:hover { background: #e8eaed; }

/* Zone de dépôt de documents */
.zone-depot {
  border: 2px dashed var(--bordure);
  border-radius: var(--rayon);
  padding: 1.5em;
  text-align: center;
  color: var(--texte-clair);
}

/* Pied de page */
.pied-page {
  border-top: 1px solid var(--bordure);
  margin-top: 3em;
  padding: 1.5em;
  text-align: center;
  color: var(--texte-clair);
  font-size: .9rem;
}

/* Accessibilité : respecte la préférence de réduction des animations */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Mobile : les tableaux larges deviennent leur propre zone de defilement horizontal
   plutot que de faire deborder toute la page (meme sans div wrapper autour). */
@media (max-width: 700px) {
  table.liste, table.qualiopi { display: block; overflow-x: auto; white-space: nowrap; }
  h1 { font-size: 1.5rem; }
  .contenu-principal { padding: 1.25em; }
  .conteneur { padding: 1.5em 1em; }
}

/* Compte rendu / synthese imprimable en PDF */
.section-imprimable { page-break-inside: avoid; }
@media print {
  .no-print, .entete, .barre-laterale, .skip-link { display: none !important; }
  .espace { display: block; }
  .contenu-principal { padding: 0; }
  body { font-size: 12pt; }
  a { color: var(--texte); text-decoration: none; }
  .carte { border: none; padding: 0; margin-bottom: 1.2em; }
  .section-imprimable { break-inside: avoid; }
}
