/* facture-electronique — "pièce comptable sur établi vert" */

/* ---------- hero : colonne centrale étroite + deux pièces en vis-à-vis ---------- */
.hero{padding:56px 0 48px;}
.hero-intro{max-width:620px;margin:0 auto 40px;text-align:center;}

.citation-client{font-family:"Literata",serif;font-style:italic;font-size:18px;color:var(--line);
  border-left:2px solid var(--accent);padding-left:16px;margin:0 auto 22px;max-width:46ch;text-align:left;}
.citation-client cite{display:block;font-style:normal;font-size:12.5px;margin-top:7px;color:var(--line);opacity:.8;font-family:"Archivo Narrow";letter-spacing:.01em;}

.hero-h1{font-size:clamp(32px,5vw,52px);max-width:16ch;margin:0 auto 16px;color:var(--paper);}
.hero-chapo{font-size:16.5px;line-height:1.65;max-width:54ch;margin:0 auto 26px;color:var(--line);}
.hero-cta-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:center;}
.hero-stats{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;}
.hero-stat{background:color-mix(in srgb, var(--paper) 10%, transparent);border:1px solid color-mix(in srgb, var(--paper) 25%, transparent);border-radius:var(--radius-doc);padding:10px 16px;min-width:126px;}
.hero-stat b{display:block;font-family:"Archivo Narrow";font-weight:700;font-size:23px;color:var(--paper);}
.hero-stat span{font-size:12px;color:var(--line);font-family:"Archivo Narrow";}

/* entrée orchestrée du héros (texte) */
.entree-orchestree{opacity:0;transform:translateY(24px);animation:fade-up 650ms var(--ease) forwards;}
.entree-orchestree.d1{animation-delay:80ms;}
.entree-orchestree.d2{animation-delay:160ms;}
@keyframes fade-up{to{opacity:1;transform:translateY(0);}}

/* ---------- les deux pièces : facture (gauche) / journal d'envoi (droite) ---------- */
.hero-pieces{display:grid;grid-template-columns:.82fr 1.18fr;gap:34px;align-items:start;max-width:1080px;margin:0 auto;}
@media (max-width:860px){.hero-pieces{grid-template-columns:1fr;gap:28px;}}

.entree-piece{opacity:0;animation:pose-piece 700ms var(--ease) forwards;}
.piece-facture.entree-piece{animation-delay:200ms;}
.piece-journal .entree-piece,.piece-journal.entree-piece{animation-delay:280ms;}
@keyframes pose-piece{from{opacity:0;transform:translateY(22px) rotate(0deg) scale(.98);}to{opacity:1;transform:translateY(0) rotate(var(--rot,0deg)) scale(1);}}

/* ---- pièce 1 : la facture ---- */
.piece-facture{
  --rot:-2.4deg;
  position:relative;margin:0;padding:22px 22px 26px;border-radius:var(--radius-doc);
  border:1px solid var(--line);box-shadow:0 14px 20px -12px rgba(0,0,0,.55), 0 2px 0 rgba(0,0,0,.08);
  transform:rotate(var(--rot));
}
@media (max-width:860px){.piece-facture{--rot:0deg;}}
.facture-entete{display:flex;align-items:baseline;justify-content:space-between;gap:10px;border-bottom:1.5px solid var(--ink);padding-bottom:12px;margin-bottom:16px;}
.facture-marque{font-family:"Literata";font-weight:700;font-size:16px;}
.facture-mention{font-family:"Archivo Narrow";font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);}
.facture-corps{margin:0;}
.facture-ligne{display:flex;justify-content:space-between;gap:12px;margin:0 0 9px;font-family:"Archivo Narrow";font-size:13.5px;border-bottom:1px dashed var(--line);padding-bottom:7px;}
.facture-ligne dt{color:var(--muted);font-weight:500;}
.facture-ligne dd{margin:0;font-weight:600;font-variant-numeric:tabular-nums;}
.facture-photo{margin:16px -4px 6px;border-radius:2px;overflow:hidden;position:relative;transform:rotate(1.6deg);box-shadow:0 8px 12px -8px rgba(0,0,0,.45);max-width:170px;}
.facture-photo img{width:100%;height:150px;object-fit:cover;object-position:50% 30%;}
.piece-facture .credit{display:block;font-size:12px;color:var(--muted);font-family:"Archivo Narrow";margin-top:4px;}

/* ---- élément signature : le tampon « Transmis » ---- */
.tampon-transmis{
  position:absolute;top:38%;right:14px;
  font-family:"Archivo Narrow",sans-serif;font-weight:700;font-size:21px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--sig-err);border:3px solid var(--sig-err);border-radius:8px;padding:6px 14px 7px;
  transform:rotate(-9deg) scale(1.5);opacity:0;pointer-events:none;
  mix-blend-mode:multiply;
}
.tampon-transmis::after{content:"";position:absolute;inset:3px;border:1px solid var(--sig-err);border-radius:5px;opacity:.6;}
.tampon-transmis.impact{animation:tampon-impact var(--dur-impact) var(--ease-impact) forwards;}
@keyframes tampon-impact{
  0%{opacity:0;transform:rotate(-9deg) scale(1.9);}
  55%{opacity:1;transform:rotate(-9deg) scale(.92);}
  75%{transform:rotate(-9deg) scale(1.04);}
  100%{opacity:1;transform:rotate(-9deg) scale(1);}
}
@media (prefers-reduced-motion: reduce){
  .tampon-transmis.impact{opacity:1;transform:rotate(-9deg) scale(1);animation:none;}
}

/* ---- pièce 2 : le journal d'envoi (schéma de flux existant, redocumenté) ---- */
.piece-journal{--rot:1deg;transform:rotate(var(--rot));}
@media (max-width:860px){.piece-journal{--rot:0deg;}}
.flux{border:1px solid var(--line);border-radius:var(--radius-doc);overflow:hidden;box-shadow:0 14px 22px -12px rgba(0,0,0,.5);}
.flux-entete{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:16px 18px;border-bottom:1px solid var(--line);}
.flux-entete h2{font-size:15.5px;font-family:"Literata";font-weight:600;margin:0;}
.flux-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.flux-svg-zone{padding:8px 4px 0;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.flux-svg-zone svg{display:block;min-width:620px;}
.flux-noeud-rect{fill:var(--surface);stroke:var(--line);stroke-width:1.3;}
.flux-noeud-txt{font-family:"Archivo Narrow",sans-serif;font-weight:700;font-size:12.5px;fill:var(--ink);}
.flux-noeud-sub{font-family:"Archivo Narrow",sans-serif;font-weight:500;font-size:12px;fill:var(--muted);}
.flux-lien{fill:none;stroke:var(--line);stroke-width:1.6;stroke-dasharray:3 4;}
.flux-pastille{r:5;fill:var(--accent);}
.flux-pastille.err{fill:var(--sig-err);}
.flux-pastille.ok{fill:var(--sig-ok);}

.flux-bas{display:grid;grid-template-columns:1.15fr .85fr;gap:0;border-top:1px solid var(--line);}
@media (max-width:620px){.flux-bas{grid-template-columns:1fr;}}
.flux-journal{padding:14px 18px;border-right:1px solid var(--line);max-height:220px;overflow:auto;}
@media (max-width:620px){.flux-journal{border-right:none;border-bottom:1px solid var(--line);}}
.flux-journal h3,.flux-compteurs h3{font-family:"Archivo Narrow";font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--muted);margin:0 0 9px;}
.flux-journal ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:5px;font-size:12.6px;font-family:"Archivo Narrow";}
.flux-journal li{display:flex;gap:8px;align-items:flex-start;padding:4px 6px;border-radius:3px;opacity:0;animation:jrl-in var(--dur-move) var(--ease) forwards;}
@keyframes jrl-in{from{opacity:0;transform:translateY(-3px);}to{opacity:1;transform:translateY(0);}}
.flux-journal li time{color:var(--muted);font-variant-numeric:tabular-nums;flex:none;font-size:12px;padding-top:1px;}
.flux-journal li.err{background:var(--sig-err-bg);}
.flux-journal li.warn{background:var(--sig-warn-bg);}
.flux-compteurs{padding:14px 18px;display:flex;flex-direction:column;gap:10px;}
.flux-compt-grille{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.flux-compt{background:var(--surface-2);border:1px solid var(--line);border-radius:3px;padding:10px 12px;}
.flux-compt b{display:block;font-family:"Archivo Narrow";font-weight:700;font-size:21px;font-variant-numeric:tabular-nums;}
.flux-compt span{font-size:12px;color:var(--muted);font-family:"Archivo Narrow";}
.flux-compt.ok b{color:var(--sig-ok);}
.flux-compt.err b{color:var(--sig-err);}

/* ---------- erreur corrigeable ---------- */
.rejet{
  background:var(--sig-err-bg);border:1px solid #eec3ba;border-radius:3px;
  padding:12px 14px;display:flex;flex-direction:column;gap:8px;font-size:13px;font-family:"Archivo Narrow";color:var(--ink);
}
.rejet strong{color:var(--sig-err);}

/* ---------- bordereau : suivi des factures ---------- */
.section-tete{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:16px;}
.section-tete h2{font-size:23px;margin:0;color:var(--paper);font-family:"Literata";}
.section-tete p{margin:3px 0 0;font-size:13.5px;color:var(--line);}

.filtre-conf{display:flex;gap:6px;flex-wrap:wrap;}
.filtre-conf button{border:1px solid var(--line);background:var(--surface);border-radius:var(--radius-pill);padding:7px 13px;font-size:12px;font-weight:600;cursor:pointer;color:var(--muted);min-height:34px;font-family:"Archivo Narrow";}
.filtre-conf button.actif{background:var(--ink);color:var(--paper);border-color:var(--ink);}

.grille-factures{width:100%;border-collapse:collapse;font-size:13px;}
.grille-factures td,.grille-factures th{padding:10px 12px;}
.grille-factures tbody tr:hover{background:var(--surface-2);}
.mono{font-variant-numeric:tabular-nums;}

.statut-timeline{display:flex;align-items:center;gap:4px;font-size:11px;}
.statut-etape{width:9px;height:9px;border-radius:50%;background:var(--line);flex:none;}
.statut-etape.faite{background:var(--sig-ok);}
.statut-etape.actuelle{background:var(--ink);}
.statut-etape.rejet{background:var(--sig-err);}
.statut-trait{width:14px;height:1.5px;background:var(--line);}
.statut-trait.faite{background:var(--sig-ok);}

.badge-statut{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;padding:4px 9px;border-radius:var(--radius-pill);}
.badge-statut .pt{width:6px;height:6px;border-radius:50%;background:currentColor;}
.st-deposee{background:var(--surface-2);color:var(--muted);}
.st-recue{background:var(--sig-warn-bg);color:var(--sig-warn);}
.st-acceptee{background:var(--sig-ok-bg);color:var(--sig-ok);}
.st-refusee{background:var(--sig-err-bg);color:var(--sig-err);}
