:root {
  color-scheme: light;
  --fond: #f7f0e1;
  --surface: #fffaf0;
  --encre: #33202b;
  --prune: #4a2f3e;
  --corail: #a83c25;
  --corail-clair: #e88f74;
  --sarcelle: #20645b;
  --sarcelle-sombre: #15463f;
  --bordure: #d8c9ae;
  --danger-fond: #fff0e8;
  --succes-fond: #e6f2ed;
  --rayon: 0.8rem;
  --ombre: 0 0.2rem 1.1rem rgb(51 32 43 / 10%);
  --cible: 44px;
}

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

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--fond);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--fond);
  color: var(--encre);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
  color: inherit;
}

button,
select,
input[type="date"],
input[type="file"]::file-selector-button {
  min-height: var(--cible);
}

button,
input[type="file"]::file-selector-button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--sarcelle);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
ul,
dl {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 8vw, 3.4rem);
}

h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.45rem, 5.5vw, 2rem);
}

h3 {
  margin-bottom: 0.7rem;
  font-size: 1.2rem;
}

p,
li,
dd,
label,
button {
  overflow-wrap: anywhere;
}

code {
  font-size: 0.92em;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.5rem;
  left: 0.5rem;
  min-height: var(--cible);
  padding: 0.65rem 1rem;
  transform: translateY(-150%);
  border-radius: 0.5rem;
  background: var(--prune);
  color: #fffaf0;
}

.skip-link:focus {
  transform: translateY(0);
}

.btn-masquer {
  position: fixed;
  z-index: 10;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--corail-clair);
  border-radius: 999px;
  background: var(--prune);
  color: #fffaf0;
  font-weight: 700;
  box-shadow: 0 0.15rem 0.6rem rgb(0 0 0 / 18%);
}

.entete,
main,
footer {
  width: min(100% - 2rem, 48rem);
  margin-inline: auto;
}

.entete {
  padding-top: max(5.5rem, calc(env(safe-area-inset-top) + 5rem));
  padding-bottom: 1.25rem;
}

.entete > p:last-child {
  max-width: 55ch;
  margin-bottom: 0;
}

.mot-signe,
.sur-titre {
  margin-bottom: 0.35rem;
  color: var(--corail);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

main {
  padding-bottom: 1rem;
}

.carte {
  min-width: 0;
  margin-bottom: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}

.label-fichier,
.champ > label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 750;
}

input[type="file"] {
  display: block;
  width: 100%;
  min-height: var(--cible);
  padding: 0.35rem;
  border: 1px solid var(--bordure);
  border-radius: 0.55rem;
  background: #fff;
}

input[type="file"]::file-selector-button {
  margin-right: 0.65rem;
  padding: 0.45rem 0.8rem;
  border: 0;
  border-radius: 0.45rem;
  background: var(--prune);
  color: #fffaf0;
  font-weight: 700;
}

.statut {
  min-height: 1.6em;
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-weight: 650;
}

.statut-erreur,
.statut-succes {
  padding: 0.65rem 0.75rem;
  border-left: 0.3rem solid;
  border-radius: 0.35rem;
}

.statut-erreur {
  border-color: var(--corail);
  background: var(--danger-fond);
}

.statut-succes {
  border-color: var(--sarcelle);
  background: var(--succes-fond);
}

.avertissement {
  padding: 0.85rem;
  border: 2px solid var(--corail);
  border-radius: 0.55rem;
  background: var(--danger-fond);
}

.limite-bureau {
  padding: 0.8rem;
  border-left: 0.35rem solid var(--corail);
  border-radius: 0.4rem;
  background: var(--danger-fond);
}

.liste-relais {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-bureau-relais,
.carte-bureau-relais {
  min-width: 0;
}

.carte-bureau-relais {
  padding: 0.95rem;
  border: 1px solid var(--bordure);
  border-left: 0.35rem solid var(--sarcelle);
  border-radius: 0.55rem;
  background: #fff;
}

.meta-bureau-relais,
.resume-bureau-relais {
  margin-bottom: 0.65rem;
}

.meta-bureau-relais {
  color: #654f59;
  font-size: 0.92rem;
}

.etat-bureau-relais {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  margin: 0 0 0.7rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: #f7f0e1;
  color: var(--prune);
  font-size: 0.9rem;
  font-weight: 750;
}

.carte-bureau-relais[data-etat="brouillon"] {
  border-left-color: var(--corail);
}

.carte-bureau-relais[data-etat="apercu"] {
  border-left-color: var(--sarcelle-sombre);
}

.bouton-bureau-relais {
  width: 100%;
  min-height: var(--cible);
  padding: 0.65rem 0.9rem;
  border-radius: 0.55rem;
  font-weight: 750;
}

.sections-relais {
  display: grid;
  gap: 0.85rem;
}

.section-relais {
  min-width: 0;
  padding: 0.9rem;
  border-left: 0.35rem solid var(--sarcelle);
  border-radius: 0.4rem;
  background: #fff;
}

.section-relais ul {
  margin-bottom: 0;
  padding-left: 1.35rem;
}

.section-relais li + li {
  margin-top: 0.45rem;
}

.champ + .champ {
  margin-top: 1.1rem;
}

textarea,
select,
input[type="date"] {
  width: 100%;
  border: 1px solid #856f78;
  border-radius: 0.5rem;
  background: #fff;
}

textarea {
  min-height: 7rem;
  padding: 0.7rem;
  resize: vertical;
}

select,
input[type="date"] {
  padding: 0.55rem 0.65rem;
}

.facultatif,
.aide-champ,
.note-locale {
  color: #654f59;
  font-size: 0.92rem;
}

.aide-champ {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.actions-formulaire,
.actions-sortie {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.actions-formulaire button,
.actions-sortie button {
  width: 100%;
  min-height: var(--cible);
  padding: 0.65rem 0.9rem;
  border-radius: 0.55rem;
  font-weight: 750;
}

.action-primaire {
  border: 2px solid var(--prune);
  background: var(--prune);
  color: #fffaf0;
}

.action-primaire:hover {
  background: #33202b;
}

.action-secondaire {
  border: 2px solid var(--sarcelle-sombre);
  background: transparent;
  color: var(--sarcelle-sombre);
}

.action-secondaire:hover {
  background: var(--succes-fond);
}

.contenu-apercu {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
}

.contenu-apercu dt {
  margin-top: 0.75rem;
  font-weight: 800;
}

.contenu-apercu dd {
  margin: 0;
  padding: 0.7rem;
  border-radius: 0.4rem;
  background: #fff;
  white-space: pre-wrap;
}

footer {
  padding-top: 0.5rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  color: #654f59;
  font-size: 0.92rem;
}

.mode-neutre {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #f4f1ea;
  color: #282523;
}

.ecran-neutre {
  width: min(100%, 36rem);
  padding: 1.25rem;
  border: 1px solid #d5d0c7;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: none;
}

.ecran-neutre h1 {
  font-size: clamp(1.7rem, 7vw, 2.4rem);
}

@media (min-width: 38rem) {
  .carte {
    padding: 1.5rem;
  }

  .actions-formulaire,
  .actions-sortie {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
