/* ==========================================================================
   Parcours d'intégration développeur : feuille de style
   Palette issue de la charte Linov (dégradé du logo : #0033FF → #FC3AC9)
   ========================================================================== */

:root {
  /* Couleurs de marque */
  --bleu: #0033ff;
  --rose: #fc3ac9;
  --rose-texte: #c41e96;        /* variante foncée : lisible en texte (5.3:1) */
  --degrade: linear-gradient(90deg, #0033ff 0%, #fc3ac9 100%);

  /* Neutres (repris des gris du logo) */
  --noir: #1b1b1b;
  --gris-fonce: #3e3e3e;
  --gris: #545454;
  --gris-clair: #656565;
  --bordure: #e3e5ea;
  --surface: #f5f6f8;
  --blanc: #ffffff;

  /* Sémantique */
  --succes: #0f7a4d;
  --alerte: #9a5b00;
  --danger: #b3261e;

  --rayon: 10px;
  --largeur: 860px;
  --ombre: 0 1px 2px rgba(27, 27, 27, .06), 0 8px 24px rgba(27, 27, 27, .06);

  /* "mundial" = police de la charte Linov (Adobe Fonts).
     Si le kit n'autorise pas ce sous-domaine, la pile de secours prend le relais. */
  --police: "mundial", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
  --police-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas,
                 "Liberation Mono", monospace;
}

/* --------------------------------------------------------------- Base --- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 130px; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 17px;
  line-height: 1.65;
  color: var(--noir);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

.barre-marque {
  height: 5px;
  background: var(--degrade);
}

/* ------------------------------------------------------------ En-tête --- */

.entete {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bordure);
}

.entete__contenu {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

.marque {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--noir);
  white-space: nowrap;
}

.marque span {
  background: var(--degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .93rem;
  font-weight: 600;
  color: var(--gris);
  text-decoration: none;
}

.nav a:hover { background: var(--surface); color: var(--noir); }

.nav a[aria-current="page"] {
  background: var(--noir);
  color: var(--blanc);
}

/* Deuxième barre : navigation interne à un exercice. */

.sous-entete {
  border-top: 1px solid var(--bordure);
  background: var(--surface);
}

.sous-entete__contenu {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}

.sous-entete__exercice {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gris-clair);
  white-space: nowrap;
}

.sous-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: auto;
}

.sous-nav a {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .89rem;
  font-weight: 600;
  color: var(--gris);
  text-decoration: none;
}

.sous-nav a:hover { background: var(--blanc); color: var(--noir); }

.sous-nav a[aria-current="page"] {
  background: var(--blanc);
  color: var(--bleu);
  box-shadow: inset 0 0 0 1px var(--bordure);
}

/* ------------------------------------------------------------ Layout ---- */

main {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 40px 24px 96px;
}

.pied {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 24px 24px 56px;
  border-top: 1px solid var(--bordure);
  color: var(--gris-clair);
  font-size: .88rem;
}

/* ---------------------------------------------------------- Typographie - */

h1 {
  font-size: clamp(2rem, 5vw, 2.7rem);
  line-height: 1.15;
  letter-spacing: -.025em;
  margin: 0 0 12px;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -.015em;
  margin: 56px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--bordure);
}

h3 { font-size: 1.12rem; margin: 30px 0 8px; }
h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
     color: var(--gris-clair); margin: 24px 0 8px; }

p, li { color: var(--gris-fonce); }
li { margin-bottom: 6px; }
ul, ol { padding-left: 22px; }

.chapo {
  font-size: 1.12rem;
  color: var(--gris);
  max-width: 62ch;
}

a { color: var(--bleu); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--rose-texte); }

strong { color: var(--noir); font-weight: 700; }

code {
  font-family: var(--police-mono);
  font-size: .88em;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 5px;
  padding: 1px 5px;
}

kbd {
  font-family: var(--police-mono);
  font-size: .82em;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
}

.pre-url {
  font-family: var(--police-mono);
  font-size: .85rem;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-left: 3px solid var(--bleu);
  border-radius: var(--rayon);
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
  color: var(--gris-fonce);
}

/* ------------------------------------------------------------ Blocs ----- */

.carte {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 22px 24px;
  box-shadow: var(--ombre);
  margin: 22px 0;
}

.encart {
  border-left: 4px solid var(--bleu);
  background: var(--surface);
  border-radius: 0 var(--rayon) var(--rayon) 0;
  padding: 16px 20px;
  margin: 22px 0;
}

.encart > :first-child { margin-top: 0; }
.encart > :last-child { margin-bottom: 0; }

.encart--attention { border-left-color: var(--alerte); background: #fff8ec; }
.encart--danger    { border-left-color: var(--danger); background: #fdf1f0; }
.encart--cle       { border-left-color: var(--rose); background: #fff2fb; }

.sans-marge-haut { margin-top: 0; }
.actions-bas { margin-top: 40px; }

.encart__titre {
  font-weight: 700;
  color: var(--noir);
  margin: 0 0 6px;
  font-size: .95rem;
}

/* ------------------------------------------------------------ Étapes ---- */

.etape {
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 26px 28px;
  margin: 26px 0;
  background: var(--blanc);
  box-shadow: var(--ombre);
}

.etape__entete {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.etape__numero {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--degrade);
  color: var(--blanc);
  font-weight: 800;
  font-size: .95rem;
}

/* Les titres d'étape sont des h2 : on annule le filet et les marges de h2. */
.etape__titre {
  font-size: 1.35rem;
  letter-spacing: -.015em;
  margin: 0;
  padding-top: 0;
  border-top: 0;
}

.etape__duree {
  margin-left: auto;
  font-size: .82rem;
  font-weight: 700;
  color: var(--gris-clair);
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}

.objectif {
  font-size: 1.02rem;
  color: var(--noir);
  border-left: 3px solid var(--rose);
  padding-left: 14px;
  margin: 14px 0 18px;
}

/* --------------------------------------------------------- Ressources --- */

.liens { list-style: none; padding: 0; margin: 10px 0 0; }

.liens li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--bordure);
  font-size: .95rem;
}

.liens li:last-child { border-bottom: 0; }
.liens a { font-weight: 600; }

.liens .source {
  color: var(--gris-clair);
  font-size: .82rem;
  font-weight: 600;
  margin-left: 6px;
}

/* ----------------------------------------------------------- Tableaux --- */

.tableau-conteneur { overflow-x: auto; margin: 20px 0; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .93rem;
  min-width: 480px;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--bordure);
  vertical-align: top;
}

thead th {
  background: var(--surface);
  color: var(--noir);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

tbody tr:hover { background: #fafbfc; }

/* --------------------------------------------------------- Progression -- */

.verif {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.verif li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface);
  font-size: .95rem;
}

.verif input[type="checkbox"] {
  margin-top: 4px;
  width: 17px;
  height: 17px;
  accent-color: var(--bleu);
  flex-shrink: 0;
  cursor: pointer;
}

.verif label { cursor: pointer; color: var(--gris-fonce); }
.verif li:has(input:checked) { background: #f1fbf5; border-color: #c9e9d6; }
.verif li:has(input:checked) label { color: var(--gris-clair); }

.progression {
  position: sticky;
  top: 104px;   /* sous l'en-tête à deux niveaux */
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 12px 18px;
  margin: 0 0 28px;
  box-shadow: var(--ombre);
  font-size: .88rem;
  font-weight: 600;
  color: var(--gris);
}

.progression__piste {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  overflow: hidden;
}

.progression__barre {
  height: 100%;
  width: 0;
  background: var(--degrade);
  transition: width .25s ease;
}

.progression button {
  font: inherit;
  font-size: .82rem;
  color: var(--gris-clair);
  background: none;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
}

.progression button:hover { color: var(--danger); border-color: var(--danger); }

/* --------------------------------------------------------- Sommaire ----- */

.sommaire { background: var(--surface); border: 1px solid var(--bordure);
            border-radius: var(--rayon); padding: 18px 24px; margin: 28px 0; }
.sommaire ol { margin: 8px 0 0; }
.sommaire li { margin-bottom: 4px; }
.sommaire a { font-weight: 600; text-decoration: none; }
.sommaire a:hover { text-decoration: underline; }

/* --------------------------------------------------------- Accueil ------ */

.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.tuile {
  display: block;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 20px;
  text-decoration: none;
  background: var(--blanc);
  box-shadow: var(--ombre);
}

.tuile:hover { border-color: var(--bleu); transform: translateY(-2px); }
.tuile { transition: transform .15s ease, border-color .15s ease; }
.tuile__titre { font-weight: 700; color: var(--noir); margin-bottom: 4px; }
.tuile__texte { color: var(--gris-clair); font-size: .9rem; }

.flux {
  font-family: var(--police-mono);
  font-size: .84rem;
  background: var(--noir);
  color: #f0f0f0;
  border-radius: var(--rayon);
  padding: 18px;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.8;
}

/* --------------------------------------------------------- Journal ------ */

.champ { margin: 0 0 18px; }

.champ label {
  display: block;
  font-weight: 600;
  font-size: .93rem;
  color: var(--noir);
  margin-bottom: 5px;
}

.champ textarea, .champ input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--noir);
  padding: 10px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--blanc);
  resize: vertical;
}

.champ textarea:focus, .champ input:focus { border-color: var(--bleu); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0; }

.bouton {
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--noir);
  background: var(--noir);
  color: var(--blanc);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.bouton:hover { background: var(--bleu); border-color: var(--bleu); color: var(--blanc); }

.bouton--fantome { background: none; color: var(--noir); }
.bouton--fantome:hover { background: var(--surface); color: var(--noir); border-color: var(--noir); }

.etat-sauvegarde { font-size: .85rem; color: var(--gris-clair); align-self: center; }

/* ------------------------------------------------------------ Héros ----- */

.heros { padding: 8px 0 4px; }

.heros__oeil {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 0 0 10px;
  background: var(--degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tuile non cliquable : même boîte, sans l'effet de survol. */
.tuile--statique { cursor: default; }
.tuile--statique:hover { transform: none; border-color: var(--bordure); }

/* ---------------------------------------------------- Cartes exercice --- */

.exercice {
  display: block;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 24px 26px;
  margin: 20px 0;
  background: var(--blanc);
  box-shadow: var(--ombre);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}

.exercice:hover { transform: translateY(-2px); border-color: var(--bleu); }

.exercice__entete {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.exercice__duree {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gris-clair);
}

.exercice__titre {
  margin: 0 0 8px;
  font-size: 1.3rem;
  letter-spacing: -.015em;
  color: var(--noir);
}

.exercice__texte { color: var(--gris-fonce); margin: 0 0 12px; }

.exercice__points { margin: 0 0 14px; color: var(--gris); font-size: .94rem; }

.exercice__prerequis {
  font-size: .9rem;
  color: var(--gris);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 14px;
}

.exercice__lien { font-weight: 700; color: var(--bleu); }

.niveau {
  display: inline-block;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 3px 11px;
  border-radius: 999px;
  color: var(--blanc);
  white-space: nowrap;
}

.niveau--1 { background: #0f7a4d; }
.niveau--2 { background: var(--bleu); }
.niveau--3 { background: #7a3fbf; }
.niveau--4 { background: var(--rose-texte); }

/* ------------------------------------------------------- Code donné ----- */

pre {
  font-family: var(--police-mono);
  font-size: .84rem;
  line-height: 1.6;
  background: var(--noir);
  color: #f0f0f0;
  border-radius: var(--rayon);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 14px 0;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.code-donne {
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 14px 18px 4px;
  margin: 18px 0;
  background: var(--surface);
}

.code-donne__titre {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gris-clair);
  margin: 0;
}

/* ------------------------------------------------------- Visionneuse --- */

.visionneuse {
  width: 100%;
  height: min(78vh, 720px);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--surface);
  display: block;
}

/* ------------------------------------------------------------ Quiz ------ */

.indice {
  font-size: .86rem;
  color: var(--gris-clair);
  margin: 6px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--bordure);
}

.note-sauvegarde {
  font-size: .86rem;
  color: var(--gris-clair);
  margin: -8px 0 24px;
}

/* ------------------------------------------------------------ Focus ----- */

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------ Details --- */

details {
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 12px 18px;
  margin: 14px 0;
  background: var(--surface);
}

summary { cursor: pointer; font-weight: 600; color: var(--noir); }
details[open] summary { margin-bottom: 10px; }

/* ------------------------------------------------------- Impression ----- */

@media print {
  .entete, .progression, .actions, .pied, .barre-marque { display: none !important; }
  body { font-size: 11pt; }
  main { max-width: none; padding: 0; }
  .etape, .carte { break-inside: avoid; box-shadow: none; }
  .champ textarea { border: 1px solid #999; min-height: 60px; }
  a::after { content: " (" attr(href) ")"; font-size: 8pt; color: #666; word-break: break-all; }
  .liens a::after { content: ""; }
}

/* ------------------------------------------------------------ Mobile ---- */

@media (max-width: 620px) {
  body { font-size: 16px; }
  /* En-tête trop haut sur petit écran : on désolidarise les barres collantes. */
  .entete { position: static; }
  .progression { position: static; }
  .sous-entete__contenu { padding: 8px 18px; }
  .sous-nav { width: 100%; margin-left: 0; }
  .exercice { padding: 20px 18px; }
  main { padding: 28px 18px 64px; }
  .etape { padding: 20px 18px; }
  .nav { width: 100%; margin-left: 0; }
  .entete__contenu { padding: 12px 18px; }
  .etape__duree { margin-left: 0; }
}
