/* Héros de l'accueil : une vraie facture marocaine, posée sur la page réglée du carnet et annotée au stylo bleu.
   Chaque note montre une règle que Factu iA applique (numéro, ICE, TVA par ligne, montant en lettres, loi 69-21, cachet).
   La facture et les notes sont du texte HTML ; les cercles et les flèches sont tracés par heros.js. */
.heros { position: relative; background-color: var(--bureau); overflow: clip;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(201, 211, 239, .75) 31px 32px); }
.heros::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(236, 238, 243, 0), var(--bureau)); }
.heros__grille { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 56px; padding-block: 56px 72px; }

.heros h1 { margin: 0; font: 850 clamp(40px, 4.1vw, 58px)/1.04 var(--font-sans); letter-spacing: -.022em; text-wrap: balance; max-width: 13em; }
.heros h1 em { font-style: normal; color: var(--bic); }
.heros__chapo { margin: 24px 0 0; max-width: 33em; font-size: 19px; line-height: 1.55; color: var(--carbone-doux); }
.heros__chapo strong { color: var(--carbone); font-weight: 600; }
.heros__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }
.heros__actions .bouton { min-height: 54px; padding: 0 26px; font-size: 17px; }
.heros__whatsapp { display: inline-flex; align-items: center; gap: 10px; color: var(--carbone); text-decoration: none; font-size: 16px; line-height: 1.3; }
.heros__whatsapp svg { width: 26px; height: 26px; color: var(--encre-payee); flex: none; }
.heros__whatsapp strong { display: block; font: 600 17px/1.3 var(--font-mono); letter-spacing: .01em; }
.heros__whatsapp:hover span { text-decoration: underline; }
.heros__faits { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 32px 0 0; padding: 0; list-style: none; font-size: 15px; color: var(--carbone-doux); }
.heros__faits li { display: flex; align-items: center; gap: 8px; }
.heros__faits li::before { content: ""; width: 14px; height: 10px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M1.2 5.6 4.9 8.6 12.8 1.3' fill='none' stroke='%231f3fb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }

/* ── La scène : la feuille, la colonne des notes, et le calque des traits ── */
/* La scène a une largeur fixe par palier (la mesure de conteneur l'exige) ; les notes passent en liste numérotée sous 660 px. */
.heros__scene { margin: 0; container: scene / inline-size; width: 748px; }
.scene { --mode: fleches; --feuille: 468px; --notes: 236px; --ecart: 44px; position: relative; display: grid;
  grid-template-columns: var(--feuille) var(--notes); gap: var(--ecart); align-items: start; }
.scene__feuille { position: relative; container-type: inline-size; }
/* La copie carbone, glissée sous l'original (le carnet à souches) */
.scene__feuille::before { content: ""; position: absolute; inset: 10px -8px -10px 8px; border-radius: 3px; background: #dfe5f6;
  transform: rotate(1.6deg); box-shadow: var(--ombre-papier); }

.facture { position: relative; aspect-ratio: 210 / 297; display: flex; flex-direction: column; padding: 6.5cqi 6.5cqi 4.5cqi;
  background: var(--papier); border-radius: 3px; box-shadow: var(--ombre-soulevee); color: #20253b;
  font: 400 clamp(8.6px, 2.6cqi, 12.2px)/1.45 var(--font-sans); }
/* Le haut de la feuille garde la trace de la perforation du carnet */
.facture::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: 3px 3px 0 0;
  background: radial-gradient(circle at 50% 0, var(--bureau) 1.7px, transparent 2.2px) 0 0 / 9px 6px repeat-x; opacity: .9; }
.facture p { margin: 0; }
.facture .chiffre { font-size: .95em; }
.facture__haut { display: flex; justify-content: space-between; gap: 1.4em; }
.facture__societe { font-weight: 800; letter-spacing: .01em; font-size: 1.08em; color: #1d2340; }
.facture__emetteur p + p { color: #4a5070; }
.facture__doc { text-align: right; flex: none; }
.facture__type { font: 800 2.1em/1 var(--font-sans); letter-spacing: -.01em; color: #1d2340; margin-bottom: .45em !important; }
.facture__numero { display: inline-block; font-weight: 600; color: #1d2340; }
.facture__client { align-self: flex-end; width: 52%; margin-top: 1.5em; padding: .75em .95em; border: 1px solid #d6dae4; border-radius: 3px; }
.facture__client .petit { font-size: .85em; color: #4a5070; margin-bottom: .15em; }
.facture__ice { display: inline-block; }
.facture__lignes { width: 100%; margin-top: 2.1em; border-collapse: collapse; font-size: .96em; }
.facture__lignes th { padding: .55em .5em; background: #eef1f9; color: #1d2340; font-weight: 700; text-align: right; font-size: .92em; }
.facture__lignes th:first-child, .facture__lignes td:first-child { text-align: left; padding-left: .7em; }
.facture__lignes td { padding: .5em .5em; border-bottom: 1px solid #e3e6ee; text-align: right; font-family: var(--font-mono); font-size: .93em; white-space: nowrap; }
.facture__lignes td:first-child { font-family: var(--font-sans); font-size: 1em; white-space: normal; }
.facture__lignes .taux { display: inline-block; }
.facture__totaux { align-self: flex-end; width: 46%; margin-top: .9em; display: grid; grid-template-columns: 1fr auto; font-family: var(--font-mono); font-size: .95em; }
.facture__totaux dt, .facture__totaux dd { margin: 0; padding: .22em 0; }
.facture__totaux dd { text-align: right; }
.facture__totaux .net { margin-top: .3em; padding-top: .55em; border-top: 2px solid #1d2340; font: 700 1.12em/1.2 var(--font-sans); color: #1d2340; }
.facture__totaux dd.net { font-family: var(--font-mono); }
.facture__lettres { margin-top: 1.1em !important; font-style: italic; color: #1d2340; }
.facture__conditions { margin-top: .7em !important; color: #4a5070; }
.facture__signature { margin-top: auto; padding-top: 1.2em; display: flex; justify-content: flex-end; }
.facture__signature-zone { position: relative; width: 40%; text-align: center; color: #4a5070; font-size: .9em; }
.facture__cachet { display: block; width: 100%; height: auto; margin-top: .2em; transform: rotate(-4deg); }
.facture__pied { margin-top: 1em !important; padding-top: .7em; border-top: 1px solid #e3e6ee; text-align: center; font-size: .8em; color: #6a7090; }

/* Les notes au stylo bleu */
.scene__notes { position: relative; margin: 0; padding: 0; list-style: none; counter-reset: note; }
.scene__notes li { counter-increment: note; display: flex; gap: 10px; align-items: baseline; color: var(--bic);
  font: italic 600 17px/1.28 var(--font-sans); }
.scene__notes li + li { margin-top: 18px; }
.scene__notes li::before { content: counter(note); flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--bic); color: var(--on-bic); font: 600 13px/1 var(--font-mono); font-style: normal; transform: translateY(-1px); }
/* En attendant le stylo, les notes restent cachées (heros.js pose la classe, sauf avec « réduire les animations ») */
.scene--attente .scene__notes li { clip-path: inset(0 100% 0 0); }
/* Quand heros.js a placé les notes en face de leur cible (mode flèches), la pastille disparaît */
.scene--fleches .scene__notes li { position: absolute; left: 0; right: 0; margin: 0; }
.scene--fleches .scene__notes li::before { display: none; }
.scene--fleches .scene__notes li:nth-child(odd) { transform: rotate(-1.4deg); }
.scene--fleches .scene__notes li:nth-child(even) { transform: rotate(1deg); }
.scene__traits { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.scene__traits path { fill: none; stroke: var(--bic); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; opacity: .92; }
.scene__traits .pastille circle { fill: var(--bic); }
.scene__traits .pastille text { fill: var(--on-bic); font: 600 12px var(--font-mono); text-anchor: middle; dominant-baseline: central; }

/* ── Largeurs ── */
@media (max-width: 1439px) { .heros__scene { width: 660px; } .heros__grille { gap: 44px; } }
@media (max-width: 1279px) {
  .heros__grille { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-block: 48px 64px; }
  .heros h1 { max-width: 15em; }
  .heros__scene { justify-self: center; width: 100%; max-width: 748px; }
}
@container scene (max-width: 747px) {
  .scene { --feuille: 414px; --notes: 208px; --ecart: 36px; }
  .scene__notes li { font-size: 16px; }
}
@container scene (max-width: 659px) {
  .scene { --mode: numeros; grid-template-columns: minmax(0, 1fr); gap: 28px; justify-items: center; }
  .scene__feuille { width: min(100%, 468px); }
  .scene__notes { width: min(100%, 468px); display: grid; gap: 12px; }
  .scene__notes li { font-size: 16px; }
  .scene__notes li + li { margin-top: 0; }
}
@media (max-width: 760px) {
  .heros__grille { padding-block: 32px 48px; gap: 36px; }
  .heros h1 { font-size: clamp(34px, 9.4vw, 44px); line-height: 1.06; }
  .heros__chapo { font-size: 17px; margin-top: 18px; }
  .heros__actions { margin-top: 26px; gap: 18px; }
  .heros__actions .bouton { width: 100%; }
  .heros__faits { flex-direction: column; gap: 8px; margin-top: 24px; }
  .scene__feuille::before { inset: 8px -4px -8px 4px; }
}
