/* Ocafé — palette et typographie inspirées d'Oplana */
@font-face { font-family: 'Space Grotesk'; font-weight: 300; font-display: swap; src: url(fonts/space-grotesk-300.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 400; font-display: swap; src: url(fonts/space-grotesk-400.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 500; font-display: swap; src: url(fonts/space-grotesk-500.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 600; font-display: swap; src: url(fonts/space-grotesk-600.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 700; font-display: swap; src: url(fonts/space-grotesk-700.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-400.woff2) format('woff2'); }

:root {
    --fond: #f0f4f9; --texte: #1a1f2e; --carte: #fff; --doux: #64748b; --trait: #e2e8f0; --champ: #fff;
    --bleu: #2563eb; --accent-doux: #eff6ff; --accent-texte: #1d4ed8; --marine: #0f2b57;
    --degrade: linear-gradient(135deg, #3b82f6, #06b6d4);
    --ombre: 0 1px 3px #00000012, 0 1px 2px #0000000a;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --fond: #0f172a; --texte: #f8fafc; --carte: #1e293b; --doux: #94a3b8; --trait: #334155; --champ: #162032;
        --bleu: #3b82f6; --accent-doux: #1e3a5f; --accent-texte: #93c5fd; --marine: #020c1b;
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 400 15px/1.5 'Space Grotesk', system-ui, sans-serif; }
a { color: var(--accent-texte); }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.02em; font-weight: 600; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; font-weight: 600; }
code { font-family: 'JetBrains Mono', monospace; font-size: .85em; overflow-wrap: anywhere; }

.barre { background: var(--marine); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: calc(.7rem + env(safe-area-inset-top, 0px)) 1.25rem .7rem; }
.marque { display: flex; align-items: center; gap: .1rem; text-decoration: none; color: #f1f5f9; }
.marque img { width: 66px; height: 66px; margin: -6px -2px -6px -10px; align-self: flex-start; }
.marque b { display: block; font-size: 2rem; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.marque small { display: block; font: 400 .55rem 'JetBrains Mono', monospace; letter-spacing: .32em; color: #94a3b8; margin-top: .25rem; }
.barre nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.barre nav a { color: #ffffffb3; text-decoration: none; padding: .45rem .8rem; border-radius: .6rem; font-weight: 500; font-size: .9rem; }
.barre nav a:hover, .barre nav a.ici { color: #fff; background: #ffffff14; }

main { max-width: 1060px; margin: 0 auto; padding: 1.5rem 1rem calc(3rem + env(safe-area-inset-bottom, 0px)); }
.etroite { max-width: 520px; margin-inline: auto; }
.titre { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.annees { display: flex; gap: .3rem; }
.annees a { padding: .35rem .8rem; border-radius: .6rem; text-decoration: none; color: var(--doux); background: var(--carte); border: 1px solid var(--trait); }
.annees a.ici { background: var(--bleu); border-color: var(--bleu); color: #fff; }

.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: .75rem; box-shadow: var(--ombre); padding: 1.25rem; margin-bottom: 1rem; }
.carte.etroite { margin-bottom: 1rem; }
.discret { color: var(--doux); font-size: .88rem; }
.gros { font-size: 2.4rem; font-weight: 600; margin: 0; }
.gros span { font-size: 1.1rem; color: var(--doux); font-weight: 400; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tuiles article { background: var(--carte); border: 1px solid var(--trait); border-radius: .75rem; box-shadow: var(--ombre); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .2rem; }
.tuiles small { text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; color: var(--doux); font-weight: 500; }
.tuiles strong { font-size: 1.9rem; font-weight: 600; }
.tuiles span { font-size: .82rem; color: var(--doux); }

.bouton { display: inline-block; border: 0; border-radius: .75rem; padding: .7rem 1.4rem; background: var(--degrade); color: #fff; font: 600 .92rem 'Space Grotesk', system-ui, sans-serif; text-decoration: none; cursor: pointer; box-shadow: 0 2px 16px #3b82f640; }
.bouton:hover { filter: brightness(1.07); }
.bouton.secondaire { background: var(--accent-doux); color: var(--accent-texte); box-shadow: none; }
.bouton.large { width: 100%; padding: .95rem; font-size: 1rem; margin-top: .9rem; }
.lien { background: none; border: 0; padding: .3rem 0; color: var(--accent-texte); font: inherit; text-decoration: underline; cursor: pointer; }
.lien.danger { color: #ef4444; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

input, select, textarea { font: inherit; font-size: 16px; color: var(--texte); background: var(--champ); border: 1px solid var(--trait); border-radius: .6rem; padding: .6rem .7rem; width: 100%; }
input[type=checkbox] { width: auto; }
label { font-weight: 500; font-size: .85rem; }
label input, label select, label textarea { margin-top: .3rem; font-weight: 400; }
.pile { display: flex; flex-direction: column; gap: .8rem; align-items: stretch; margin-bottom: 1rem; }
.pile .bouton { align-self: flex-start; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; align-items: end; margin-bottom: .8rem; }
.grille .plein { grid-column: 1 / -1; }
.grille .bouton { justify-self: start; }
.case { display: flex; gap: .5rem; align-items: center; padding-bottom: .7rem; }
.case input { margin: 0; }
.champ { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; }
.champ input { width: 6rem; margin: 0; text-align: center; }

.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.choix.trois { grid-template-columns: repeat(3, 1fr); }
.choix label { position: relative; cursor: pointer; }
.choix input { position: absolute; opacity: 0; margin: 0; width: 1px; height: 1px; }
.choix span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 4.4rem; border: 2px solid var(--trait); border-radius: .75rem; text-align: center; }
.choix b { font-size: 1.05rem; }
.choix small { color: var(--doux); font-weight: 400; }
.choix input:checked + span { border-color: var(--bleu); background: var(--accent-doux); }
.choix input:focus-visible + span { outline: 3px solid var(--bleu); outline-offset: 2px; }
.autre { display: none; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .6rem; }
form:has(input[value=autre]:checked) .autre { display: grid; }
@supports not selector(:has(*)) { .autre { display: grid; } }

label.bloc { display: block; margin: .6rem 0 .9rem; }
summary { cursor: pointer; }
.noms { display: flex; flex-direction: column; gap: .4rem; margin-top: .8rem; }
.noms button { text-align: left; padding: .85rem 1rem; background: var(--champ); color: var(--texte); border: 1px solid var(--trait); border-radius: .65rem; font: 500 1rem 'Space Grotesk', system-ui, sans-serif; cursor: pointer; }
.noms button:hover { border-color: var(--bleu); background: var(--accent-doux); }

.message { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; border-radius: .75rem; margin-bottom: 1rem; border: 1px solid; }
.message.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.message.alerte { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.message.erreur { background: #fff1f2; border-color: #fecdd3; color: #881337; }
.message .lien { color: inherit; }

.defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--doux); font-weight: 600; }
th, td { padding: .6rem .55rem; border-bottom: 1px solid var(--trait); }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inactif { opacity: .55; }
.badge { display: inline-block; font-size: .68rem; font-weight: 600; padding: .1rem .45rem; border-radius: 1rem; background: #fff1f2; color: #881337; white-space: nowrap; }

.jauge { display: inline-flex; align-items: center; gap: .5rem; min-width: 8rem; }
.jauge i { flex: 1; height: .5rem; background: var(--trait); border-radius: 1rem; overflow: hidden; min-width: 5rem; }
.jauge u { display: block; height: 100%; border-radius: 1rem; }
.jauge b { font-size: .8rem; font-variant-numeric: tabular-nums; }
.jauge.ok u { background: #10b981; }
.jauge.moyen u { background: #f59e0b; }
.jauge.retard u { background: #ef4444; }

.fiche { border-top: 1px solid var(--trait); padding: .65rem 0; }
.fiche summary { cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.fiche summary span { color: var(--doux); font-size: .85rem; }
.fiche form:first-of-type { margin-top: .9rem; }

/* Page d'accueil */
body.accueil { background: linear-gradient(160deg, #173a75, #0f2b57 45%, #050d1c); color: #fff; min-height: 100vh; }
body.accueil .barre { background: transparent; }
.heros { text-align: center; padding: 12vh 0 0; }
.heros > p:first-child { text-transform: uppercase; letter-spacing: .2em; font-size: .85rem; opacity: .7; }
.heros h1 { font-size: clamp(2.2rem, 7vw, 4.5rem); font-weight: 300; line-height: 1.05; margin-bottom: 1.5rem; }
.heros h1 span { background: linear-gradient(135deg, #60a5fa, #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.heros .aide { opacity: .75; max-width: 30rem; margin: 0 auto 2rem; }

/* Affiche à imprimer */
.poster { background: #fff; color: #0f172a; max-width: 600px; margin: 1rem auto; text-align: center; border-radius: 1rem; overflow: hidden; box-shadow: 0 10px 30px #0003; padding-bottom: 1.5rem; }
.bandeau { background: linear-gradient(#173a75, #0f2b57); color: #f1f5f9; display: flex; justify-content: center; align-items: center; padding: 1.2rem; }
.bandeau img { width: 140px; height: 140px; margin: -10px -6px; }
.bandeau span { font-size: 5rem; font-weight: 300; line-height: 1; }
.poster h1 { margin: 1.4rem 1rem .2rem; font-size: 2rem; }
.poster p { margin: 0; color: #475569; font-size: 1.15rem; }
#qr { width: min(340px, 80%); margin: .8rem auto; }
#qr svg { display: block; width: 100%; height: auto; }
.poster ol { display: flex; justify-content: center; gap: 2rem; padding: 0 1rem; margin: 0; list-style-position: inside; font-weight: 500; flex-wrap: wrap; }

@media (max-width: 700px) {
    table, tbody, tr, td { display: block; }
    thead { display: none; }
    tr { border-bottom: 1px solid var(--trait); padding: .5rem 0; }
    td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .15rem 0; text-align: right; }
    td::before { content: attr(data-t); color: var(--doux); font-size: .78rem; text-align: left; }
}
@media print {
    @page { size: A4 portrait; margin: 10mm; }
    * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    body { background: #fff; }
    .barre, .sans-impression { display: none !important; }
    main { padding: 0; }
    .poster { box-shadow: none; margin: 0 auto; max-width: 100%; break-inside: avoid; }
    #qr { width: 105mm; }
}
