/* Transfert Facile : une enveloppe « par avion ». Le bord rayé est le seul élément voyant ; le reste reste calme. */
@font-face {
  font-family: 'Archivo';
  src: url('/polices/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  --papier: #f3f5f8;
  --enveloppe: #ffffff;
  --encre: #18233a;
  --encre-douce: #556178;
  --rouge: #c8302c;
  --bleu: #234b9b;
  --trait: #c9d1dd;
  --ok: #1f6b45;
}
* { box-sizing: border-box; }
html { background: var(--papier); color: var(--encre); }
body {
  margin: 0; min-height: 100vh;
  font: 400 1.0625rem/1.55 'Archivo', system-ui, sans-serif;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(1rem, 4vw, 3.5rem) 1rem 2rem;
}
a { color: var(--bleu); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

.enveloppe {
  width: min(42rem, 100%);
  background: var(--enveloppe);
  border: 12px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--rouge) 0 14px, var(--enveloppe) 14px 22px, var(--bleu) 22px 36px, var(--enveloppe) 36px 44px) 12;
  box-shadow: 0 1px 0 var(--trait), 0 18px 40px -24px rgba(24, 35, 58, .35);
}
.dedans { padding: clamp(1.25rem, 4vw, 2.5rem); }

.tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
h1 {
  margin: 0; font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.05;
  font-weight: 800; font-stretch: 118%; letter-spacing: -.01em;
}
.sous { margin: .35rem 0 1.75rem; color: var(--encre-douce); max-width: 34em; }
.langue { font-size: .875rem; white-space: nowrap; padding-top: .4rem; }
.langue a { text-decoration: none; padding: .15rem .3rem; }
.langue a[aria-current] { color: var(--encre); font-weight: 700; text-decoration: underline; }

h2 { font-size: 1.5rem; font-stretch: 112%; font-weight: 750; margin: 0 0 .5rem; line-height: 1.15; }

/* Zone de dépôt */
.depot {
  border: 2px dashed var(--trait); padding: 1.75rem 1rem; text-align: center;
  transition: border-color .15s, background-color .15s;
}
.depot.survol { border-color: var(--bleu); background: #eef3fc; }
.depot p { margin: 0 0 1rem; font-size: 1.125rem; }
.boutons { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }

button, .bouton {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 2px solid var(--encre); background: var(--enveloppe); color: var(--encre);
  padding: .55rem 1rem; border-radius: 3px; text-decoration: none; display: inline-block;
}
button:hover, .bouton:hover { background: #e9edf3; }
button:disabled { opacity: .5; cursor: not-allowed; }
.principal {
  width: 100%; margin-top: 1.5rem; padding: .9rem 1rem; font-size: 1.125rem;
  background: var(--bleu); border-color: var(--bleu); color: #fff;
}
.principal:hover { background: #1b3c7e; }
.discret { border-color: transparent; background: none; color: var(--bleu); padding: .3rem .4rem; text-decoration: underline; }
.discret:hover { background: none; color: var(--encre); }

/* Liste des fichiers */
.fichiers { list-style: none; margin: 1rem 0 0; padding: 0; max-height: 16rem; overflow: auto; }
.fichiers li { display: flex; align-items: center; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid #e4e8ee; }
.fichiers .nom { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fichiers .taille { color: var(--encre-douce); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .9375rem; }
.fichiers button { padding: .1rem .5rem; border-width: 1px; font-size: .875rem; }
.total { margin: .6rem 0 0; color: var(--encre-douce); font-size: .9375rem; }

/* Réglages */
fieldset { border: 0; margin: 1.5rem 0 0; padding: 0; }
legend, label.titre { font-weight: 650; display: block; margin-bottom: .45rem; padding: 0; }
.jours { display: flex; flex-wrap: wrap; }
.jours input { position: absolute; opacity: 0; pointer-events: none; }
.jours label {
  border: 2px solid var(--encre); margin-right: -2px; padding: .45rem .9rem; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.jours label:first-of-type { border-radius: 3px 0 0 3px; }
.jours label:last-of-type { border-radius: 0 3px 3px 0; }
.jours input:checked + label { background: var(--encre); color: #fff; }
.jours input:focus-visible + label { outline: 3px solid var(--bleu); outline-offset: 2px; position: relative; }
.champ { margin-top: 1.25rem; }
input[type=text], input[type=password], textarea {
  font: inherit; width: 100%; padding: .55rem .7rem; border: 2px solid var(--trait); border-radius: 3px; background: #fff; color: var(--encre);
}
input[type=text]:focus, input[type=password]:focus, textarea:focus { border-color: var(--bleu); outline: none; }
textarea { min-height: 5.5rem; resize: vertical; }
.aide { font-size: .875rem; color: var(--encre-douce); margin: .3rem 0 0; }
.robot { margin-top: 1.25rem; min-height: 65px; }

/* Progression */
.progression { margin-top: 1.5rem; }
.barre { height: 14px; border: 2px solid var(--encre); border-radius: 3px; overflow: hidden; background: #fff; }
.barre > div { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--bleu) 0 10px, #2f5cb3 10px 20px); transition: width .3s; }
.etat { display: flex; justify-content: space-between; gap: 1rem; margin-top: .5rem; font-variant-numeric: tabular-nums; color: var(--encre-douce); font-size: .9375rem; }

/* Résultat : le bordereau */
.bordereau { border: 2px solid var(--encre); padding: 1.25rem; margin-top: 1rem; display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; align-items: start; }
.bordereau .lien { display: flex; gap: .5rem; margin-top: .4rem; }
.bordereau .lien input { font-size: .9375rem; }
.qr { width: 132px; height: 132px; }
.qr svg { width: 100%; height: 100%; display: block; }
.timbre {
  display: inline-block; margin-top: .9rem; padding: .35rem .7rem; border: 2px solid var(--rouge); color: var(--rouge);
  font-weight: 700; font-stretch: 112%; transform: rotate(-2deg); font-variant-numeric: tabular-nums;
}
.attention { border-left: 4px solid var(--rouge); padding: .6rem .9rem; background: #fbeeee; margin-top: 1.25rem; }
.attention p { margin: 0 0 .4rem; }

.erreur { color: var(--rouge); font-weight: 600; margin: 1rem 0 0; }
.reussi { color: var(--ok); font-weight: 600; }
[hidden] { display: none !important; }

.pied { width: min(42rem, 100%); margin-top: 1.5rem; font-size: .875rem; color: var(--encre-douce); text-align: center; }
.pied p { margin: .3rem 0; }

/* Page de réception */
.message-recu { white-space: pre-wrap; border-left: 4px solid var(--bleu); padding: .5rem .9rem; background: #f0f4fb; margin: 1rem 0 0; }
.fichiers .telecharger { border-width: 2px; font-size: .9375rem; padding: .25rem .7rem; }

@media (max-width: 34rem) {
  .bordereau { grid-template-columns: 1fr; }
  .qr { justify-self: center; }
  .jours label { padding: .45rem .7rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
