* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--encre);
  font-family: var(--police);
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--encre); text-decoration-color: var(--or); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--or-pale); }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
::selection { background: var(--or-pale); }

.entete-marque { display: flex; align-items: center; height: 56px; padding: 0 24px; background: var(--fond); border-bottom: 1px solid var(--trait); }
.entete-marque a { display: inline-block; line-height: 0; }
.entete-marque a:hover { background: none; }
.entete-marque img { display: block; height: 26px; width: auto; }

h1, h2 { font-weight: 760; font-stretch: 112%; letter-spacing: -0.01em; line-height: 1.2; }
h1 { margin: 0 0 0.5rem; font-size: clamp(1.5rem, 4.5vw, 1.9rem); }
h2 { margin: 1.6rem 0 0.4rem; font-size: 1.1rem; }

.page, .bibliotheque, .suivi-page, .legal { width: min(100% - 32px, 62rem); margin: 40px auto; }
.page { max-width: 30rem; padding: 32px; background: var(--fond); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
.page .code-erreur { margin: 0 0 0.25rem; color: var(--texte-doux); font-size: 0.9rem; }

.intro, .note { margin: 0.75rem 0 0; color: var(--texte-doux); }
.client { margin: 0 0 0.25rem; font-weight: 600; }
.compte { margin: 0; color: var(--texte-doux); }

.alerte { margin: 1.25rem 0 0; padding: 0.8rem 1rem; background: #fdf1f1; border: 1px solid var(--rouge); border-radius: var(--rayon-petit); }
.alerte::before { content: "!"; display: inline-block; width: 1.3rem; height: 1.3rem; margin-right: 0.5rem; color: #fff; background: var(--rouge); border-radius: 50%; font-weight: 700; line-height: 1.3rem; text-align: center; }

.formulaire { margin-top: 1.5rem; }
.formulaire > label { display: block; margin: 1.1rem 0 0.35rem; font-weight: 600; }
.formulaire > label:first-of-type { margin-top: 0; }
.formulaire > label.case { display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 1.25rem; font-weight: 400; }
label.case input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--encre); }

input[type="email"], input[type="password"], input[type="text"], input[type="search"], textarea, select {
  width: 100%; min-height: 2.75rem; padding: 0.6rem 0.85rem; color: var(--encre); background: var(--fond);
  border: 1px solid var(--trait); border-radius: var(--rayon-petit); font: inherit;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--encre); outline: 2px solid var(--encre); outline-offset: 1px; }

button, .bouton {
  display: block; width: 100%; min-height: 2.75rem; margin-top: 1.25rem; padding: 0.6rem 1.1rem;
  color: var(--encre); background: var(--or); border: 1px solid var(--or); border-radius: var(--rayon-petit);
  font: inherit; font-weight: 650; text-align: center; text-decoration: none; cursor: pointer;
}
button, .bouton, a { transition: background-color 0.15s ease, border-color 0.15s ease; }
button:hover, .bouton:hover { background: var(--or-clair); border-color: var(--or-clair); }
button.secondaire, .bouton.secondaire { background: var(--fond); border-color: var(--trait); }
button.secondaire:hover, .bouton.secondaire:hover { background: var(--surface); border-color: var(--encre); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:disabled:hover { background: var(--or); border-color: var(--or); }

.cle { margin: 0.6rem 0 0; padding: 0.9rem; background: var(--surface); border: 1px dashed var(--trait); border-radius: var(--rayon-petit); font-family: var(--police-mono); font-size: 1.05rem; letter-spacing: 0.08em; word-break: break-word; user-select: all; }
.lien { display: block; margin-top: 0.5rem; font-family: var(--police-mono); font-size: 0.8rem; line-height: 1.45; word-break: break-all; }

.depot input[type="file"] { width: 100%; min-height: 3rem; padding: 0.6rem; background: var(--surface); border: 1px dashed var(--encre); border-radius: var(--rayon-petit); font: inherit; }
.depot input[type="file"]::file-selector-button { margin-right: 0.7rem; padding: 0.45rem 0.8rem; color: var(--encre); background: var(--fond); border: 1px solid var(--trait); border-radius: var(--rayon-petit); font: inherit; font-weight: 600; cursor: pointer; }
.statut { min-height: 1.55em; margin: 1rem 0 0; color: var(--texte-doux); overflow-wrap: anywhere; }
.progression { display: block; width: 100%; height: 0.75rem; margin: 0.75rem 0 0; accent-color: var(--or); }
.retour { margin: 2rem 0 0; }
.retour a { font-weight: 600; }

.bibliotheque { max-width: 56rem; }
.bibliotheque .barre { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.bibliotheque .barre h1 { margin: 0; }
.bibliotheque nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bibliotheque nav a, .bibliotheque nav button { display: inline-block; width: auto; min-height: 2.5rem; margin: 0; padding: 0.5rem 0.9rem; color: var(--encre); background: var(--fond); border: 1px solid var(--trait); border-radius: var(--rayon-petit); font-weight: 600; text-decoration: none; }
.bibliotheque nav a:hover, .bibliotheque nav button:hover { background: var(--surface); border-color: var(--encre); }
.bibliotheque nav a:first-child { background: var(--or-pale); border-color: var(--or); }
.bibliotheque .en-ligne { display: inline; }
.bibliotheque .recherche { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.bibliotheque .recherche input[type="search"] { flex: 1 1 14rem; width: auto; }
.bibliotheque .recherche select, .bibliotheque .recherche button { width: auto; margin: 0; }
.bibliotheque .guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 16px; }
.bibliotheque .guide { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 20px; background: var(--fond); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
.bibliotheque .guide h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.bibliotheque .guide form button { margin: 0; }
.bibliotheque .date { margin: 0; color: var(--texte-doux); font-family: var(--police-mono); font-size: 0.85rem; }
.bibliotheque .vide { grid-column: 1 / -1; color: var(--texte-doux); }
.bibliotheque form.formulaire textarea { margin-bottom: 0.5rem; }
.en-cours { margin: 20px 0; padding: 16px 20px; background: var(--or-pale); border: 1px solid var(--or); border-radius: var(--rayon); }
.en-cours h2 { margin: 0 0 0.4rem; }
.en-cours ul { margin: 0; padding-left: 1.2rem; }
.en-cours .date { color: var(--texte-doux); font-size: 0.9rem; }

.legal { max-width: 46rem; padding: 0; }
.legal h2 { margin-top: 1.6em; }
.pied-legal { width: min(100% - 32px, 62rem); margin: 32px auto 24px; font-size: 0.85rem; color: var(--texte-doux); }
.pied-legal a { margin-right: 14px; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  button, .bouton, a { transition: none; }
}

@media (max-width: 30rem) {
  .entete-marque { padding: 0 16px; }
  .page { padding: 22px; margin-top: 24px; }
}
