/* Vigilance — interface de l'étude.
   Encre marine (navigation, panneau d'action), or (accent), vélin (fond de travail).
   Titres : Playfair Display ; texte : Source Sans 3 (polices locales, licence OFL). */

@font-face { font-family: "Playfair Display"; font-weight: 600; font-display: swap; src: url(/static/fonts/playfair-display-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Playfair Display"; font-weight: 700; font-display: swap; src: url(/static/fonts/playfair-display-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(/static/fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: italic; font-display: swap; src: url(/static/fonts/source-sans-3-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(/static/fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url(/static/fonts/source-sans-3-latin-700-normal.woff2) format("woff2"); }

:root {
  --encre: #16213a;        /* navigation, panneau d'action */
  --encre-2: #1f2c4a;      /* champs sur fond encre */
  --encre-3: #2b3a5c;      /* filets sur fond encre */
  --or: #c49a3c;           /* accent principal */
  --or-clair: #d9b25f;
  --velin: #f6f3ec;        /* fond de travail */
  --carte: #ffffff;
  --filet: #e6e0d2;
  --filet-doux: #efebe1;
  --texte: #1b2234;
  --texte-2: #5d6478;
  --sur-encre: #e9ecf3;
  --sur-encre-2: #9ea8bf;
  --vert: #2f6b4f;  --vert-fond: #e6f0ea;
  --bleu: #33508c;  --bleu-fond: #e7ecf6;
  --ambre: #b9852b; --ambre-fond: #f8eedb;
  --rouge: #a63d3d; --rouge-fond: #f6e3e1;
  --gris: #6b7183;  --gris-fond: #eceae4;
  --rayon-panneau: 14px;
  --rayon-carte: 10px;
  --rayon-champ: 7px;
  --largeur-nav: 248px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15.5px/1.5 var(--sans); color: var(--texte); background: var(--velin); }
a { color: var(--bleu); text-underline-offset: 2px; }
a:hover { color: var(--encre); }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); color: var(--encre); font-weight: 700; letter-spacing: -0.005em;
             font-variant-numeric: lining-nums; }
h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 .35rem; }
h2 { font-size: 1.32rem; line-height: 1.25; margin: 0 0 .25rem; }
h3 { font-size: 1.05rem; margin: 1.1rem 0 .4rem; }
small, .muted { color: var(--texte-2); }
.error { color: var(--rouge); }
.warn-text { color: var(--ambre); }
p { margin: .4rem 0; }

/* --- Structure : navigation latérale + zone de travail ----------------------------------------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* Bandeau fin en haut : marque, étude, navigation (texte + icône) */
.topbar { display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 24px;
          background: var(--encre); color: var(--sur-encre); position: sticky; top: 0; z-index: 20; }
.marque { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.marque:hover { color: inherit; }
.monogramme { width: 33px; height: 33px; border: 1.5px solid var(--or); border-radius: 7px; display: grid;
              place-items: center; font: 700 1.05rem var(--serif); color: var(--or); flex: none; }
.marque-nom b { display: block; font: 700 .98rem var(--serif); letter-spacing: .06em; color: #fff; line-height: 1.1; }
.marque-nom small { display: block; font-size: .67rem; color: var(--sur-encre-2); letter-spacing: .03em; }
.etude-nom { padding-left: 18px; border-left: 1px solid var(--encre-3); color: var(--sur-encre-2); font-size: .86rem;
             font-weight: 600; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topnav a, .topnav button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 8px;
             color: var(--sur-encre); text-decoration: none; font: 600 .92rem var(--sans); line-height: 1;
             background: transparent; border: 0; cursor: pointer; }
.topnav a:hover, .topnav button:hover { background: var(--encre-2); color: #fff; }
.topnav a[aria-current="page"] { background: var(--encre-2); color: #fff; box-shadow: inset 0 -2px 0 var(--or); }
.topnav form { margin: 0; }
.topnav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7;
              stroke-linecap: round; stroke-linejoin: round; opacity: .9; }

.travail { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.bandeau-haut { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 12px 36px;
                border-bottom: 1px solid var(--filet); color: var(--texte-2); font-size: .9rem; background: var(--velin); }
.etat-traitement { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
                   background: var(--ambre-fond); color: #6c4b10; font-weight: 600; text-decoration: none; }
.etat-traitement::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ambre); }
.etat-traitement:hover { color: var(--encre); }
main { padding: 30px 36px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px 14px; }
  .marque-nom small, .etude-nom { display: none; }
  .topnav { margin-left: auto; gap: 2px; }
  .topnav a, .topnav button { padding: 7px 10px; font-size: .88rem; }
  .bandeau-haut, main, footer { padding-left: 16px; padding-right: 16px; }
}
.entete-page { margin-bottom: 22px; }
.entete-page p { color: var(--texte-2); margin: 0; max-width: 72ch; }
.fil { font-size: .88rem; color: var(--texte-2); margin: 0 0 6px; }
.fil a { color: var(--texte-2); }
footer { margin-top: auto; padding: 18px 36px; font-size: .8rem; color: var(--texte-2); border-top: 1px solid var(--filet); }

/* --- Messages ---------------------------------------------------------------------------------- */
.banner { padding: 11px 16px; border-radius: var(--rayon-champ); margin: 0 0 18px; border: 1px solid transparent; }
.banner.info { background: var(--bleu-fond); border-color: #cdd7ec; color: #22365e; }
.banner.warn { background: var(--ambre-fond); border-color: #ecd6a8; color: #5d4110; }
.flash { margin: 18px 36px 0; }

/* --- Surfaces ---------------------------------------------------------------------------------- */
.card { background: var(--carte); border: 1px solid var(--filet); border-radius: var(--rayon-carte); padding: 20px 22px;
        margin: 0 0 20px; }
.card-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.card-tete p { margin: 2px 0 0; color: var(--texte-2); font-size: .92rem; }
.panneau { background: var(--encre); color: var(--sur-encre); border-radius: var(--rayon-panneau); padding: 24px 26px; margin: 0 0 24px; }
.panneau h2 { color: #fff; }
.panneau p, .panneau .muted { color: var(--sur-encre-2); }
.panneau label { color: var(--sur-encre-2); }
.panneau input, .panneau select { background: var(--encre-2); border-color: var(--encre-3); color: #fff; }
.panneau input::placeholder { color: #7f8aa3; }
.panneau fieldset { border-color: var(--encre-3); }
.panneau legend { color: var(--or-clair); }
.panneau .check { color: var(--sur-encre); }
details.card > summary { cursor: pointer; font: 700 1.1rem var(--serif); color: var(--encre); list-style: none;
  display: flex; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
/* même flèche que les modules repliables */
details.card > summary::before { content: ""; flex: none; width: 0; height: 0; border-left: 7px solid currentColor;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent; transition: transform .15s; opacity: .7; }
details.card[open] > summary { margin-bottom: 14px; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card > summary:focus-visible { outline: 2px solid var(--or, currentColor); outline-offset: 4px; }

/* --- Formulaires ------------------------------------------------------------------------------- */
label { display: block; font-size: .86rem; font-weight: 600; color: var(--texte-2); margin: 0 0 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; font: 400 .97rem var(--sans); color: var(--texte);
                          background: #fff; border: 1px solid #d9d2c1; border-radius: var(--rayon-champ); padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 3px rgba(196, 154, 60, .2); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0; accent-color: var(--encre); }
textarea { resize: vertical; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--texte); margin: 0; }
fieldset { border: 1px solid var(--filet); border-radius: var(--rayon-carte); margin: 0 0 16px; padding: 12px 16px 4px; }
legend { font: 700 1rem var(--serif); color: var(--encre); padding: 0 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.row { display: grid; grid-template-columns: 2fr 2fr 1.3fr 1.3fr; gap: 10px; margin: 0 0 8px; }
.row input { margin-top: 0; }
.row.two { grid-template-columns: 3fr 1.3fr; }
.row.bien { grid-template-columns: 3fr 2fr 1fr 1fr 1fr; }
.row.head { font-size: .8rem; font-weight: 600; color: var(--texte-2); margin-bottom: 4px; }
.panneau .row.head { color: var(--sur-encre-2); }
form.inline { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
form.inline label { flex: 1 1 220px; margin: 0; }
form.inline input, form.inline select { margin-top: 5px; }

/* --- Boutons ----------------------------------------------------------------------------------- */
button, a.button { display: inline-flex; align-items: center; gap: 8px; font: 600 .95rem var(--sans); padding: 9px 16px;
                   border-radius: var(--rayon-champ); border: 1px solid #d6cfbe; background: #fff; color: var(--encre);
                   cursor: pointer; text-decoration: none; line-height: 1.2; }
button:hover, a.button:hover { border-color: var(--encre); color: var(--encre); }
button.primary, a.button.primary { background: var(--or); border-color: var(--or); color: var(--encre); }
button.primary:hover, a.button.primary:hover { background: var(--or-clair); border-color: var(--or-clair); }
button.sombre, a.button.sombre { background: var(--encre); border-color: var(--encre); color: #fff; }
button.sombre:hover, a.button.sombre:hover { background: var(--encre-2); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; color: var(--bleu); text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }

/* --- Tableaux ---------------------------------------------------------------------------------- */
.table-zone { overflow-x: auto; margin: 0 -22px; }
.table-zone table.list { min-width: 640px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--filet-doux); vertical-align: top; }
table.list th { font-size: .8rem; font-weight: 700; color: var(--texte-2); background: #faf8f3; border-bottom-color: var(--filet); }
table.list tr:last-child td { border-bottom: 0; }
.table-zone table.list th:first-child, .table-zone table.list td:first-child { padding-left: 22px; }
table.list a { font-weight: 600; }
.vide { text-align: center; padding: 34px 16px; color: var(--texte-2); }

/* --- Statuts ----------------------------------------------------------------------------------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill.vert { color: var(--vert); background: var(--vert-fond); }
.pill.orange { color: #8a5f14; background: var(--ambre-fond); }
.pill.rouge { color: var(--rouge); background: var(--rouge-fond); }
.pill.gris { color: var(--gris); background: var(--gris-fond); }
.pill.document { color: var(--bleu); background: var(--bleu-fond); }
.pill.simule { color: #fff; background: #6b4fa8; }
.pill.manuel { color: #fff; background: #2d6f7d; }
.etat { font: 600 .82rem var(--sans); padding: 3px 11px; border-radius: 999px; background: var(--gris-fond); color: var(--gris);
        vertical-align: middle; white-space: nowrap; }
.etat.en_cours, .etat.attente_intervention { background: var(--ambre-fond); color: #8a5f14; }
.etat.terminee { background: var(--vert-fond); color: var(--vert); }
.etat.echouee, .etat.expiree, .etat.interrompue, .etat.annulee { background: var(--rouge-fond); color: var(--rouge); }
.tech { font-size: .88rem; }
.tech.erreur, .tech.indisponible, .tech.incomplet { color: var(--rouge); font-weight: 600; }
.tech.authentification_requise { color: var(--ambre); font-weight: 600; }
.niveau { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .03em; white-space: nowrap; }
.niveau.standard { background: var(--vert-fond); color: var(--vert); }
.niveau.renforcee { background: var(--ambre-fond); color: #8a5f14; }
.niveau.simplifiee { background: var(--bleu-fond); color: var(--bleu); }
.niveau.a-retenir { background: var(--gris-fond); color: var(--gris); }
.type-sujet { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: .72rem;
              font-weight: 700; color: var(--encre); background: var(--velin); border: 1px solid var(--filet); }

/* Pastilles par fichier interrogé : l'élément signature de l'analyse */
.pastilles { display: flex; flex-wrap: wrap; gap: 4px; }  /* lettres concernées seulement, alignées à gauche */
.pastille { width: 25px; height: 25px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .74rem;
            font-weight: 700; color: #fff; cursor: default; }
.pastille.vert { background: var(--vert); }
.pastille.orange { background: var(--ambre); }
.pastille.rouge { background: var(--rouge); }
.pastille.gris { background: #a3a7b3; }
.pastille.bleu, .pastille.document { background: var(--bleu); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .86rem; color: var(--texte-2); padding: 12px 22px 0;
           border-top: 1px solid var(--filet-doux); margin: 0 -22px; }
.legende span { display: inline-flex; align-items: center; gap: 7px; }
.legende i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legende-fichiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.legende-fichiers li { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.legende-fichiers .pastille { background: var(--encre); width: 22px; height: 22px; font-size: .68rem; }

/* --- Analyse : tableau des recherches ---------------------------------------------------------- */
.sources details summary { cursor: pointer; color: var(--texte); }
.sources details[open] summary { margin-bottom: 8px; }
.sources td:first-child { font-weight: 600; }
ul.corr, ol.corr { margin: 8px 0; padding-left: 20px; font-size: .92rem; }
ol.corr li { margin-bottom: 4px; }
ol.corr li.signal { color: #8a5f14; }
ul.crit { font-size: .88rem; color: var(--texte-2); margin: 6px 0; padding-left: 18px; }
ul.journal { font-size: .88rem; color: var(--texte-2); padding-left: 18px; }
.decision { font-size: .76rem; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--gris-fond); }
.decision.alerte_confirmee { background: var(--rouge-fond); color: var(--rouge); }
.decision.homonymie_ecartee { background: var(--vert-fond); color: var(--vert); }
.decision-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 12px;
                 background: #faf8f3; border: 1px solid var(--filet-doux); border-radius: var(--rayon-champ); }
.decision-form select, .decision-form input { margin: 0; width: auto; }
.decision-form input { flex: 1 1 200px; }
.decision-form b { font-family: var(--serif); color: var(--encre); }
/* Colonne « Conclusion » : saisie rapide */
.concl-rapide { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.qr { padding: 5px 10px; border-radius: 6px; font: 600 .82rem var(--sans); border: 1px solid; cursor: pointer; white-space: nowrap; }
.qr.ok { background: var(--vert-fond); border-color: #bfe0cd; color: var(--vert); }
.qr.doute { background: var(--ambre-fond); border-color: #e9d4a6; color: #6c4b10; }
.qr.alerte { background: var(--rouge-fond); border-color: #e7c2c0; color: var(--rouge); }
.qr:hover { filter: brightness(0.96); }
.qr.actif { color: #fff; }
.qr.ok.actif { background: var(--vert); border-color: var(--vert); }
.qr.doute.actif { background: var(--ambre); border-color: var(--ambre); }
.qr.alerte.actif { background: var(--rouge); border-color: var(--rouge); }
.concl-msg { flex-basis: 100%; font-size: .78rem; }
.legend { font-size: .86rem; color: var(--texte-2); }
ul.controles { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
ul.controles li { padding: 10px 14px; border-radius: var(--rayon-champ); border: 1px solid; }
ul.controles li.ko { background: var(--ambre-fond); border-color: #ecd6a8; }
ul.controles li.ok { background: #faf8f3; border-color: var(--filet); }
ul.controles details { margin-top: 6px; }
ul.controles summary { cursor: pointer; color: var(--bleu); font-size: .9rem; }
.documents { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.documents li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 10px 14px;
                border: 1px solid var(--filet); border-radius: var(--rayon-champ); background: #fdfcf9; }
.documents a { font-weight: 600; }
.generer { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.generer form { margin: 0; padding: 16px; border: 1px solid var(--filet); border-radius: var(--rayon-carte); background: #fdfcf9;
                display: flex; flex-direction: column; gap: 10px; }
.generer form label { margin: 0; }
.generer form button { align-self: flex-start; }
.generer h3 { margin: 0; }
.generer p { margin: 0; font-size: .9rem; color: var(--texte-2); }
.generer form.valider { background: #fbf6ea; border-color: #ecd6a8; }

/* --- Questionnaire ----------------------------------------------------------------------------- */
.question { padding: 12px 0; border-bottom: 1px solid var(--filet-doux); }
.question:last-child { border-bottom: 0; }
.question p { margin: 0 0 8px; }
.choix { display: inline-flex; border: 1px solid #d6cfbe; border-radius: 999px; overflow: hidden; background: var(--carte); }
.choix label { margin: 0; white-space: nowrap; position: relative; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix label span { display: block; padding: 6px 16px; font-weight: 600; font-size: .88rem; color: var(--texte-2); cursor: pointer; }
.choix label + label span { border-left: 1px solid #d6cfbe; }
.choix input:checked + span { background: var(--encre); color: #fff; }
.choix input:focus-visible + span { outline: 2px solid var(--or); outline-offset: -2px; }
.prerempli { font-size: .86rem; color: var(--bleu); margin: 6px 0 0; }
.indication { font-size: .85rem; color: var(--texte-2); margin: 6px 0 0; padding-left: 18px; }
.comparants-onglets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.comparants-onglets a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--filet); background: #fff;
                        text-decoration: none; color: var(--texte); font-weight: 600; font-size: .9rem; }
.comparants-onglets a[aria-current="page"] { background: var(--encre); color: #fff; border-color: var(--encre); }

/* --- Connexion --------------------------------------------------------------------------------- */
body.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.login-gauche { background: var(--encre); color: var(--sur-encre); padding: 56px; display: flex; flex-direction: column;
                justify-content: space-between; }
.login-gauche h1 { color: #fff; font-size: 2.4rem; max-width: 14ch; margin-top: 40px; }
.login-gauche p { color: var(--sur-encre-2); max-width: 46ch; }
.login-droite { display: grid; place-items: center; padding: 32px; }
.login-droite form { width: 100%; max-width: 360px; }

/* --- Adaptation ------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; background: none; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; }
  .marque { border: 0; padding: 0 12px 0 0; }
  .etude, .nav-pied span { display: none; }
  .menu { display: flex; flex-wrap: wrap; margin: 0; }
  .nav-pied { margin: 0 0 0 auto; padding: 0; border: 0; }
  .nav-pied form { margin: 0; }
  main, .bandeau-haut, footer { padding-left: 16px; padding-right: 16px; }
  .flash { margin-left: 16px; margin-right: 16px; }
  .grid2, .grid4, .row, .row.two, .row.bien, .legende-fichiers { grid-template-columns: 1fr; }
  .row.head { display: none; }
  body.login { grid-template-columns: 1fr; }
  .login-gauche { padding: 32px 20px; }
  .login-gauche h1 { margin-top: 16px; font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Puces « à analyser » du panneau de lancement */
.puces { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 18px; padding: 14px 0 0;
         border-top: 1px solid var(--encre-3); }
.puce { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--encre-3);
        background: var(--encre-2); color: #fff; font-size: .9rem; font-weight: 600; }
.puce.bien { border-style: dashed; }
.panneau form.inline label { color: var(--sur-encre-2); }

/* --- Accueil : nouvelle recherche -------------------------------------------------------------- */
.bascule { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--encre-2); border: 1px solid var(--encre-3); }
.bascule button { border: 0; background: transparent; color: var(--sur-encre); padding: 7px 14px; font-size: .9rem; }
.bascule button:hover { color: #fff; border: 0; }
.bascule button[aria-pressed="true"] { background: var(--or); color: var(--encre); }
.saisie { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.saisie .champs { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1.2fr; gap: 12px; }
.saisie .champs.societe { grid-template-columns: 2fr 1fr; }
.saisie label { margin: 0; }
.panneau button.clair { background: transparent; border-color: var(--sur-encre-2); color: #fff; height: 40px; }
.panneau button.clair:hover { border-color: var(--or); }
.panneau button.clair:disabled { opacity: .4; }
.panneau .erreur-panneau { margin: 10px 0 0; color: #f3c4c0; font-weight: 600; }
.bien-option { margin: 14px 0 0; }
.bien-option summary { cursor: pointer; color: var(--or-clair); font-weight: 600; font-size: .92rem; }
.bien-option .champs.bien { display: grid; grid-template-columns: 3fr 1fr 1.6fr; gap: 12px; margin-top: 10px; }
.bien-option label { margin: 0; }
.a-analyser { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px;
              padding-top: 16px; border-top: 1px solid var(--encre-3); }
.a-analyser .puces { margin: 0; padding: 0; border: 0; flex: 1 1 400px; }
.a-analyser button.primary { padding: 12px 20px; font-size: 1rem; }
.puce button { border: 0; background: transparent; color: var(--sur-encre-2); padding: 0 0 0 6px; font-size: 1rem; line-height: 1; }
.puce button:hover { color: #fff; border: 0; }
.puce.societe { border-color: var(--or); }
.progression-msg { margin: 0 0 14px; font: 600 1.02rem var(--sans); color: var(--encre); display: inline-flex;
                    align-items: center; gap: 10px; }
.progression-msg::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--or); border-right-color: transparent;
                           border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.barre { height: 6px; border-radius: 999px; background: var(--filet-doux); overflow: hidden; margin: 0 0 14px; }
.barre span { display: block; height: 100%; width: 0; background: var(--or); transition: width .4s ease; }
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.etape { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px;
         border-bottom: 1px solid var(--filet-doux); }
.etape small { display: block; color: var(--texte-2); }
.etape .icone { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem;
                font-weight: 700; background: var(--gris-fond); color: var(--gris); }
.etape.succes .icone { background: var(--vert-fond); color: var(--vert); }
.etape.en_cours .icone, .etape.authentification_requise .icone { background: var(--ambre-fond); color: var(--ambre); }
.etape.erreur .icone, .etape.indisponible .icone, .etape.incomplet .icone { background: var(--rouge-fond); color: var(--rouge); }
.legende-fichiers.encadre { background: #faf8f3; border: 1px solid var(--filet-doux); border-radius: var(--rayon-carte); padding: 16px 18px; }
@media (max-width: 960px) {
  .saisie, .saisie .champs, .saisie .champs.societe, .bien-option .champs.bien { grid-template-columns: 1fr; }
}

/* Adresse du bien : suggestions de la Base Adresse Nationale */
.adresse-zone { position: relative; }
.adresse-zone label { margin: 0; }
.suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none;
               background: #fff; border: 1px solid var(--filet); border-radius: var(--rayon-champ);
               box-shadow: 0 12px 28px rgba(22, 33, 58, .28); max-height: 280px; overflow-y: auto; }
.suggestions li { padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--texte); }
.suggestions li span { color: var(--texte-2); }
.suggestions li[aria-selected="true"], .suggestions li[data-i]:hover { background: var(--velin); }
.suggestions li.aucune { color: var(--texte-2); cursor: default; }
.etat-adresse { margin: 8px 0 0; font-size: .88rem; color: var(--sur-encre-2); }
.etat-adresse.verifiee { color: #9fd8b8; }
.etat-adresse.verifiee::before { content: "✓ "; font-weight: 700; }
.etat-adresse.a-verifier { color: #f0c98a; }

input[aria-invalid="true"] { border-color: var(--rouge) !important; box-shadow: 0 0 0 3px rgba(166, 61, 61, .25); }

/* Sélecteur de date : listes mois / année + grille des jours */
.date-zone { position: relative; display: block; }
.date-zone input { padding-right: 42px; }
.date-bouton { position: absolute; right: 5px; bottom: 5px; width: 32px; height: 30px; padding: 0; justify-content: center;
               border: 0; background: transparent; color: var(--texte-2); }
.date-bouton svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.date-bouton:hover { color: var(--encre); border: 0; }
.panneau .date-bouton { color: var(--sur-encre-2); }
.panneau .date-bouton:hover { color: #fff; }
.calendrier { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); width: 300px; padding: 12px;
              background: #fff; color: var(--texte); border: 1px solid var(--filet); border-radius: var(--rayon-carte);
              box-shadow: 0 16px 36px rgba(22, 33, 58, .3); }
.cal-tete { display: grid; grid-template-columns: 30px 1fr 84px 30px; gap: 6px; align-items: center; margin-bottom: 10px; }
.cal-tete select { margin: 0; padding: 6px 8px; font-weight: 600; background: #fff; color: var(--texte); border-color: #d9d2c1; }
.cal-nav { width: 30px; height: 32px; padding: 0; justify-content: center; font-size: 1.2rem; }
.cal-jours, .cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-jours span { font-size: .75rem; font-weight: 700; color: var(--texte-2); padding: 2px 0 6px; }
.cal-grille button { height: 34px; padding: 0; justify-content: center; border: 1px solid transparent; background: transparent;
                     color: var(--texte); font-weight: 600; font-size: .9rem; }
.cal-grille button:hover:not(:disabled) { border-color: var(--or); background: #fbf6ea; }
.cal-grille button[aria-pressed="true"] { background: var(--encre); color: #fff; border-color: var(--encre); }
.cal-grille button:disabled { color: #c3c6cf; }
.cal-pied { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--filet-doux); }
.cal-pied button { padding: 6px 12px; font-size: .86rem; }

/* Entités liées (sociétés dirigées, dirigeants) : en retrait sous leur comparant */
tr.lie td:nth-child(2) { padding-left: 28px; }
tr.lie td { background: var(--velin, transparent); }

/* Légende de la synthèse : repliée par défaut, ouverte par la flèche */
.legende-repliable { margin-top: 14px; border-top: 1px solid var(--filet-doux); padding-top: 10px; }
.legende-repliable > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--texte-2); }
.legende-repliable > summary::-webkit-details-marker { display: none; }
.legende-repliable > summary::before { content: ""; width: 0; height: 0; border-left: 6px solid currentColor;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s; }
.legende-repliable[open] > summary::before { transform: rotate(90deg); }
.legende-repliable > summary:focus-visible { outline: 2px solid var(--or, currentColor); outline-offset: 3px; }
.legende-repliable h3 { margin: 14px 0 6px; font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { .legende-repliable > summary::before { transition: none; } }

/* Fiche de vigilance CSN dépliée sur place */
.fiche-inline { border-top: 1px solid var(--filet-doux); padding: 10px 0; }
.fiche-inline > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.fiche-inline > summary { list-style: none; align-items: center; }
.fiche-inline > summary::-webkit-details-marker { display: none; }
.fiche-inline > summary::before { content: ""; width: 0; height: 0; border-left: 6px solid currentColor;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s; }
.fiche-inline[open] > summary::before { transform: rotate(90deg); }
.fiche-inline > summary:focus-visible { outline: 2px solid var(--or, currentColor); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .fiche-inline > summary::before { transition: none; } }
.fiche-inline > summary small { color: var(--texte-2); }
.questionnaire.inline { margin-top: 10px; }
.q-bloc { border-top: 1px solid var(--filet-doux); padding: 12px 0 4px; }
.q-bloc h2 { font-size: 1.05rem; }


/* Conclusion d'une recherche : liste simple (vert / orange / rouge) ; qualification fine repliée */
.decision-form.conclusion { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.decision-form.conclusion label { flex: 1 1 260px; margin: 0; font-weight: 600; }
.decision-form.conclusion input[name=commentaire] { flex: 1 1 200px; width: auto; margin: 0; }
.qualif-avancee { margin-top: 8px; }
.qualif-avancee > summary { cursor: pointer; color: var(--texte-2); font-size: .9rem; }
.qualif-avancee .decision-form { margin-top: 8px; }

.obligatoire { color: var(--or, #b08a3e); font-weight: 700; }

/* Titre lu par les lecteurs d'écran, invisible à l'écran */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Modules repliables (flèche dans le titre) */
.pli { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; font: inherit; color: inherit; }
.pli::before { content: ""; flex: none; width: 0; height: 0; border-left: 7px solid currentColor; border-top: 6px solid transparent;
  border-bottom: 6px solid transparent; transform: rotate(90deg); transition: transform .15s; opacity: .7; }
.pli[aria-expanded="false"]::before { transform: none; }
.pli:focus-visible { outline: 2px solid var(--or, currentColor); outline-offset: 4px; border-radius: 2px; }
.module.replie > :not(.module-tete) { display: none; }
.module.replie .module-tete:not(h2) > :not(.module-titre) { display: none; }
.module.replie .module-titre p, .module.replie > h2 + p { display: none; }
.module.replie .module-tete { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .pli::before { transition: none; } }

/* Fiche CSN à l'écran : reprend la mise en page du formulaire officiel (rubriques sur fond bleu CSN,
   mentions en rouge, aides en italique) ; les ajouts de l'outil sont en gris (.hors-fiche) */
.questionnaire.csn { --csn-bleu: #4a8fd1; --csn-rouge: #e3242b; }
.csn-titre { text-align: center; color: var(--csn-bleu); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; margin: 6px 0 14px; }
.csn-section { padding: 10px 0 6px; border-top: 1px solid var(--filet-doux); }
.csn-rubrique { display: inline-block; margin: 6px 0 8px; padding: 3px 10px; background: var(--csn-bleu); color: #fff;
  font: 700 1rem var(--sans); }
.csn-sous-rubrique { margin: 14px 0 6px; font: 700 .98rem var(--sans); }
.csn-sous-rubrique > span { display: inline-block; padding: 2px 8px; background: #eef1f6; color: var(--csn-bleu); }
.csn-sous-rubrique em { color: var(--csn-bleu); font-weight: 600; }
.csn-aide { margin: 2px 0 8px; font-size: .85rem; font-style: italic; color: var(--texte-2); }
.csn-aide p { margin: 0; overflow-wrap: anywhere; }
.csn-question { margin: 10px 0 4px; }
.csn-question::before { content: "• "; color: var(--csn-bleu); }
.csn-mention { color: var(--csn-rouge); font-style: italic; }
.csn-note { margin: 4px 0 0; font-size: .82rem; font-style: italic; color: var(--texte-2); }
.hors-fiche { color: var(--gris, #6b7280); font-weight: 400; }
.csn-enregistrer { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-top: 14px; border-top: 1px solid var(--filet-doux); }
.csn-enregistrer label { flex: 1 1 260px; margin: 0; }

/* Nouvelle recherche : onglets Personne physique / Bien immobilier */
.onglets { display: flex; gap: 4px; margin: 4px 0 16px; border-bottom: 1px solid var(--encre-3); }
.onglets [role="tab"] { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent;
  color: var(--sur-encre); padding: 9px 16px 8px; font-weight: 600; font-size: .95rem; margin-bottom: -1px; }
.onglets [role="tab"]:hover { color: #fff; border-color: transparent; border-bottom-color: var(--encre-3); }
.onglets [role="tab"][aria-selected="true"] { color: #fff; border-bottom-color: var(--or); }
.onglets [role="tab"]:focus-visible { outline: 2px solid var(--or); outline-offset: -2px; }
.onglet-panneau .champs.bien { display: grid; grid-template-columns: 3fr 1fr 1.6fr; gap: 12px; }
.onglet-panneau .champs.bien label { margin: 0; }
.onglet-panneau .champs.societe { max-width: 640px; }
.pays-question { margin: 6px 0 4px; }
.pays-question select { max-width: 360px; }
.alerte-pays { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--rouge); background: var(--rouge-fond); }
.aide-onglet { margin: 8px 0 0; font-size: .85rem; color: var(--sur-encre); opacity: .8; }
@media (max-width: 720px) { .onglet-panneau .champs.bien { grid-template-columns: 1fr; } }

/* Résultats d'un bien immobilier analysé seul */
.bien-resultats { list-style: none; margin: 0; padding: 0; }
.bien-resultats li { padding: 12px 0; border-top: 1px solid var(--filet-doux); }
.bien-resultats li p { margin: 4px 0 0; }
.bien-entete { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bien-pieces { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; }
.bien-pdf { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--filet); }
.bien-pdf form { margin: 0; }
.bien-pdf p { margin: 0; }

/* onglet Bien : bouton seul, à droite comme sur l onglet Personne physique */
#form-bien { justify-content: flex-end; }

/* V1 sans liste de personnes : le bouton Lancer reste à droite */
#form-lancer { justify-content: flex-end; }
#puces:empty { display: none; }

/* Rubrique 4 : documents unitaires, sur le modèle du module « Bien immobilier » */
.docs-manquants { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--filet-doux); }
.docs-manquants ul { margin: 6px 0 0; padding-left: 20px; color: var(--texte-2); }
.docs-manquants li { margin: 3px 0; }
.manque-fiche { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--rouge-fond); color: var(--texte); }
.docs-manquants li b { color: var(--texte); font-weight: 600; }
.doc-fichier { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.doc-fichier > b { margin-right: 14px; }
.doc-fichier > a:not(.doc-bouton) { font-size: .9rem; margin-right: 4px; }
.docs-liste .doc-detail { margin: 4px 0 0; color: var(--texte-2); font-size: .9rem; }
.docs-liste li { padding: 9px 0; }
.doc-bouton { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; color: var(--encre);
              border: 1px solid var(--filet); background: var(--carte); }
.doc-bouton:hover, .doc-bouton:focus-visible { background: var(--velin); border-color: var(--or); }
.doc-bouton svg { width: 17px; height: 17px; }

/* Case anti-robot du portail affichée dans la page (11/11/2026) */
.anti-robot { display: grid; gap: 10px; justify-items: start; margin-top: 10px; }
.anti-robot img { max-width: 100%; border: 1px solid var(--filet); border-radius: 8px; background: #fff; cursor: pointer; }
.anti-robot p { margin: 0; }
