:root {
  --bleu: #00338d;
  --bleu-moyen: #005eb8;
  --bleu-clair: #0091da;
  --encre: #0c233c;
  --encre-douce: #4a5b70;
  --brume: #f2f5fa;
  --filet: #d5dce8;
  --blanc: #ffffff;
  --rouge: #b3261e;
  --rouge-fond: #fcefee;
  --vert: #1e7b4f;
  --vert-fond: #eaf6f0;
  --ambre: #8a5a00;
  --ambre-fond: #fdf4e0;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', 'Segoe UI', Helvetica, Arial, sans-serif;

  --rayon: 3px;
  --transition: 150ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--encre);
  background: var(--blanc);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.35rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--bleu-moyen);
  text-underline-offset: 3px;
  transition: color var(--transition);
}

a:hover {
  color: var(--bleu);
}

:focus-visible {
  outline: 3px solid var(--bleu-clair);
  outline-offset: 2px;
}

img,
svg {
  max-width: 100%;
}

.cache {
  display: none !important;
}

.lecture-ecran {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Champs */

.champ {
  margin-bottom: 1.25rem;
}

.champ > label,
.libelle {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.champ .aide {
  display: block;
  font-size: 0.92rem;
  color: var(--encre-douce);
  margin-bottom: 0.35rem;
}

.facultatif {
  font-weight: 400;
  color: var(--encre-douce);
  font-size: 0.9em;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='password'],
input[type='date'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--blanc);
  border: 1px solid #8e9bb0;
  border-radius: var(--rayon);
  padding: 0.6rem 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--bleu-moyen);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--bleu-moyen);
  box-shadow: 0 0 0 3px rgba(0, 145, 218, 0.3);
}

.en-erreur input,
.en-erreur textarea,
.en-erreur select {
  border-color: var(--rouge);
}

.erreur-champ {
  display: block;
  margin-top: 0.4rem;
  color: var(--rouge);
  font-size: 0.95rem;
  font-weight: 600;
}

.coche {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  cursor: pointer;
}

.champ > label.coche {
  display: flex;
  font-weight: 400;
}

.coche input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.2rem 0 0;
  accent-color: var(--bleu);
  cursor: pointer;
}

/* Boutons */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  color: var(--blanc);
  background: var(--bleu);
  border: 1px solid var(--bleu);
  border-radius: var(--rayon);
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.bouton:hover {
  background: var(--bleu-moyen);
  border-color: var(--bleu-moyen);
  color: var(--blanc);
}

.bouton:disabled,
.bouton[aria-disabled='true'] {
  background: #9aa7ba;
  border-color: #9aa7ba;
  cursor: not-allowed;
}

.bouton-secondaire {
  color: var(--bleu);
  background: var(--blanc);
  border-color: var(--bleu);
}

.bouton-secondaire:hover {
  color: var(--blanc);
  background: var(--bleu);
  border-color: var(--bleu);
}

.bouton-discret {
  color: var(--bleu-moyen);
  background: transparent;
  border-color: transparent;
  padding-inline: 0.4rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bouton-discret:hover {
  color: var(--bleu);
  background: transparent;
  border-color: transparent;
}

.bouton-danger {
  color: var(--rouge);
  background: var(--blanc);
  border-color: var(--rouge);
}

.bouton-danger:hover {
  color: var(--blanc);
  background: var(--rouge);
  border-color: var(--rouge);
}

.bouton-petit {
  font-size: 0.92rem;
  padding: 0.4rem 0.75rem;
}

/* Messages */

.message {
  border-left: 4px solid var(--bleu-moyen);
  background: var(--brume);
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
}

.message p:last-child,
.message ul:last-child {
  margin-bottom: 0;
}

.message ul {
  margin: 0;
  padding-left: 1.2rem;
}

.message-erreur {
  border-color: var(--rouge);
  background: var(--rouge-fond);
  color: #6d1712;
}

.message-succes {
  border-color: var(--vert);
  background: var(--vert-fond);
  color: #114a2f;
}

.message-alerte {
  border-color: #c98a00;
  background: var(--ambre-fond);
  color: #5c3c00;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
