/* Le cahier du jour : une page de cahier Seyès (papier quadrillé, marge rouge, écriture cursive, encre violette, stylo rouge de la maîtresse). */
@font-face { font-family: "Playwrite FR Trad"; src: url(/fonts/playwrite-fr-trad.woff2) format("woff2"); font-weight: 100 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(/fonts/figtree-latin-ext.woff2) format("woff2"); font-weight: 300 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; src: url(/fonts/figtree-latin.woff2) format("woff2"); font-weight: 300 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --c: #3d2f8f;            /* encre violette */
  --c-fonce: #2a1f6b;
  --stylo: #d23f3a;        /* stylo rouge de la maîtresse */
  --marge: #e3a3a3;        /* marge Seyès */
  --ligne: #d5def2;        /* lignes bleues du quadrillage */
  --ligne-fine: #eaeffa;
  --papier: #fdfdfb;
  --txt: #24223a;
  --doux: #5c5a73;
  --titre: "Playwrite FR Trad", "Segoe Script", "Brush Script MT", cursive;
  --texte: "Figtree", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: #eef1f9; }
body {
  margin: 0; font-family: var(--texte); font-size: 17px; line-height: 1.55; color: var(--txt);
  background:
    linear-gradient(var(--ligne) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, var(--ligne) 1px, transparent 1px) 0 0 / 32px 100%,
    linear-gradient(var(--ligne-fine) 1px, transparent 1px) 0 0 / 100% 8px,
    var(--papier);
  min-height: 100vh;
}
/* La feuille : fond uni sur la zone de lecture pour que le texte reste net, marge rouge à gauche. */
main {
  position: relative; max-width: 720px; margin: 0 auto; min-height: 100vh; padding: 40px 28px 64px 64px;
  background: var(--papier); box-shadow: 0 0 0 1px var(--ligne), 0 18px 50px -20px rgba(40, 40, 110, .35);
}
main::after { content: ""; position: absolute; top: 0; bottom: 0; left: 44px; width: 2px; background: var(--marge); }
main::before {
  content: "Le cahier du jour"; display: block; font-family: var(--titre); font-weight: 300; font-size: 15px; color: var(--c);
  margin: 0 0 28px; padding-bottom: 6px; border-bottom: 1px solid var(--ligne);
}
h1 { font-family: var(--titre); font-weight: 400; font-size: clamp(28px, 6vw, 40px); line-height: 1.35; color: var(--c); margin: 0 0 14px; letter-spacing: .2px; }
h2 { font-family: var(--titre); font-weight: 400; font-size: 21px; line-height: 1.4; color: var(--c); margin: 0 0 8px; }
h3 { font-size: 17px; margin: 18px 0 6px; }
p { margin: 0 0 14px; max-width: 62ch; }
a { color: var(--c); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--stylo); }
:focus-visible { outline: 3px solid var(--stylo); outline-offset: 2px; border-radius: 3px; }

/* Formulaires : on écrit sur la ligne. */
label { display: block; font-weight: 600; margin: 22px 0 2px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 8px 2px 6px; font: inherit; color: var(--txt); background: transparent;
  border: 0; border-bottom: 2px solid var(--ligne); border-radius: 0; transition: border-color .15s;
}
textarea { border: 2px solid var(--ligne); border-radius: 6px; padding: 10px; background: #fff; }
input[type=text]:focus, input[type=password]:focus, select:focus, textarea:focus { outline: 0; border-color: var(--c); }
select { padding-right: 20px; }
input[type=color] { width: 100%; height: 42px; padding: 2px; border: 2px solid var(--ligne); border-radius: 6px; background: #fff; }
input[type=checkbox], input[type=radio] { accent-color: var(--c); width: 20px; height: 20px; flex: none; margin: 0; }
.aide, .note { font-size: 14px; color: var(--doux); margin: 6px 0 0; max-width: 62ch; }
.note { margin-top: 28px; }
.ligne { display: flex; gap: 24px; flex-wrap: wrap; }
.ligne > div { flex: 1 1 200px; }
.cases label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; margin: 10px 0; }
.cases#jours { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cases#jours label { margin: 6px 0; }

/* Boutons : encre pleine, petit relief. */
button, .bouton {
  display: inline-block; margin-top: 26px; padding: 12px 24px; font: inherit; font-weight: 700; font-size: 16px; color: #fff; text-decoration: none;
  background: var(--c); border: 0; border-radius: 10px; cursor: pointer; box-shadow: 0 3px 0 var(--c-fonce); transition: transform .08s, box-shadow .08s;
}
button:hover, .bouton:hover { color: #fff; background: #4a3aa8; }
button:active, .bouton:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-fonce); }
button:disabled { background: #9a98b4; box-shadow: 0 3px 0 #7c7a96; cursor: default; }
button.secondaire, .secondaire { background: #fff; color: var(--c); box-shadow: inset 0 0 0 2px var(--c), 0 3px 0 var(--ligne); }
button.secondaire:hover, .secondaire:hover { background: #f3f1fc; color: var(--c); }
a.discret { font-size: 15px; }

/* Fiches : une feuille volante posée sur la page. */
.carte {
  position: relative; background: #fff; border: 1px solid var(--ligne); border-left: 4px solid var(--c); border-radius: 4px 10px 10px 4px;
  padding: 16px 20px 14px; margin: 18px 0; box-shadow: 0 6px 16px -12px rgba(40, 40, 110, .5);
}
.carte h2 { margin: 0 0 8px; }
.carte ul { list-style: none; margin: 6px 0 4px; padding: 0; }
.carte li { margin: 0; padding: 7px 0; border-top: 1px dashed var(--ligne); }
.carte li:first-child { border-top: 0; }
.carte li a { text-decoration: none; font-weight: 600; }
.carte li a::before { content: "⤓"; display: inline-block; width: 1.4em; color: var(--stylo); font-weight: 700; }
.carte li a:hover { text-decoration: underline; }
.carte > a { display: inline-block; margin-top: 8px; font-weight: 600; }
.lien { word-break: break-all; background: #f6f7fd; border: 2px dashed var(--ligne); border-radius: 8px; padding: 12px 14px; font-size: 15px; }
.erreur { color: var(--stylo); font-weight: 700; }
.piege { position: absolute; left: -9999px; }

/* Résultats : une ligne par activité, coches comme sur une fiche. */
fieldset { border: 0; border-top: 1px dashed var(--ligne); margin: 0; padding: 14px 0 10px; }
legend { font-weight: 700; padding: 0; float: left; width: 100%; margin-bottom: 8px; }
fieldset label { display: inline-flex; align-items: center; gap: 7px; margin: 4px 18px 4px 0; font-weight: 400; }
fieldset input[type=text] { margin-top: 6px; font-size: 15px; }

/* Rubriques d'un formulaire (étapes réelles, d'où la numérotation). */
.etape { margin: 34px 0 0; padding: 0; }
.etape > h2 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 0; }
.n, .etape > h2 .n { font-family: var(--texte); font-weight: 800; font-size: 14px; color: #fff; background: var(--stylo); border-radius: 50%; width: 26px; height: 26px; display: inline-grid; place-items: center; transform: translateY(-2px); }
.etape > .ligne:first-of-type, .etape > label:first-of-type { margin-top: 6px; }

/* Accueil. */
.accroche { font-size: 19px; line-height: 1.6; max-width: 54ch; }
.points { list-style: none; margin: 26px 0 8px; padding: 0; display: grid; gap: 12px; }
.points li { padding: 10px 0 10px 18px; border-left: 3px solid var(--stylo); max-width: 58ch; }
.points strong { display: block; font-family: var(--titre); font-weight: 400; color: var(--c); font-size: 18px; margin-bottom: 2px; }
.bon-point { color: var(--stylo); font-weight: 800; }

/* Sous-titre sous le h1 (date, consigne courte). */
.sous { font-size: 18px; color: var(--doux); margin: -6px 0 22px; }
.sous strong { color: var(--c); font-weight: 700; }

/* Page des cahiers : une fiche par jour, le cahier à imprimer d'abord. */
.carte.jour { padding: 18px 22px 18px; }
.carte.jour h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; line-height: 1.6; }
.carte.jour h2 small { font-family: var(--texte); font-size: 14px; font-weight: 600; color: var(--doux); letter-spacing: .3px; }
.tampon {
  display: inline-block; font-family: var(--texte); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--stylo); border: 2px solid var(--stylo); border-radius: 6px; padding: 1px 8px; transform: rotate(-4deg); margin-left: auto;
}
.carte.jour .principal { display: inline-flex; align-items: center; gap: 10px; margin: 6px 0 10px; padding: 11px 18px; font-size: 16px; text-decoration: none; }
.carte.jour .principal::before { content: "🖨"; font-size: 18px; }
.carte.jour ul { margin: 4px 0 0; }
.carte.jour li a { font-weight: 500; }
.carte.jour .resultats { display: inline-block; margin: 14px 0 0; padding: 9px 16px; font-size: 15px; }
.carte.jour .resultats::before { content: "✓ "; color: var(--stylo); font-weight: 800; }
.carte.contact { border-left-color: var(--stylo); background: #fffbf6; }
.carte.contact p { margin-bottom: 4px; }
.carte.contact .bouton { margin-top: 12px; background: #1f8f4e; box-shadow: 0 3px 0 #156b39; }
.carte.contact .bouton:hover { background: #24a35a; }
.premiere-etape { background: #fff; border: 2px dashed var(--stylo); border-radius: 10px; padding: 16px 20px; margin: 0 0 22px; }
.premiere-etape .bouton { margin-top: 12px; }

/* Résultats : une fiche par activité, les choix en pastilles. */
fieldset.activite { padding: 16px 0 14px; }
fieldset.activite legend { display: flex; align-items: baseline; gap: 10px; font-size: 17px; }
.choix { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; clear: both; }
.choix label { margin: 0; white-space: nowrap; padding: 7px 14px 7px 10px; border: 2px solid var(--ligne); border-radius: 999px; background: #fff; cursor: pointer; font-size: 15px; transition: border-color .12s, background .12s; }
.choix label:hover { border-color: var(--c); }
.choix label:has(input:checked) { border-color: var(--c); background: #f1eefc; font-weight: 600; color: var(--c-fonce); }
.choix label:has(input:focus-visible) { outline: 3px solid var(--stylo); outline-offset: 2px; }
.choix input[type=radio] { width: 16px; height: 16px; }
.succes {
  background: #fff; border: 2px solid var(--stylo); border-radius: 10px; padding: 20px 20px 20px 96px; position: relative; max-width: none; font-weight: 600; color: var(--c-fonce); min-height: 88px;
}
.succes::before {
  content: "Bravo"; position: absolute; left: 16px; top: 50%; margin-top: -31px; font-family: var(--titre); font-size: 14px; color: var(--stylo);
  border: 2px solid var(--stylo); border-radius: 50%; width: 62px; height: 62px; display: grid; place-items: center; transform: rotate(-12deg); line-height: 1; letter-spacing: .3px;
}
form + p, .retour { margin-top: 22px; }

/* Bilan : la lettre écrite en grand sur une feuille, la syllabe sur la ligne. */
.progres { font-size: 14px; color: var(--doux); }
.barre { height: 6px; background: var(--ligne-fine); border-radius: 3px; overflow: hidden; margin: 6px 0 14px; }
.barre div { height: 100%; background: var(--c); width: 0; transition: width .2s; }
.grande { text-align: center; font-size: clamp(72px, 20vw, 110px); font-weight: 700; line-height: 1.1; margin: 4px 0 0; letter-spacing: 10px; color: var(--c-fonce); }
.syllabe {
  text-align: center; font-size: 56px; font-weight: 600; margin: 10px auto 4px; min-height: 76px; width: min(100%, 280px); line-height: 76px;
  border-bottom: 2px solid var(--ligne); background: linear-gradient(transparent 50%, var(--ligne-fine) 50%, var(--ligne-fine) calc(50% + 1px), transparent calc(50% + 1px));
  color: var(--c); transition: color .15s;
}
.syllabe.cache { color: transparent; }
.coches { margin-top: 10px; }
.coches label { display: flex; align-items: center; gap: 12px; font-weight: 400; margin: 0; padding: 10px 12px; border-top: 1px dashed var(--ligne); font-size: 17px; cursor: pointer; }
.coches label:first-child { border-top: 0; }
.coches label:has(input:checked) { color: var(--c-fonce); font-weight: 600; }
.coches input { width: 22px; height: 22px; flex: none; }
.nav { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.nav button { margin-top: 12px; }
.mots { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.mots label { display: inline-flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 600; margin: 0; padding: 8px 18px 8px 12px; border: 2px solid var(--ligne); border-radius: 10px; background: #fff; cursor: pointer; color: var(--c-fonce); }
.mots label:has(input:checked) { border-color: var(--c); background: #f1eefc; }
.mots input { width: 22px; height: 22px; }

/* Tableau du bilan : une ligne par lettre. */
table.tab { border-collapse: collapse; width: 100%; max-width: 560px; margin-top: 10px; }
table.tab th, table.tab td { border-bottom: 1px solid var(--ligne); padding: 8px 8px; text-align: center; font-size: 15px; }
table.tab th { color: var(--c); font-weight: 700; vertical-align: bottom; padding-bottom: 6px; }
table.tab th:first-child, table.tab td:first-child { text-align: left; }
table.tab td:first-child { font-size: 24px; font-weight: 700; white-space: nowrap; color: var(--c-fonce); padding-left: 10px; }
table.tab td small { display: block; font-size: 12px; font-weight: 400; color: var(--doux); line-height: 1.3; }
table.tab th small { font-weight: 500; }
table.tab th small a { font-size: 12px; }
table.tab input { width: 22px; height: 22px; }
table.tab thead th { position: sticky; top: 0; background: var(--papier); z-index: 1; box-shadow: 0 2px 0 var(--ligne); }
table.tab tbody tr:nth-child(even) td { background: #f8f9fe; }
table.tab tbody tr:has(input:checked) td:first-child { color: var(--c); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  main { padding: 28px 16px 48px 40px; box-shadow: none; }
  main::after { left: 24px; }
  .carte { padding: 14px 14px 12px; }
  .carte.jour { padding: 14px 16px 16px; }
  .carte.jour h2 { font-size: 19px; }
  .tampon { margin-left: 0; }
  .carte.jour .principal { width: 100%; justify-content: center; }
  .nav button { flex: 1 1 auto; }
  .mots label { font-size: 22px; padding: 6px 14px 6px 10px; }
  table.tab th, table.tab td { padding: 8px 4px; }
  table.tab td:first-child { font-size: 20px; padding-left: 4px; }
  .succes { padding-left: 84px; }
  .succes::before { left: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { body { background: #fff; } main { box-shadow: none; } }
