/* Base : reset léger, typographie, boutons, formulaires, focus. Mobile-first. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}
main { flex: 1 0 auto; outline: none; }
/* L'attribut hidden l'emporte toujours, même sur un composant qui fixe son propre display. */
[hidden] { display: none !important; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--text-h1); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: var(--text-h2); font-weight: 700; }
h3 { font-size: var(--text-h3); font-weight: 700; }
p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-5) 0; }

/* Les liens de texte restent soulignés : jamais la couleur seule. */
a { color: var(--forest); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--forest-deep); }

/* Focus toujours visible (clavier, switch, lecteur d'écran). */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--r-sm); }
.on-dark :focus-visible { outline-color: var(--focus-on-dark); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-4); }
.stack > * + * { margin-top: var(--s-4); }
.muted { color: var(--ink-soft); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -4rem; z-index: 100;
  background: var(--ink); color: var(--white); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: var(--s-3); }

.icon { flex: none; width: 1.5rem; height: 1.5rem; }

/* ------------------------------------------------------------------ Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap-cta); padding: var(--s-3) var(--s-4); max-width: 100%; overflow-wrap: anywhere;
  border: 2px solid transparent; border-radius: var(--r);
  font-family: var(--font-body); font-size: 1.125rem; font-weight: 700; line-height: 1.2;
  text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), transform var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--forest); color: var(--white); }
.btn--primary:hover { background: var(--forest-deep); color: var(--white); }
.btn--accent { background: var(--brique); color: var(--white); }
.btn--accent:hover { background: var(--brique-deep); color: var(--white); }
.btn--outline { background: var(--surface); color: var(--forest); border-color: var(--forest); }
.btn--outline:hover { background: var(--forest-tint); color: var(--forest-deep); }
.btn--block { width: 100%; }
.btn--small { min-height: var(--tap); padding: var(--s-2) var(--s-4); font-size: 1rem; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; }

/* ------------------------------------------------------------------ Formulaires */
.field { display: grid; gap: var(--s-2); }
.field > label, .legend { font-weight: 700; font-size: 1rem; }
.input, .select {
  width: 100%; min-height: var(--tap-cta); padding: var(--s-3) var(--s-4);
  background: var(--white); border: 2px solid var(--line-strong); border-radius: var(--r);
  font-size: 1.125rem;
}
.input::placeholder { color: var(--ink-soft); opacity: 1; }
.select { appearance: auto; }
.checkbox {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: var(--tap); cursor: pointer; font-weight: 700;
}
.checkbox input { width: 1.75rem; height: 1.75rem; accent-color: var(--forest); flex: none; }

/* ------------------------------------------------------------------ Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .btn:active { transform: none; }
}

@media (min-width: 48rem) {
  .wrap { padding-inline: var(--s-6); }
}
