/* Palette tirée des liasses autocopiantes du transport : papier blanc, copies rose, bleue et verte, carbone bleu-violet. */
:root {
  --carbone: #20276a;
  --carbone-clair: #323c96;
  --encre: #161b3d;
  --doux: #555c7d;
  --trait: #c8cee0;
  --voile: #f1f3f9;
  --papier: #fff;
  --rose: #f4c3cc;
  --bleu: #b9cff2;
  --vert: #bfe2cd;
  --rouge: #b3202c;
  --ambre: #d98200;
  --ok: #17694a;
  --titre: Bahnschrift, "DIN Alternate", "DIN 2014", "Roboto Condensed", "Arial Narrow", sans-serif;
  --texte: "Segoe UI", "Avenir Next", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font: 17px/1.6 var(--texte); }
.uni { white-space: nowrap; }
[hidden] { display: none !important; }
.cadre { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 28px; }
h1, h2, h3 { font-family: var(--titre); font-weight: 700; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.35rem); line-height: 1.12; }
h3 { font-size: 1.16rem; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--carbone-clair); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--carbone-clair); outline-offset: 3px; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.saut { position: absolute; left: 16px; top: -60px; background: #fff; padding: 10px 16px; z-index: 5; }
.saut:focus { top: 12px; }

/* Haut de page */
.haut { background: var(--carbone); color: #fff; overflow: hidden; }
.haut :focus-visible { outline-color: #fff; }
.haut .feuille :focus-visible { outline-color: var(--carbone-clair); }
.barre-haut { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 24px; padding-bottom: 24px; }
.marque { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font: 700 1.28rem/1 var(--titre); }
.marque svg { width: 34px; height: 34px; flex: none; }
.barre-haut nav { display: flex; gap: 28px; font-size: .96rem; }
.barre-haut nav a { color: #d9def6; text-decoration: none; padding: 10px 0; }
.barre-haut nav a:hover { color: #fff; text-decoration: underline; }
.accroche { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: center; padding-top: 44px; padding-bottom: 104px; }
.accroche h1 { font-size: clamp(2.3rem, 4.7vw, 3.75rem); line-height: 1.04; letter-spacing: -.01em; }
.accroche .resume { font-size: 1.14rem; margin-top: 24px; color: #e4e8fa; max-width: 34em; }
.gages { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; }
.gages li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; color: #fff; }
.gages svg { width: 20px; height: 20px; margin-top: 4px; }
.gages a { color: #fff; }

/* La liasse : une feuille blanche posée sur ses trois copies */
.liasse { position: relative; isolation: isolate; margin-right: 36px; }
.liasse::before, .liasse::after, .liasse > .copie { content: ""; position: absolute; inset: 0; z-index: -1; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.liasse::before { background: var(--rose); transform: translate(12px, 12px); }
.liasse > .copie { background: var(--bleu); transform: translate(24px, 24px); z-index: -2; }
.liasse::after { background: var(--vert); transform: translate(36px, 36px); z-index: -3; }
.feuille { background: var(--papier); color: var(--encre); border: 1px solid var(--trait); }
.titre-feuille { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 18px 22px 14px; }
.titre-feuille h2 { font-size: 1.3rem; }
.titre-feuille p { color: var(--doux); font-size: .9rem; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); margin: 0; }
.cases > div { display: flex; flex-direction: column; justify-content: space-between; padding: 10px 22px 12px; border-left: 1px solid var(--trait); }
.cases > div:first-child { border-left: 0; }
.cases dt { font-size: .82rem; color: var(--doux); line-height: 1.35; }
.cases dd { margin: 2px 0 0; font: 700 1.1rem/1.3 var(--titre); font-variant-numeric: tabular-nums; }
.saisie { padding: 18px 22px 22px; }
.saisie label { display: block; font-weight: 600; }
.saisie .aide { color: var(--doux); font-size: .92rem; margin-top: 2px; }
textarea { display: block; width: 100%; min-height: 148px; margin-top: 12px; padding: 12px 14px; border: 1px solid #8f98b8; border-radius: 3px; background: var(--voile); color: inherit; font: 1rem/1.6 var(--texte); font-variant-numeric: tabular-nums; resize: vertical; }
textarea::placeholder { color: #666d8c; opacity: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
button, .bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border: 1px solid var(--carbone); border-radius: 3px; background: var(--carbone); color: #fff; font: 600 1rem/1.2 var(--texte); text-decoration: none; cursor: pointer; }
button:hover, .bouton:hover { background: var(--carbone-clair); border-color: var(--carbone-clair); }
button.second { background: transparent; color: var(--carbone); }
button.second:hover { background: var(--voile); color: var(--carbone); border-color: var(--carbone); }
button:disabled { background: #7b81a8; border-color: #7b81a8; cursor: wait; }
.message { margin-top: 14px; font-size: .96rem; }
.message:empty { display: none; }
.message.erreur { color: var(--rouge); font-weight: 600; }

/* Le relevé */
.releve:focus { outline: none; }
.releve { padding: 72px 0 110px; background: var(--voile); }
.phrase { padding: 22px 22px 0; font: 700 clamp(1.3rem, 2.6vw, 1.75rem)/1.2 var(--titre); }
.note-feuille { padding: 8px 22px 0; color: var(--doux); font-size: .95rem; }
.tri { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 22px 22px; }
.tri button { min-height: 44px; padding: 8px 16px; gap: 10px; background: var(--papier); color: var(--encre); border-color: var(--trait); font-weight: 500; }
.tri button:hover { background: var(--voile); color: var(--encre); border-color: var(--carbone); }
.tri button[aria-pressed="true"] { border-color: var(--carbone); box-shadow: inset 0 0 0 1px var(--carbone); }
.tri b { font: 700 1.1rem/1 var(--titre); font-variant-numeric: tabular-nums; }
.signe { width: 18px; height: 18px; flex: none; }
.lignes { list-style: none; margin: 0; padding: 0; }
.lignes li { display: grid; grid-template-columns: 150px minmax(0, 4fr) minmax(0, 6fr); gap: 24px; padding: 16px 22px; border-top: 1px solid var(--trait); }
.etat { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .96rem; align-self: start; }
.nom { font-weight: 600; overflow-wrap: anywhere; display: block; }
.num { color: var(--doux); font-size: .92rem; font-variant-numeric: tabular-nums; }
.bas-feuille { border-top: 1px solid var(--trait); padding: 18px 22px 22px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.bas-feuille .actions { margin: 0; }
.bas-feuille p { color: var(--doux); font-size: .9rem; max-width: 46em; }
.releve .suite { margin-top: 84px; }

/* Sections */
section.bloc { padding: 96px 0; }
section.bloc + section.bloc { border-top: 1px solid var(--trait); }
.deux { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: start; }
.texte > * + * { margin-top: 18px; }
.texte p { max-width: 60ch; }
.barres { width: 100%; border-collapse: collapse; }
.barres caption { text-align: left; color: var(--doux); font-size: .95rem; padding-bottom: 14px; }
.barres th { text-align: left; font-weight: 500; padding: 10px 18px 10px 0; white-space: nowrap; width: 1%; }
.barres td { padding: 10px 0; }
.barres .trait { display: flex; align-items: center; gap: 12px; font: 700 1.25rem/1 var(--titre); font-variant-numeric: tabular-nums; }
.barres .trait i { display: block; height: 22px; background: var(--carbone-clair); border-radius: 0 4px 4px 0; }
.source { color: var(--doux); font-size: .9rem; margin-top: 18px; }
.controles { width: 100%; border-collapse: collapse; margin-top: 40px; }
.controles th, .controles td { text-align: left; vertical-align: top; padding: 18px 28px 18px 0; border-top: 1px solid var(--trait); }
.controles thead th { border-top: 0; padding-bottom: 10px; color: var(--doux); font-weight: 500; font-size: .92rem; }
.controles tbody th { font: 700 1.1rem/1.4 var(--titre); width: 24%; }
.limites { margin: 20px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 56px; }
.limites li { break-inside: avoid; padding: 0 0 14px 18px; position: relative; }
.limites li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 2px; background: var(--carbone-clair); }
.sous-titre { margin-top: 64px; }
.raisons { margin: 0; padding: 0; list-style: none; }
.raisons li { padding: 22px 0; border-top: 1px solid var(--trait); }
.raisons li:first-child { border-top: 0; padding-top: 0; }
.raisons p { color: var(--doux); margin-top: 6px; max-width: 60ch; }
.etapes { margin: 0; padding: 0; list-style: none; counter-reset: e; }
.etapes li { counter-increment: e; display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--trait); }
.etapes li:first-child { border-top: 0; padding-top: 0; }
.etapes li::before { content: counter(e); font: 700 1.9rem/1.1 var(--titre); color: var(--carbone-clair); }
.etapes p { color: var(--doux); }

/* Bas de page */
.pied { background: var(--carbone); color: #d9def6; padding: 56px 0 64px; font-size: .95rem; }
.pied a { color: #fff; }
.pied :focus-visible { outline-color: #fff; }
.pied .deux { gap: 48px 72px; }
.pied .marque { margin-bottom: 18px; }
.pied p + p { margin-top: 12px; }
.page-simple { padding: 64px 0 96px; }
.page-simple h1 { font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.1; margin-bottom: 32px; }
.page-simple h2 { font-size: 1.3rem; margin: 36px 0 8px; }
.page-simple p { max-width: 64ch; }
.page-simple p + p { margin-top: 12px; }

@media (max-width: 940px) {
  .accroche, .deux { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .accroche { padding-top: 16px; padding-bottom: 84px; }
  .liasse { margin-right: 28px; }
  section.bloc { padding: 68px 0; }
  .lignes li { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .limites { columns: 1; }
}
@media (max-width: 620px) {
  .cadre { padding-left: 20px; padding-right: 20px; }
  .barre-haut nav { display: none; }
  .titre-feuille, .phrase, .note-feuille, .tri, .saisie, .lignes li, .bas-feuille { padding-left: 16px; padding-right: 16px; }
  .titre-feuille { flex-direction: column; gap: 2px; }
  .cases > div { display: flex; flex-direction: column; justify-content: space-between; padding: 10px 8px 12px 16px; }
  .cases > div + div { padding-left: 10px; }
  .cases dd { font-size: 1rem; }
  .liasse { margin-right: 18px; }
  .liasse::before { transform: translate(6px, 6px); }
  .liasse > .copie { transform: translate(12px, 12px); }
  .liasse::after { transform: translate(18px, 18px); }
  .saisie .actions > * { flex: 1 1 100%; }
  .barres th { white-space: normal; width: 38%; }
  .controles, .controles tbody, .controles tr, .controles td, .controles tbody th { display: block; width: auto; }
  .controles thead { display: none; }
  .controles tbody th { padding-bottom: 4px; }
  .controles td { border-top: 0; padding: 0 0 10px; }
  .controles td::before { content: attr(data-titre) " : "; color: var(--doux); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .liasse::before, .liasse::after, .liasse > .copie { transition: none; }
}
@media print {
  @page { margin: 14mm; }
  body { font-size: 12px; }
  .haut, .pied, section.bloc, .suite, .bas-feuille .actions { display: none !important; }
  body.vide .haut { display: block !important; }
  .releve { padding: 0; background: none; }
  .cadre { padding: 0 1px; max-width: none; }
  .liasse { margin: 0; }
  .liasse::before, .liasse::after, .liasse > .copie { display: none; }
  .tri { gap: 4px 24px; padding-top: 10px; }
  .tri button { border: 0; padding: 0; min-height: 0; box-shadow: none !important; font-size: 12px; }
  .tri b { font-size: 13px; }
  .signe { width: 13px; height: 13px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .lignes li { break-inside: avoid; grid-template-columns: 110px 4fr 6fr; padding-top: 8px; padding-bottom: 8px; }
  .etat, .num, .nom, .titre-feuille p, .bas-feuille p { font-size: 12px; }
  .bas-feuille p::after { content: " Affréteur averti, affreteuraverti.fr"; }
}
