/* Styles communs des outils du hub (modules A, C et D). Toutes les couleurs passent par des
   variables --fe-* : la DA du hub les redéfinit sur :root ou sur le conteneur de l'outil.
   Aucune police externe, aucune image : rien n'est chargé depuis un autre domaine. */
fe-suis-je-concerne, fe-verificateur-facturx, fe-creer-facturx { display: block; }
.fe-outil {
  --fe-encre: #13233a;
  --fe-encre-douce: #4a5b70;
  --fe-fond: #ffffff;
  --fe-fond-doux: #f4f7fa;
  --fe-bordure: #d6dee8;
  --fe-accent: #0b6e69;
  --fe-accent-fonce: #084f4b;
  --fe-accent-clair: #e3f3f1;
  --fe-ok: #17663a;
  --fe-ok-fond: #e8f6ee;
  --fe-attention: #8a4b00;
  --fe-attention-fond: #fff4e0;
  --fe-erreur: #a4161a;
  --fe-erreur-fond: #fdecec;
  --fe-info: #3d4f66;
  --fe-info-fond: #eef2f7;
  --fe-divergence: #6a3fa0;
  --fe-divergence-fond: #f3edfb;
  --fe-rayon: 14px;
  --fe-police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fe-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  font-family: var(--fe-police);
  color: var(--fe-encre);
  background: var(--fe-fond);
  border: 1px solid var(--fe-bordure);
  border-radius: var(--fe-rayon);
  box-shadow: 0 1px 2px rgb(19 35 58 / 6%), 0 8px 24px rgb(19 35 58 / 6%);
  padding: clamp(16px, 3.5vw, 32px);
  line-height: 1.55;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.fe-outil *, .fe-outil *::before, .fe-outil *::after { box-sizing: border-box; }
.fe-outil :focus-visible { outline: 3px solid var(--fe-accent); outline-offset: 2px; border-radius: 6px; }
.fe-outil [tabindex="-1"]:focus { outline: none; }

.fe-entete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.fe-titre { font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.fe-surtitre { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fe-accent); margin: 0 0 6px; }
.fe-surtitre::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--fe-accent); }
.fe-chapo { color: var(--fe-encre-douce); margin: 0 0 18px; max-width: 68ch; }
.fe-discret { color: var(--fe-encre-douce); font-size: 0.875rem; }

/* Progression */
.fe-progression { display: flex; align-items: center; gap: 12px; font-size: 0.875rem; color: var(--fe-encre-douce); margin-bottom: 14px; }
.fe-barre { flex: 1; height: 6px; background: var(--fe-fond-doux); border-radius: 99px; overflow: hidden; }
.fe-barre > span { display: block; height: 100%; background: var(--fe-accent); border-radius: 99px; transition: width 0.25s ease; }

/* Question */
.fe-question { border: 0; margin: 0; padding: 0; min-width: 0; }
.fe-question legend { font-size: clamp(1.1rem, 2.2vw, 1.3rem); font-weight: 650; line-height: 1.3; padding: 0; margin-bottom: 6px; }
.fe-aide { margin: 0 0 14px; font-size: 0.925rem; color: var(--fe-encre-douce); max-width: 70ch; }
.fe-options { display: grid; gap: 10px; margin: 14px 0 0; }
.fe-option { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--fe-bordure); border-radius: 12px; background: var(--fe-fond); cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.fe-option:hover { border-color: var(--fe-accent); background: var(--fe-accent-clair); }
.fe-option input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--fe-accent); flex: none; }
.fe-option:has(input:checked) { border-color: var(--fe-accent); background: var(--fe-accent-clair); box-shadow: inset 0 0 0 1px var(--fe-accent); }
.fe-option:has(input:focus-visible) { outline: 3px solid var(--fe-accent); outline-offset: 2px; }
.fe-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }

/* Boutons */
.fe-bouton { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid var(--fe-bordure); background: var(--fe-fond); color: var(--fe-encre); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.fe-bouton:hover { border-color: var(--fe-encre-douce); }
.fe-bouton[disabled] { opacity: 0.45; cursor: not-allowed; }
.fe-bouton--principal { background: var(--fe-accent); border-color: var(--fe-accent); color: #FBFCFB; }
.fe-bouton--principal:hover { background: var(--fe-accent-fonce); border-color: var(--fe-accent-fonce); }
.fe-lien { color: var(--fe-accent-fonce); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* Pastilles de statut */
.fe-pastille { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.fe-pastille::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.fe-s-oui, .fe-s-ok { color: var(--fe-ok); background: var(--fe-ok-fond); }
.fe-s-non, .fe-s-info, .fe-s-non-verifie, .fe-s-action { color: var(--fe-info); background: var(--fe-info-fond); }
.fe-s-partiel, .fe-s-sous-reserve, .fe-s-a-verifier, .fe-s-attention { color: var(--fe-attention); background: var(--fe-attention-fond); }
.fe-s-erreur { color: var(--fe-erreur); background: var(--fe-erreur-fond); }
.fe-s-divergence { color: var(--fe-divergence); background: var(--fe-divergence-fond); }

/* Résultat du questionnaire */
.fe-verdict { border-radius: 12px; padding: 18px 20px; margin-bottom: 20px; border: 1px solid var(--fe-info); background: var(--fe-info-fond); }
.fe-verdict.fe-v-oui { border-color: var(--fe-accent); background: var(--fe-accent-clair); }
.fe-verdict.fe-v-partiel, .fe-verdict.fe-v-a-verifier { border-color: var(--fe-attention); background: var(--fe-attention-fond); }
.fe-verdict h3 { margin: 0 0 6px; font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.3; }
.fe-verdict p { margin: 0; }
.fe-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; margin-bottom: 20px; }
.fe-carte { border: 1px solid var(--fe-bordure); border-radius: 12px; padding: 16px; background: var(--fe-fond); display: flex; flex-direction: column; gap: 8px; }
.fe-carte h4 { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fe-encre-douce); }
.fe-carte .fe-carte-titre { font-weight: 650; line-height: 1.35; margin: 0; }
.fe-carte p { margin: 0; font-size: 0.925rem; }
.fe-date { display: inline-block; font-weight: 700; color: var(--fe-accent-fonce); font-variant-numeric: tabular-nums; }
.fe-section { margin-top: 22px; }
.fe-section > h3 { font-size: 1.1rem; margin: 0 0 10px; }
.fe-liste-actions { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: fe-etape; }
.fe-liste-actions > li { counter-increment: fe-etape; position: relative; padding: 12px 14px 12px 52px; border: 1px solid var(--fe-bordure); border-radius: 12px; background: var(--fe-fond-doux); }
.fe-liste-actions > li::before { content: counter(fe-etape); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--fe-accent); color: #FBFCFB; font-weight: 700; font-size: 0.85rem; display: grid; place-items: center; }
.fe-liste-actions strong { display: block; margin-bottom: 2px; }
.fe-divergence { border: 1.5px solid var(--fe-divergence); background: var(--fe-divergence-fond); border-radius: 12px; padding: 16px 18px; margin-top: 16px; }
.fe-divergence > strong:first-child { display: block; color: var(--fe-divergence); margin-bottom: 4px; }
.fe-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 12px; background: var(--fe-encre); color: #FBFCFB; margin: 0 0 20px; }
.fe-cta p { margin: 0; max-width: 52ch; }
.fe-cta .fe-bouton--principal { background: #FBFCFB; color: var(--fe-encre); border-color: #FBFCFB; }
.fe-sources { font-size: 0.8rem; color: var(--fe-encre-douce); margin: 4px 0 0; }
.fe-sources a { color: var(--fe-accent-fonce); }
.fe-ref { font-family: var(--fe-mono); font-size: 0.72rem; padding: 1px 5px; border-radius: 4px; background: var(--fe-fond-doux); color: var(--fe-encre-douce); }
.fe-plier { border: 1px solid var(--fe-bordure); border-radius: 12px; padding: 0 16px; margin-top: 12px; background: var(--fe-fond); }
.fe-plier > summary { cursor: pointer; padding: 14px 0; font-weight: 650; list-style-position: inside; }
.fe-plier[open] > summary { border-bottom: 1px solid var(--fe-bordure); margin-bottom: 12px; }
.fe-plier > :last-child { margin-bottom: 14px; }
.fe-empile { display: grid; gap: 12px; }
.fe-reponses { display: grid; gap: 6px; margin: 0; }
.fe-reponses div { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; border-bottom: 1px dashed var(--fe-bordure); padding: 6px 0; }
.fe-reponses dt { color: var(--fe-encre-douce); font-size: 0.875rem; }
.fe-reponses dd { margin: 0; font-weight: 600; font-size: 0.9rem; }
.fe-pied { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--fe-bordure); font-size: 0.8rem; color: var(--fe-encre-douce); }

/* Vérificateur */
.fe-depot { display: grid; place-items: center; text-align: center; gap: 8px; padding: clamp(24px, 5vw, 44px) 16px; border: 2px dashed var(--fe-accent); border-radius: 14px; background: var(--fe-accent-clair); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.fe-depot:hover, .fe-depot.fe-survol { background: #d3ece9; border-style: solid; }
.fe-depot strong { font-size: 1.1rem; }
.fe-depot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fe-depot:has(input:focus-visible) { outline: 3px solid var(--fe-accent); outline-offset: 3px; }
.fe-icone-depot { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--fe-accent); color: #FBFCFB; font-weight: 800; }
.fe-confiance { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-size: 0.9rem; color: var(--fe-encre-douce); }
.fe-confiance::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--fe-ok); box-shadow: 0 0 0 4px var(--fe-ok-fond); }
.fe-limites { margin: 16px 0 0; padding: 14px 16px 14px 34px; border-radius: 12px; background: var(--fe-attention-fond); color: #4d2c00; font-size: 0.9rem; }
.fe-limites li + li { margin-top: 4px; }
.fe-limites-titre { margin: 16px 0 0; font-weight: 700; font-size: 0.95rem; }
.fe-resume { display: grid; gap: 6px; padding: 18px 20px; border-radius: 12px; margin-bottom: 18px; border: 1px solid var(--fe-info); background: var(--fe-info-fond); }
.fe-resume.fe-r-ok { border-color: var(--fe-ok); background: var(--fe-ok-fond); }
.fe-resume.fe-r-attention { border-color: var(--fe-attention); background: var(--fe-attention-fond); }
.fe-resume.fe-r-erreur { border-color: var(--fe-erreur); background: var(--fe-erreur-fond); }
.fe-resume h3 { margin: 0; font-size: clamp(1.15rem, 2.3vw, 1.35rem); }
.fe-resume p { margin: 0; }
.fe-fichier { font-family: var(--fe-mono); font-size: 0.85rem; color: var(--fe-encre-douce); }
.fe-groupe { margin-top: 16px; }
.fe-groupe > h4 { margin: 0 0 8px; font-size: 0.95rem; }
.fe-controles { list-style: none; margin: 0; padding: 0; border: 1px solid var(--fe-bordure); border-radius: 12px; overflow: hidden; }
.fe-controles > li { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 14px; background: var(--fe-fond); }
.fe-controles > li + li { border-top: 1px solid var(--fe-bordure); }
.fe-controles .fe-pastille { grid-row: span 3; align-self: start; min-width: 104px; justify-content: center; }
.fe-controles .fe-c-titre { font-weight: 600; line-height: 1.35; }
.fe-controles .fe-c-detail { font-size: 0.875rem; color: var(--fe-encre-douce); }
.fe-controles .fe-c-ref { font-size: 0.78rem; color: var(--fe-encre-douce); }
.fe-xml { max-height: 340px; overflow: auto; font-family: var(--fe-mono); font-size: 0.75rem; line-height: 1.45; background: #0f1b2b; color: #dce6f2; padding: 14px; border-radius: 10px; white-space: pre; }
.fe-chargement { display: flex; align-items: center; gap: 12px; padding: 24px; justify-content: center; color: var(--fe-encre-douce); }
.fe-chargement::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--fe-bordure); border-top-color: var(--fe-accent); animation: fe-tourne 0.8s linear infinite; }
@keyframes fe-tourne { to { transform: rotate(360deg); } }
.fe-visuellement-cache { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Création de facture (module D) */
fe-creer-facturx [hidden] { display: none !important; }
.fe-etiquette-demo { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--fe-erreur); border-radius: 10px; background: var(--fe-erreur-fond); color: var(--fe-erreur); font-weight: 600; max-width: 72ch; }
.fe-resume .fe-etiquette-demo { margin: 4px 0 0; }
.fe-actions--serre { margin-top: 12px; }
.fe-formulaire { display: grid; gap: 18px; margin-top: 18px; }
.fe-bloc { border: 1px solid var(--fe-bordure); border-radius: 12px; padding: 12px 16px 16px; margin: 0; min-width: 0; background: var(--fe-fond); }
.fe-bloc > legend { font-weight: 700; font-size: 1.05rem; padding: 0 6px; }
.fe-marge-basse { margin: 0 0 12px; }
.fe-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px 14px; }
.fe-champs--tva { margin-top: 12px; }
.fe-champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fe-champ[hidden], .fe-mon-pdf[hidden] { display: none; }
.fe-champ--large { grid-column: 1 / -1; }
.fe-champ > label { font-weight: 600; font-size: 0.925rem; line-height: 1.35; }
.fe-indice { font-size: 0.8rem; color: var(--fe-encre-douce); }
.fe-saisie { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--fe-bordure); border-radius: 10px; background: var(--fe-fond); color: var(--fe-encre); font: inherit; }
.fe-saisie:hover { border-color: var(--fe-encre-douce); }
.fe-saisie:focus-visible { border-color: var(--fe-accent); }
.fe-saisie[aria-invalid="true"] { border-color: var(--fe-erreur); background: var(--fe-erreur-fond); }
.fe-erreur-champ { margin: 0; font-size: 0.85rem; font-weight: 650; color: var(--fe-erreur); }
.fe-case { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border: 1.5px solid var(--fe-bordure); border-radius: 12px; background: var(--fe-fond); cursor: pointer; }
.fe-case input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--fe-accent); }
.fe-case:has(input:checked) { border-color: var(--fe-accent); background: var(--fe-accent-clair); }
.fe-case:has(input:focus-visible) { outline: 3px solid var(--fe-accent); outline-offset: 2px; }
.fe-aide-franchise { margin: 8px 0 0; }
.fe-aide-franchise p { margin: 0; }
.fe-lignes { display: grid; gap: 12px; }
.fe-ligne-facture { margin: 0; min-width: 0; padding: 10px 12px 12px; border: 1px dashed var(--fe-bordure); border-radius: 10px; background: var(--fe-fond-doux); }
.fe-ligne-facture > legend { padding: 0 4px; font-weight: 650; font-size: 0.9rem; }
.fe-ligne-champs { display: grid; grid-template-columns: minmax(0, 3fr) repeat(3, minmax(0, 1.1fr)) auto; gap: 10px; align-items: end; }
.fe-champ--action { justify-content: flex-end; }
.fe-bouton--retirer { min-height: 44px; padding: 8px 14px; }
.fe-totaux { padding: 14px 16px; border-radius: 12px; background: var(--fe-fond-doux); border: 1px solid var(--fe-bordure); }
.fe-totaux p { margin: 0; }
.fe-totaux-titre { font-weight: 700; margin-bottom: 6px !important; }
.fe-totaux dl { display: grid; gap: 2px; margin: 0; }
.fe-totaux dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 5px 0; border-bottom: 1px dashed var(--fe-bordure); }
.fe-totaux dt { color: var(--fe-encre-douce); font-size: 0.9rem; }
.fe-totaux dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.fe-totaux .fe-total-fort dt, .fe-totaux .fe-total-fort dd { color: var(--fe-encre); font-weight: 750; }
.fe-mon-pdf { margin-top: 12px; }
.fe-mon-pdf .fe-depot { position: relative; }
.fe-mon-pdf .fe-fichier { margin: 8px 0 0; }
.fe-liste-erreurs { margin: 0; padding-left: 20px; }
.fe-liste-erreurs a { color: var(--fe-erreur); font-weight: 600; }
.fe-sortie { margin-top: 20px; }
.fe-sortie:empty { display: none; }
.fe-sortie .fe-resume:focus { outline: 3px solid var(--fe-accent); outline-offset: 2px; }
@media (max-width: 760px) {
  .fe-ligne-champs { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
  .fe-ligne-champs .fe-champ--designation, .fe-champ--action { grid-column: 1 / -1; }
  .fe-bouton--retirer { width: 100%; }
}

@media (max-width: 520px) {
  .fe-controles > li { grid-template-columns: 1fr; }
  .fe-controles .fe-pastille { grid-row: auto; justify-self: start; min-width: 0; }
  .fe-actions .fe-bouton { flex: 1 1 100%; }
  .fe-cta .fe-bouton { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .fe-outil * { transition: none !important; animation: none !important; }
}
@media print {
  .fe-outil { box-shadow: none; border: 0; padding: 0; }
  .fe-depot, .fe-actions, .fe-cta, .fe-pas-imprimer { display: none !important; }
  .fe-plier { border: 0; padding: 0; }
  .fe-plier > summary { display: none; }
}
