/* ============================================================================
   dossier-ircc — LA FEUILLE DES DEUX LANGUES.

   Le CSS n'a pas de langue. Cette feuille etait ecrite DEUX FOIS : une dans
   dossier-ircc.html, une recopiee a la main dans en/dossier-ircc.html. Reunies le 09/09/2026 —
   une retouche se fait desormais a UN seul endroit.

   Preuve du deplacement : tools/empreinte-styles.py, qui compare le style
   CALCULE de chaque element avant et apres, aux deux largeurs et dans les
   deux themes.
   ============================================================================ */

/* LE FORMULAIRE DU DOSSIER IRCC — refonte du 07/09/2026.
   Un écran = une carte. Toutes les mesures viennent des échelles de la
   charte : neuf espacements, quatre rayons, deux ombres, un anneau. */
.di-wrap { max-width: 860px; }
.di-etat { padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); box-shadow: var(--shadow-sm); text-align: center; color: var(--muted); }
.di-etat.ko { border-color: var(--red); color: var(--red-dark); font-weight: 600; }
.di-tete h1 { font-size: var(--fs-h2); margin-bottom: var(--sp-2); }
.di-tete p { color: var(--muted); font-size: var(--fs-sm); }

/* Le fil épinglé : il reste lisible pendant qu'on descend l'écran. */
.di-fil { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: var(--sp-3) 0 var(--sp-2); margin: 0 0 var(--sp-4); border-bottom: 1px solid var(--line); }
.di-progres { height: 6px; border-radius: var(--r-pill); background: var(--line); margin: var(--sp-4) 0 var(--sp-1); overflow: hidden; }
.di-progres span { display: block; height: 100%; border-radius: var(--r-pill); width: 25%; background: linear-gradient(90deg, var(--red), var(--red-deep)); transition: width .35s ease; }
.di-compteur { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-4); }
.di-fil .di-progres { margin: 0 0 var(--sp-2); }
.di-fil .di-compteur { margin: 0; }
/* ⚠️ « di-etapes » sert AUSSI aux listes de consignes de chaque écran :
   ce display:flex les mettait en ligne. Le fil se cible par son identifiant. */
#diEtapes { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: 0 0 var(--sp-2); }
.di-etape { width: 36px; height: 36px; padding: 0; flex: none; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--white); color: var(--muted); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.di-etape:hover { border-color: var(--red); color: var(--red-dark); transform: translateY(-1px); }
.di-etape.ok { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }
.di-etape.en-cours { border-color: var(--red); background: var(--red-fond); color: var(--sur-couleur); box-shadow: var(--ring); }
.di-etape.en-cours.ok { border-color: var(--teal-dark); background: var(--teal-dark); color: var(--sur-couleur); box-shadow: var(--shadow-sm); }

/* Chaque écran est une carte posée sur le fond : on voit où il commence
   et où il finit, ce qu'une suite de titres ne disait pas. */
.di-bloc { min-width: 0; margin: 0 0 var(--sp-4); padding: var(--sp-5); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.di-bloc h2 { font-size: var(--fs-xl); margin: 0 0 var(--sp-3); }
.di-bloc h3 { font-size: var(--fs-lg); margin: var(--sp-5) 0 var(--sp-2); }
.di-aide { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 var(--sp-3); }
.di-regle { padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--red); background: var(--blush); border-radius: 0 var(--r) var(--r) 0; font-size: var(--fs-sm); line-height: 1.55; margin: 0 0 var(--sp-4); }
.di-etapes { margin: 0 0 var(--sp-3); padding-left: var(--sp-5); font-size: var(--fs-sm); }
.di-etapes li { margin: var(--sp-1) 0; line-height: 1.55; }
.di-etapes li::marker { color: var(--red-dark); font-weight: 700; }
.di-exemple { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px dashed var(--amber); border-radius: var(--r); background: var(--amber-light); font-size: var(--fs-sm); color: var(--ink); }
.di-conseil { margin: var(--sp-2) 0 0; font-weight: 600; }
.di-sos { text-align: center; margin-top: var(--sp-4); }
.di-apercu { border-left-color: var(--teal); background: var(--teal-light); }

/* DE QUI PARLE CET ÉCRAN. Le conjoint d'une cliente a saisi SES adresses
   dans la partie d'elle : rien ne disait à qui étaient ces lignes. */
.di-aqui { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r); font-size: var(--fs-sm); line-height: 1.5; font-weight: 600; }
.di-aqui-moi { background: #E8F1FB; color: #14497F; border: 1px solid #C6DDF4; }
/* Vert du conjoint — volontairement différent du vert « dix ans couverts »
   pour qu'on ne lise pas le bandeau comme un feu vert. */
.di-aqui-conjoint { background: #E8F5EE; color: #146B45; border: 1px solid #BFE3CE; }
.di-aqui b { font-weight: 800; }
.di-aqui small { font-weight: 400; opacity: .85; flex-basis: 100%; }
.di-bloc-conjoint { border-left: 4px solid #2E8B5E; padding-left: var(--sp-4); }

/* ── Les champs ── */
.di-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.di-grille .plein { grid-column: 1 / -1; }
.di-q { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.di-q > span { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.di-q > span i { font-style: normal; color: var(--muted); font-weight: 500; }
.di-q input, .di-q select, .di-q textarea { width: 100%; min-width: 0; min-height: 46px; padding: var(--sp-3); border: 1.5px solid var(--line); border-radius: var(--r); font: inherit; font-size: var(--fs-md); background: var(--white); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease; }
.di-q input:hover, .di-q select:hover, .di-q textarea:hover { border-color: #DAD4D2; }
.di-q input:focus, .di-q select:focus, .di-q textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--ring); }
.di-q input::placeholder, .di-q textarea::placeholder { color: #A9A2A0; }
/* La flèche des listes déroulantes est dessinée ici : celle du système
   change d'un téléphone à l'autre et jurait avec le reste. */
.di-q select { appearance: none; -webkit-appearance: none; padding-right: var(--sp-7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236B6462' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--sp-4) center; }
.di-q small { font-size: var(--fs-xs); color: var(--muted); }
.di-oblig { color: var(--red-dark); }
.di-manque { border-color: var(--red) !important; box-shadow: var(--ring) !important; }
/* .di-q est en flex : sans cette règle, l'attribut hidden des champs
   scolaires ne masquerait rien. */
.di-q[hidden] { display: none; }
.di-case { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); padding: var(--sp-2); margin: calc(var(--sp-2) * -1); border-radius: var(--r-sm); cursor: pointer; transition: background .15s ease; }
.di-case:hover { background: var(--bg); }
.di-case input { width: 20px; height: 20px; flex: none; accent-color: var(--red-dark); cursor: pointer; }

/* ── Les lignes que l'on ajoute : adresses, activités, famille ── */
.di-lignes { display: flex; flex-direction: column; gap: var(--sp-3); }
.di-ligne { position: relative; padding: var(--sp-5) var(--sp-4) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); transition: border-color .15s ease, background .15s ease; }
.di-ligne:focus-within { border-color: #DAD4D2; background: var(--white); }
.di-ligne .di-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.di-ligne .di-num { position: absolute; top: calc(var(--sp-3) * -1); left: var(--sp-4); display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; background: var(--navy-dark); color: var(--sur-couleur); font-size: var(--fs-xs); font-weight: 700; padding: 0 var(--sp-2); border-radius: var(--r-pill); }
.di-ligne .di-retirer { position: absolute; top: var(--sp-2); right: var(--sp-2); border: 0; background: transparent; color: var(--muted); font-size: var(--fs-sm); cursor: pointer; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm); transition: background .15s ease, color .15s ease; }
.di-ligne .di-retirer:hover { background: var(--blush); color: var(--red-dark); }
.di-ajouter { margin-top: var(--sp-3); }

/* ── Les trous des dix ans ── */
.di-trous { margin: var(--sp-3) 0 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r); font-size: var(--fs-sm); }
.di-trous.ko { background: #FDECEA; color: var(--red-dark); border: 1px solid #F3C4C0; }
.di-trous.ok { background: var(--teal-light); color: var(--teal-dark); border: 1px solid #BEE5DE; }
.di-trous ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); }
.di-trous li { margin-bottom: var(--sp-2); }
.di-combler { margin-left: var(--sp-2); padding: var(--sp-1) var(--sp-3); border: 1px solid var(--red-dark); border-radius: var(--r-pill);
  background: var(--white); color: var(--red-dark); font: inherit; font-size: .82em; font-weight: 600; cursor: pointer;
  white-space: nowrap; min-height: 32px; transition: background .15s ease, color .15s ease; }
.di-combler:hover, .di-combler:focus-visible { background: var(--red-fond); color: var(--sur-couleur); }

/* ── Les pièces ── */
.di-doc { padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); margin-bottom: var(--sp-3); }
.di-doc.plein { border-color: var(--teal); }
.di-doc h3 { margin: 0 0 var(--sp-1); font-size: var(--fs-md); }
.di-doc .di-aide { margin-bottom: var(--sp-3); }
/* LE DÉPÔT DES PIÈCES. La case « Choisir un fichier » du navigateur était
   brute, large de 2 cm au doigt et muette sur le format attendu. */
.di-depot-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.di-depot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 2px dashed #DAD4D2; border-radius: var(--r); background: var(--white); cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.di-depot:hover { border-color: var(--red); box-shadow: var(--shadow-sm); }
.di-depot-input:focus-visible + .di-depot { border-color: var(--red); box-shadow: var(--ring); }
.di-depot.survol { border-style: solid; border-color: var(--red); background: var(--white); box-shadow: var(--ring); }
.di-depot-icone { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--r); background: var(--white); border: 1px solid var(--line); font-size: var(--fs-lg); line-height: 1; }
.di-depot-mots { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.di-depot-mots b { font-size: var(--fs-sm); }
.di-depot-mots small { color: var(--muted); font-size: var(--fs-xs); }
.di-depot-bouton { margin-left: auto; flex: 0 0 auto; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); background: var(--red-fond); color: var(--sur-couleur); font-weight: 700; font-size: var(--fs-xs); white-space: nowrap; }
.di-doc.plein .di-depot { border-style: solid; border-color: var(--line); }
.di-doc.plein .di-depot-bouton { background: transparent; color: var(--red-dark); border: 1px solid var(--red-dark); }
.di-fichiers { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.di-fichier { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r); background: var(--white); font-size: var(--fs-sm); }
.di-fichier img, .di-fichier canvas { width: 56px; height: 72px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); }
.di-fichier .di-nom { font-weight: 600; word-break: break-word; }
.di-fichier .di-statut { font-size: var(--fs-xs); color: var(--muted); }
.di-fichier .di-statut.ok { color: var(--teal-dark); font-weight: 600; }
.di-fichier .di-statut.ko { color: var(--red-dark); font-weight: 600; }
.di-fichier .di-statut.attention { color: #B8860B; font-weight: 600; }
.di-fichier button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: var(--fs-sm); padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm); transition: background .15s ease, color .15s ease; }
.di-fichier button:hover { background: var(--blush); color: var(--red-dark); }
.di-plustard { margin-top: var(--sp-3); color: var(--muted); }

/* ── Le bas de chaque écran ── */
.di-nav { display: flex; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-5); }
.di-nav .btn { min-width: 150px; }
.di-erreur { margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r); background: #FDECEA; border: 1px solid #F3C4C0; color: var(--red-dark); font-size: var(--fs-sm); font-weight: 600; }

/* ── La relecture et le mot de la fin ── */
.di-resume { display: flex; flex-direction: column; gap: var(--sp-3); }
.di-resume section { padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--white); font-size: var(--fs-sm); overflow-x: auto; }
.di-resume h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); color: var(--red-dark); }
.di-resume table { width: 100%; border-collapse: collapse; }
.di-resume td, .di-resume th { padding: var(--sp-2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.di-resume th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.di-resume tbody tr:last-child td { border-bottom: 0; }
.di-merci { padding: var(--sp-6); border: 1px solid var(--teal); border-radius: var(--r-lg); background: var(--teal-light); box-shadow: var(--shadow-sm); text-align: center; }
/* 11/09 : --teal-ink, pas --teal-dark — ce dernier ne s'éclaircit pas en thème
   sombre (2,8:1 sur le fond du remerciement). */
.di-merci h2 { color: var(--teal-ink); }
/* 11/09/2026 (Alex) : le bouton « Installer l'application » de la confirmation,
   posé par js/installer.js — le bloc reste caché si l'appareil ne peut pas installer. */
.di-merci-app { margin-top: var(--sp-4); }
.di-merci-app p { margin: 0 0 var(--sp-3); }

/* L'écran qui s'ouvre glisse d'un demi-pouce : on voit qu'on a changé
    d'écran, sans attendre. */
.di-bloc:not([hidden]) { animation: di-entre .28s ease backwards; }
@keyframes di-entre { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .di-bloc:not([hidden]) { animation: none; } }

@media (max-width: 640px) {
  .di-bloc { padding: var(--sp-4); border-radius: var(--r); }
  /* 08/09 : deux champs par rangée même sur téléphone (règle « côte à côte ») ;
     les champs longs gardent .plein et toute la largeur. */
  .di-grille, .di-ligne .di-grille { gap: 10px 8px; }
  .di-nav { flex-direction: column-reverse; }
  .di-nav .btn { width: 100%; }
  /* Au doigt, toute la case ouvre déjà le sélecteur : le bouton « Parcourir »
   ne ferait que rétrécir le texte, qui s'enroulait sur trois lignes. */
  .di-depot-bouton { display: none; }
  .di-depot { gap: var(--sp-3); }
}

/* 08/09 — L'EXEMPLE SE REPLIE (ordre d'Alex). Il montre au lieu d'expliquer,
   c'est precieux — mais il ne sert qu'UNE fois, et ses cinq lignes
   repoussaient le premier champ sous la ligne de flottaison a chaque ecran.
   Il reste a un geste, jamais plus loin. */
.di-pli { margin: 0 0 var(--sp-4); }
.di-pli > summary { display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 44px; padding: 0 var(--sp-1); font-size: var(--fs-sm); font-weight: 600;
  color: var(--red-dark); cursor: pointer; list-style: none; }
.di-pli > summary::-webkit-details-marker { display: none; }
.di-pli > summary::before { content: '+'; font-weight: 700; font-size: var(--fs-base); line-height: 1; }
.di-pli[open] > summary::before { content: '−'; }
.di-pli > summary:focus-visible { outline: none; border-radius: var(--r-sm); box-shadow: var(--ring); }
.di-pli .di-exemple { margin: 0; }

/* ── Les questions ajoutées depuis /gestion (10/09/2026) ── */
.di-ajouts { margin-top: var(--sp-5); }
.di-ajout-choix { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); padding: var(--sp-2) 0; }
.di-q small.di-aide-q { font-weight: 400; }
