/* depot_print.css — print.jauriach.fr (depot_print.py) : ramasser les copies en PDF.
   Un monde à part, tiré de l'affiche « Soyez dans la joie » (depot_print_affiche.jpg) : papier crème,
   rouge brique, or ocre, bleu acier ; capitales massives (Russo One) pour les titres, PT Sans pour le
   texte ; aplats francs, angles droits, peu de choses à l'écran. Variante sombre « acier ». */
@font-face { font-family: "Russo One"; font-weight: 400; font-display: swap; src: url("/static/polices/russo-one-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Russo One"; font-weight: 400; font-display: swap; src: url("/static/polices/russo-one-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "PT Sans"; font-weight: 400; font-display: swap; src: url("/static/polices/pt-sans-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; font-weight: 400; font-display: swap; src: url("/static/polices/pt-sans-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "PT Sans"; font-weight: 700; font-display: swap; src: url("/static/polices/pt-sans-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; font-weight: 700; font-display: swap; src: url("/static/polices/pt-sans-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --papier: #efe4cf; --carte: #f7efdf; --encre: #221c18; --discret: #5e5348; --filet: #cbbb9c;
  --rouge: #8e1b1b; --rouge-fonce: #6f1414; --or: #d8a63c; --acier: #3d5a73; --vert: #2f6b45;
  --titres: "Russo One", "Arial Black", sans-serif; --texte: "PT Sans", "Trebuchet MS", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --papier: #161a1f; --carte: #1e242b; --encre: #efe4cf; --discret: #b5ab9b; --filet: #34404c;
          --rouge: #b32a2a; --rouge-fonce: #8e1b1b; --vert: #8cc9a1; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 17px/1.55 var(--texte); min-height: 100vh; display: flex; flex-direction: column; }
main { width: min(52rem, 100% - 2.5rem); margin: 0 auto; padding: 2.5rem 0 2rem; flex: 1; }
footer { width: min(52rem, 100% - 2.5rem); margin: 0 auto; padding: 1.2rem 0 2rem; border-top: 2px solid var(--encre); color: var(--discret); font-size: .9rem; }
footer p { margin: 0; }
::selection { background: var(--or); color: #221c18; }
a { color: inherit; text-decoration-color: var(--rouge); text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, input:focus-visible, .zone:focus-visible, summary:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

h1, h2, .compteur, .lien-legende, legend, .principal { font-family: var(--titres); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.05; margin: 0 0 1.2rem; text-wrap: balance; }
h2 { font-size: 1.15rem; margin: 2.6rem 0 1rem; padding-bottom: .4rem; border-bottom: 2px solid var(--encre); }
p { margin: 0 0 1rem; text-wrap: pretty; }
.discret { color: var(--discret); font-size: .93rem; }
.fil { margin: 0 0 1.4rem; }
.fil a { text-decoration: none; font-weight: 700; color: var(--discret); }
.fil a:hover { color: var(--rouge); }

/* L'affiche, en tête de l'accueil et de l'espace professeur */
.affiche { margin: 0 0 2rem; border: 2px solid var(--encre); }
.affiche img { display: block; width: 100%; height: auto; }
.affiche.bandeau img { aspect-ratio: 1424 / 420; object-fit: cover; object-position: 50% 30%; }

.accueil { max-width: 40rem; }
.accueil form { margin: 1.8rem 0 1rem; }

/* Boutons : aplats francs, angles droits */
button, .principal, .secondaire { font: inherit; cursor: pointer; }
.principal { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.5rem;
  border: 0; border-radius: 0; background: var(--rouge); color: #f7efdf; font-size: 1.02rem; text-decoration: none; box-shadow: 0 3px 0 var(--rouge-fonce); }
.principal:hover { background: var(--rouge-fonce); }
.principal:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rouge-fonce); }
.principal:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.secondaire, .copier { min-height: 2.6rem; padding: 0 1rem; border: 2px solid var(--encre); border-radius: 0; background: transparent; color: var(--encre); font-weight: 700; }
.secondaire:hover, .copier:hover { background: var(--encre); color: var(--papier); }

/* Le lien à garder (professeur) ou à envoyer (classe) : en grand, dans un bandeau rouge */
.lien-grand { margin: 1.2rem 0 1rem; padding: 1.2rem 1.4rem 1.3rem; background: var(--rouge); color: #f7efdf; }
.lien-legende { margin: 0 0 .4rem; color: var(--or); font-size: .95rem; }
.lien-adresse { margin: 0 0 1rem; font-family: var(--titres); font-size: clamp(1.35rem, 5.2vw, 2.4rem); line-height: 1.15; overflow-wrap: anywhere; letter-spacing: .01em; }
.lien-adresse a { color: #f7efdf; text-decoration: none; }
.lien-grand .copier { border-color: #f7efdf; color: #f7efdf; }
.lien-grand .copier:hover { background: #f7efdf; color: var(--rouge); }
.copier.fait { background: var(--or) !important; border-color: var(--or) !important; color: #221c18 !important; }
.avertissement { padding: .9rem 1.1rem; border: 2px solid var(--encre); background: var(--carte); font-size: .97rem; }
.avertissement strong { color: var(--rouge); }

/* Formulaires */
label { display: block; margin: 0 0 1rem; font-weight: 700; }
input[type="text"] { display: block; width: 100%; margin-top: .35rem; padding: .7rem .8rem; border: 2px solid var(--encre); border-radius: 0;
  background: var(--carte); color: var(--encre); font: inherit; font-weight: 400; }
.case { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; font-weight: 400; }
.case input { width: 1.2rem; height: 1.2rem; margin: .2rem 0 0; flex: none; accent-color: var(--rouge); }

/* Mes TP */
.liste-tp { list-style: none; padding: 0; margin: 0; }
.liste-tp li { border-bottom: 1px solid var(--filet); }
.liste-tp a { display: flex; flex-wrap: wrap; gap: .2rem 1rem; align-items: baseline; padding: .85rem .2rem; text-decoration: none; }
.liste-tp a:hover .tp-nom { color: var(--rouge); }
.tp-nom { font-weight: 700; font-size: 1.08rem; margin-right: auto; }
.tp-n { font-family: var(--titres); color: var(--rouge); }
.vide { padding: .85rem .2rem; color: var(--discret); }

/* Un TP : compteur, assemblage, dépôts */
.compteur { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin: 2rem 0 1rem; font-size: 1.2rem; }
#nombre { font-size: clamp(3rem, 9vw, 4.5rem); line-height: 1; color: var(--rouge); font-variant-numeric: tabular-nums; }
#pages { font-family: var(--texte); text-transform: none; letter-spacing: 0; }
.assembler { display: flex; flex-direction: column; gap: .9rem; align-items: flex-start; margin: 0 0 2rem; padding: 1.1rem 1.2rem;
  border: 2px solid var(--encre); background: var(--carte); }
.assembler .case { margin: 0; font-size: .97rem; }
.depots { list-style: none; padding: 0; margin: 0; counter-reset: rang; border-top: 2px solid var(--encre); }
.depots li { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .15rem .9rem; align-items: center; padding: .7rem .2rem; border-bottom: 1px solid var(--filet); }
.depots li::before { counter-increment: rang; content: counter(rang); grid-row: 1 / span 2; font-family: var(--titres); color: var(--discret); font-variant-numeric: tabular-nums; }
.depots li.nouveau { animation: arrivee 1.8s ease-out; }
@keyframes arrivee { from { background: color-mix(in srgb, var(--or) 45%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .depots li.nouveau { animation: none; } }
.depot-noms { font-weight: 700; overflow-wrap: anywhere; }
.depot-meta { grid-column: 2; color: var(--discret); font-size: .9rem; }
.depot-actions { grid-row: 1 / span 2; grid-column: 3; display: flex; gap: .4rem; }
.depot-actions a, .depot-actions button { min-height: 2.3rem; padding: 0 .85rem; border: 2px solid var(--encre); border-radius: 0; background: transparent;
  color: var(--encre); font: 700 .9rem var(--texte); display: inline-flex; align-items: center; text-decoration: none; }
.depot-actions a:hover { background: var(--encre); color: var(--papier); }
.depot-actions button:hover { border-color: var(--rouge); background: var(--rouge); color: #f7efdf; }
.danger { margin-top: 3rem; color: var(--discret); }
.danger summary { cursor: pointer; font-weight: 700; }
.danger button { margin-top: .5rem; min-height: 2.5rem; padding: 0 1rem; border: 2px solid var(--rouge); border-radius: 0; background: transparent; color: var(--rouge); font-weight: 700; }
.danger button:hover { background: var(--rouge); color: #f7efdf; }

/* L'élève : noms, glisser-déposer */
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-size: 1rem; margin-bottom: .7rem; }
.ligne-nom { display: grid; grid-template-columns: 1fr 1fr auto; gap: .7rem; align-items: end; margin-bottom: .7rem; }
.ligne-nom label { margin: 0; }
.ligne-nom .retirer { min-height: 2.9rem; width: 2.9rem; border: 2px solid var(--encre); border-radius: 0; background: transparent; color: var(--encre); font-size: 1.2rem; }
.ligne-nom .retirer:hover { background: var(--encre); color: var(--papier); }
.zone { margin: 1.4rem 0 1.3rem; padding: 2.6rem 1.2rem; border: 3px dashed var(--encre); background: var(--carte); text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.zone:hover, .zone.survol { border-color: var(--rouge); background: color-mix(in srgb, var(--rouge) 8%, var(--carte)); }
.zone.choisi { border-style: solid; border-color: var(--vert); }
.zone p { margin: 0 0 .3rem; }
.zone strong { font-family: var(--titres); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; font-size: 1.15rem; }
progress { display: block; width: 100%; height: .6rem; margin: 1rem 0 0; accent-color: var(--rouge); }
#message { margin-top: 1rem; }
#message.ok { color: var(--vert); font-weight: 700; }
#message.erreur { color: var(--rouge); font-weight: 700; }

@media (max-width: 34rem) {
  main { padding-top: 1.5rem; }
  .ligne-nom { grid-template-columns: 1fr auto; }
  .ligne-nom label:nth-child(2) { grid-column: 1; }
  .ligne-nom .retirer { grid-row: 1 / span 2; grid-column: 2; }
  .depots li { grid-template-columns: 2rem 1fr; }
  .depot-actions { grid-row: auto; grid-column: 2; }
}
