/* Transfert — mise en page propre au site. Les composants viennent de pupitre.css. */

@font-face {
  font-family: "Sofia Sans Extra Condensed";
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url("fonts/sofia-sans-extra-condensed-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/rubik-latin.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { overflow-x: clip; }

.page { max-width: 980px; margin: 0 auto; padding-inline: var(--espace-4); display: grid; gap: var(--espace-8); }
.pp-barre { max-width: 980px; margin: 0 auto; }
.pp-barre > span { color: var(--encre-2); font-weight: 600; }
.pp-entete__nom { font-size: clamp(72px, 21vw, 220px); }

.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: var(--espace-3) var(--espace-4); align-items: center; }
.note { margin: 0; max-width: var(--largeur-texte); font-size: 14px; line-height: 20px; color: var(--encre-2); }

/* ---------- Connexion ---------- */
.connexion { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--espace-4); }
.connexion .pp-champ { flex: 1 1 280px; max-width: 460px; }
.connexion .pp-touche { margin-top: 24px; }

/* ---------- Dépôt ---------- */
.depot {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--espace-2);
  padding: var(--espace-8) var(--espace-4);
  border: 3px dashed var(--encre);
  border-radius: var(--rayon-l);
  background: var(--fond);
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms;
}
.depot:hover, .depot--survol { border-style: solid; background: var(--citron); color: var(--sur-citron); }
.depot--survol { border-color: var(--rouge); }
.depot:focus-within { outline: 3px solid var(--rouge); outline-offset: 3px; }
.depot__objet { width: 120px; height: auto; transition: transform 200ms ease-out; }
.depot:hover .depot__objet, .depot--survol .depot__objet { transform: translateY(-8px) rotate(-6deg); }
.depot__titre { font: 900 48px/.9 var(--font-affiche); text-transform: uppercase; }
.depot__aide { font-size: 15px; line-height: 22px; }

/* ---------- Progression ---------- */
.pp-jauge { height: 20px; }
#progNom { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Fichier en attente ---------- */
.fichier { display: grid; gap: var(--espace-1); min-width: 0; }
.fichier__nom { margin: 0; font: 700 28px/34px var(--font-texte); overflow-wrap: anywhere; }
.fichier__infos { margin: 0; font-size: 15px; line-height: 22px; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.pp-touche--danger[data-confirmer] { background: var(--rouge); color: var(--sur-rouge); }

/* ---------- Texte ---------- */
.texte { display: grid; gap: var(--espace-4); min-width: 0; }
.texte .pp-champ textarea { min-height: 96px; resize: vertical; font-family: var(--font-code); font-size: 15px; line-height: 22px; }
.texte__contenu {
  margin: 0;
  max-height: 264px;
  overflow: auto;
  padding: 14px 20px;
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon-m);
  background: var(--blanc);
  color: var(--encre);
  font: 500 15px/22px var(--font-code);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.texte .fichier__infos { margin-top: calc(-1 * var(--espace-2)); }
@media (pointer: coarse) { .raccourci { display: none; } } /* pas de clavier physique */

/* ---------- Calculatrice : la saisie à gauche, les résultats en face, ligne à ligne ---------- */
.calcul {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon-m);
  background: var(--blanc);
  overflow: hidden;
}
.calcul:focus-within { outline: 3px solid var(--rouge); outline-offset: 3px; }
.calcul__saisie {
  display: block;
  width: 100%;
  min-height: calc(7 * 24px + 28px);
  margin: 0;
  padding: 14px 16px 14px 20px;
  border: 0;
  background: transparent;
  color: var(--encre);
  font: 500 16px/24px var(--font-code); /* 16 px : pas de zoom à la saisie sur iPhone */
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
  resize: none;
  tab-size: 4;
}
.calcul__saisie:focus-visible { outline: none; }
.calcul__saisie::placeholder { color: var(--encre-2); opacity: .7; }
.calcul__resultats {
  min-width: 4ch;
  max-width: min(45vw, 24rem);
  margin: 0;
  padding: 14px 16px 14px 12px;
  border-left: 2px dashed color-mix(in srgb, var(--encre) 25%, transparent);
  list-style: none;
}
.calcul__resultats li { height: 24px; overflow: hidden; text-align: right; white-space: nowrap; text-overflow: ellipsis; }
.calcul__valeur {
  padding: 0 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--rouge-texte);
  font: 700 16px/24px var(--font-code);
  white-space: nowrap;
  cursor: copy;
}
.calcul__valeur:hover { background: var(--citron); color: var(--sur-citron); }
.calcul__conflit { display: grid; gap: var(--espace-3); padding: var(--espace-4); border-radius: var(--rayon-m); background: var(--citron); color: var(--sur-citron); }
.calcul__conflit p { margin: 0; font-weight: 600; }
.calcul__aide { max-width: var(--largeur-texte); font-size: 14px; line-height: 20px; }
.calcul__aide summary { cursor: pointer; font-weight: 700; }
.calcul__aide dl { display: grid; gap: var(--espace-2); margin: var(--espace-3) 0 0; }
.calcul__aide dt { font-weight: 600; }
.calcul__aide dd { margin: 0 0 var(--espace-1); color: var(--encre-2); }
.calcul__aide code { font: 500 13px/20px var(--font-code); white-space: nowrap; }

/* ---------- Pied et message ---------- */
.pied { max-width: var(--largeur-texte); font-size: 14px; line-height: 20px; color: var(--encre-2); }
.pied p { margin: 0; }
.message { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 10; width: max-content; transform: translateX(-50%); max-width: calc(100% - 32px); }

@media (max-width: 640px) {
  .depot { padding: var(--espace-6) var(--espace-4); }
  .depot__titre { font-size: 40px; }
  .fichier__nom { font-size: 22px; line-height: 28px; }
  .connexion .pp-touche { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .depot, .depot__objet { transition: none; } }
