/* ==========================================================================
   Breaksheet — pages du serveur
   Couleurs reprises de la breaksheet : encre du bandeau, bleu des blocs,
   jaune "a remplir au stylo" pour ce qui demande un oeil, rose pour une erreur.
   ========================================================================== */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  --encre: #1F3864;
  --encre-fonce: #172B4E;
  --bleu: #2E75B6;
  --fond: #EEF2F7;
  --papier: #FFFFFF;
  --texte: #1B2A4A;
  --texte-2: #4A5A78;
  --trait: #C6D0E0;
  --stylo: #FFF2CC;
  --stylo-trait: #E3C565;
  --erreur: #F4CCCC;
  --erreur-trait: #D98C8C;
  --titre: "Barlow Semi Condensed", "Barlow", "Arial Narrow", sans-serif;
  --police: "Barlow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 400 1rem/1.5 var(--police);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* Colonne de lecture centree ; seule la feuille d'apercu prend plus de largeur. */
.page { max-width: 76rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; }
.colonne { max-width: 51rem; margin: 0 auto; }
.colonne.etroite { max-width: 30rem; }

/* --- Compte --- */
.compte {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 1rem;
  min-height: 1.5rem;
  font-size: 0.9rem;
  color: var(--texte-2);
}

/* --- En-tete --- */
.entete { margin-top: 1.5rem; }
.entete h1 {
  font-family: var(--titre);
  font-weight: 600;
  font-size: clamp(2.25rem, 11vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  color: var(--encre);
  margin: 0 0 0.75rem;
}
.entete p { margin: 0; max-width: 34em; font-size: 1.125rem; color: var(--texte-2); }

/* --- Boutons et champs --- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0 1.25rem;
  border: 1px solid var(--encre);
  border-radius: 0.375rem;
  background: var(--papier);
  color: var(--encre);
  font: 600 1rem/1.2 var(--police);
  cursor: pointer;
  text-align: center;
}
.bouton.principal { background: var(--encre); color: #FFFFFF; }
.bouton.principal:hover { background: var(--encre-fonce); border-color: var(--encre-fonce); }
.bouton.large { width: 100%; }
.bouton:disabled { opacity: 0.6; cursor: progress; }
.lien {
  padding: 0;
  border: none;
  background: none;
  color: var(--bleu);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.bouton:focus-visible, .lien:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--bleu);
  outline-offset: 2px;
}

label.champ { display: block; margin: 1.25rem 0 0.35rem; font-size: 0.95rem; font-weight: 500; }
select, input[type="email"], input[type="text"] {
  width: 100%;
  min-height: 2.875rem;
  padding: 0 0.75rem;
  border: 1px solid var(--trait);
  border-radius: 0.375rem;
  background: var(--papier);
  color: var(--texte);
  font: 400 1rem var(--police);
}
input.code { font-size: 1.5rem; letter-spacing: 0.35em; font-variant-numeric: tabular-nums; }

/* --- Import : la zone de depot est l'action principale --- */
.depot {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
  padding: 1.5rem;
  background: var(--papier);
  border: 2px dashed var(--trait);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.depot:hover, .depot.survol { border-color: var(--bleu); }
.depot.survol { background: #F5F8FC; }
.depot:focus-within { outline: 3px solid var(--bleu); outline-offset: 2px; }
.depot input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.depot .consigne { color: var(--texte-2); font-size: 0.95rem; }
.depot .nom-fichier {
  flex-basis: 100%;
  font-size: 0.9rem;
  color: var(--texte);
}

/* --- Etat et messages --- */
.statut { min-height: 1.5em; margin: 1rem 0 0; color: var(--texte-2); }
.statut.en-cours::before {
  content: "";
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-right: 0.5em;
  vertical-align: -0.12em;
  border: 2px solid var(--trait);
  border-top-color: var(--encre);
  border-radius: 50%;
  animation: tourne 0.8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

.message {
  margin: 1rem 0 0;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--erreur-trait);
  border-radius: 0 0.375rem 0.375rem 0;
  background: var(--erreur);
}
.message.info { background: var(--stylo); border-left-color: var(--stylo-trait); }
.message strong { display: block; font-size: 1.05rem; margin-bottom: 0.2rem; }
.message p { margin: 0; line-height: 1.45; }

/* --- Resultat --- */
.resultat { margin-top: 2rem; }
.resultat h2 {
  font-family: var(--titre);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--encre);
  margin: 0 0 0.3rem;
}
.resultat .effectif { margin: 0; font-size: 1.05rem; color: var(--texte-2); }
.resultat .bouton.large { margin-top: 1.25rem; }
.fichier { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--texte-2); }

details.points {
  margin-top: 1.25rem;
  background: var(--stylo);
  border: 1px solid var(--stylo-trait);
  border-radius: 0.375rem;
}
details.points summary { padding: 0.7rem 1rem; font-weight: 600; cursor: pointer; }
details.points summary:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.alertes { margin: 0; padding: 0 1rem 1rem 1.5rem; list-style: none; }
.alertes > li + li { margin-top: 0.8rem; }
.alertes .jour { font-weight: 600; color: var(--encre); }
.alertes ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.alertes ul li { margin: 0.15rem 0; line-height: 1.4; }

/* --- Apercu : la feuille telle qu'elle sortira de l'imprimante --- */
.apercu { margin-top: 2.25rem; }
.apercu h2 {
  font-family: var(--titre);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--encre);
  margin: 0 0 0.75rem;
}
.apercu-onglets {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  border-bottom: 2px solid var(--encre);
  scrollbar-width: thin;
}
.apercu-onglets button {
  flex: none;
  padding: 0.45rem 0.8rem 0.4rem;
  border: 1px solid var(--trait);
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
  background: var(--papier);
  color: var(--encre);
  font: 500 0.95rem var(--titre);
  white-space: nowrap;
  cursor: pointer;
}
.apercu-onglets button:hover { border-color: var(--bleu); }
.apercu-onglets button[aria-selected="true"] { background: var(--encre); border-color: var(--encre); color: #FFFFFF; }
.apercu-onglets button:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

.feuille {
  padding: 1.25rem;
  overflow-x: auto;
  background: var(--papier);
  box-shadow: 0 1px 2px rgba(31, 56, 100, 0.14), 0 10px 28px rgba(31, 56, 100, 0.10);
}

/* Le tableau reprend la police et les proportions de l'impression (ajuste par app.js). */
table.bs {
  width: 100%;
  min-width: 40rem;
  table-layout: fixed;
  border-collapse: collapse;
  font: 12px/1.2 Arial, "Liberation Sans", Helvetica, sans-serif;
  color: #000000;
}
table.bs td {
  padding: 0 0.2em;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.bs td.w { white-space: normal; }
table.bs td.b { border: 1px solid #808080; }

.pied { margin-top: 3rem; font-size: 0.85rem; color: var(--texte-2); }

@media (max-width: 40rem) {
  .page { padding: 1.25rem 1rem 2rem; }
  .depot { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

form .bouton.large { margin-top: 1rem; }
