/* Outil Ri7 · devis et conventions VIA© · tokens recopiés de charte/ri7-liquid.css (la charte ne se modifie pas ici).
   Présentation sobre, comme un programme imprimé : des titres hiérarchisés, une ligne par élément, aucune carte. */

@font-face { font-family: "Poppins"; font-weight: 300; font-style: normal; font-display: swap; src: url("fonts/Poppins-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/Poppins-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/Poppins-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/Poppins-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/Poppins-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/Poppins-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Code"; font-weight: 300 700; font-style: normal; font-display: swap; src: url("fonts/FiraCode-VF.woff2") format("woff2"); }

/* Tokens de la charte (charte/ri7-liquid.css, :root) */
:root {
  --ink: #14151F; --ink-2: #2B2E3A; --ink-3: #5C6070; --ink-4: #8B90A0; --ink-5: #C9CCDA;
  --line: rgba(20,21,31,0.08); --paper: #FFFFFF; --bg: #F3F4FA;
  --deep: #070A1A; --deep-2: #0C1026;
  --blue: #0030B8; --blue-deep: #001B6D; --blue-vif: #0038E3; --blue-200: #B3C3F7; --blue-50: #EEF2FF;
  --violet: #8600D4; --violet-200: #D9B8FF; --violet-50: #F6EEFF;
  --jaune: #FFD84D; --surligneur: #FBF990;
  --success: #0E7C5B; --error: #D62828;
  --grad-brand: linear-gradient(135deg, #0030B8 0%, #4A1BD0 52%, #8600D4 100%);
  --r-md: 20px; --r-lg: 32px; --r-pill: 999px;
  --mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Page */
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* l'attribut l'emporte sur les grilles et les flex */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
.page { max-width: 880px; margin: 0 auto; padding: 0 16px 80px; }
a { color: var(--blue); }
a:hover { color: var(--blue-vif); }

/* En-tête */
.entete { border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.entete .page { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.lockup { display: inline-flex; align-items: center; gap: 0.32em; font-family: var(--mono); font-weight: 400; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); line-height: 1; white-space: nowrap; text-decoration: none; }
.lockup b { font-weight: 700; }
.lockup img { height: 1.55em; width: auto; display: block; }
.entete .outil { font-size: 14px; color: var(--ink-3); }
.entete .compte { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; margin-left: auto; }
.entete .compte .utilisateur { color: var(--ink-2); font-weight: 600; }
.entete .compte form { margin: 0; }
button.lien { font: inherit; color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
button.lien:hover { color: var(--blue-vif); }

/* Titres */
h1 { font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; margin: 44px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
h3 { font-size: 17px; font-weight: 600; margin: 24px 0 8px; }
.chapeau { color: var(--ink-3); margin: 0 0 8px; }
p { margin: 0 0 12px; }

/* Étapes du dossier, sur une ligne */
.etapes { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--ink-4); }
.etapes li { white-space: nowrap; }
.etapes li.faite { color: var(--success); }
.etapes li.actuelle { color: var(--blue); font-weight: 600; }

/* Listes : une ligne par élément */
.lignes { list-style: none; margin: 0; padding: 0; }
.lignes li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.lignes li:last-child { border-bottom: 0; }
.lignes .detail { display: block; font-size: 14px; color: var(--ink-3); }
ol.numerotee { margin: 0; padding-left: 22px; }
ol.numerotee li { padding: 6px 0; }

/* Définitions (financeur, accord) */
dl.faits { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 8px 24px; margin: 0; }
dl.faits dt { color: var(--ink-3); font-size: 14.5px; }
dl.faits dd { margin: 0; font-weight: 500; }

/* Tableaux */
.tableau { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink-5); }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.montant, th.montant { text-align: right; white-space: nowrap; }
tr.illisible td { color: var(--ink-4); font-style: italic; }
.numero { font-family: var(--mono); font-size: 14px; white-space: nowrap; }

/* Montant principal */
.montant-principal { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--blue); margin: 0 0 4px; }
.montant-principal .sur { font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--ink-3); }

/* Messages et alertes : un filet de couleur à gauche, pas de carte */
.message { border-left: 3px solid var(--blue); padding: 8px 0 8px 16px; margin: 0 0 12px; }
.message.erreur, .alerte.urgente { border-left-color: var(--error); }
.message.erreur { color: var(--error); font-weight: 500; }
.alerte { border-left: 3px solid var(--jaune); padding: 8px 0 8px 16px; margin: 0 0 10px; }
.alerte.urgente { color: var(--ink); }
.alerte .nature { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #6B5400; }
.alerte.urgente .nature { color: var(--error); }
.attente { border-left: 3px solid var(--blue); padding: 8px 0 8px 16px; margin: 24px 0 12px; color: var(--ink-2); }

/* Formulaire */
form.formulaire fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
form.formulaire legend { padding: 0; }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ.large { grid-column: 1 / -1; }
.champ label, .question { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.aide { font-size: 12.5px; color: var(--ink-4); }
.aide.trouve { color: var(--success); font-weight: 500; }
.aide.erreur { color: var(--error); font-weight: 500; }
input[type=text], input[type=number], input[type=date], input[type=password], select {
  font-family: var(--sans); font-size: 15px; color: var(--ink); height: 48px; border-radius: 14px;
  border: 1px solid rgba(20,21,31,0.12); background: rgba(255,255,255,0.85); padding: 0 16px; width: 100%; min-width: 0;
}
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,56,227,0.14); }
.choix { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 4px; }
.choix label, .case { display: inline-flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 400; color: var(--ink-2); cursor: pointer; }
input[type=radio], input[type=checkbox] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex: 0 0 auto; }
.question-bloc { margin: 0 0 18px; }
.aide.registre { color: var(--violet); font-weight: 500; }
.recherche { display: flex; gap: 10px; align-items: center; }
.recherche input { flex: 1 1 auto; }
.recherche .bouton { flex: 0 0 auto; padding: 12px 20px; }
.session-unique { margin: 0 0 4px; }
[data-idcc-choix] .bouton.discret { padding: 2px 0; font-size: 13px; }

/* Comptes : formulaires étroits, mot de passe provisoire affiché une fois */
.formulaire.etroit { max-width: 420px; }
.formulaire.etroit .champ { margin-bottom: 16px; }
.provisoire { border-left: 3px solid var(--violet); padding: 8px 0 8px 16px; margin: 0 0 24px; }
.provisoire code { font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink); background: var(--violet-50); padding: 2px 10px; border-radius: 8px; user-select: all; word-break: break-all; }
.confirmation { border-left: 3px solid var(--error); padding: 8px 0 8px 16px; margin: 0 0 24px; }
.confirmation .actions { margin-top: 12px; }
td.actions-ligne { white-space: nowrap; }
td.actions-ligne form { display: inline; margin: 0 14px 0 0; }
.etat-inactif { color: var(--ink-4); }

/* Compléments facultatifs : un bloc replié, un filet comme les titres, pas de carte */
details.complements { margin-top: 36px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
details.complements summary { cursor: pointer; font-weight: 600; color: var(--blue); }
details.complements[open] summary { margin-bottom: 16px; }
details.complements h3 { margin-top: 28px; }

/* Recherche de l'accueil : sur une ligne, le bouton aligné sur les champs */
form.filtre { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; gap: 12px 16px; align-items: end; margin: 0 0 24px; }
form.filtre .actions { margin-top: 0; }
@media (max-width: 720px) { form.filtre { grid-template-columns: 1fr; } }

/* Suppression d'un dossier : repliée en bas de page, un filet comme les compléments */
details.suppression { margin-top: 48px; border-top: 1px solid var(--line); padding: 14px 0; }
details.suppression summary { cursor: pointer; font-weight: 600; color: var(--error); }
details.suppression[open] summary { margin-bottom: 12px; }

/* Lignes répétées (stagiaires, formateurs) */
.ligne-saisie { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ligne-saisie .champ.dirigeant { grid-column: span 2; }
.ligne-saisie .retirer { grid-column: 1 / -1; justify-self: start; }

/* Boutons (charte : .ui-btn) */
.bouton { font-family: var(--sans); font-weight: 600; font-size: 16px; padding: 13px 24px; border-radius: var(--r-pill); border: 0; display: inline-flex; align-items: center; gap: 10px; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; transition: filter .2s ease, transform .2s ease; }
.bouton.principal { background: var(--grad-brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 12px 28px -12px rgba(74,27,208,0.7); }
.bouton.principal:hover { filter: brightness(1.08); color: #fff; }
.bouton.principal:disabled { opacity: 0.42; box-shadow: none; cursor: not-allowed; filter: none; }
.bouton.secondaire { background: var(--paper); color: var(--blue); border: 1px solid var(--blue-200); }
.bouton.discret { background: transparent; color: var(--blue); padding: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 28px; }
.actions form { margin: 0; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; margin-top: 36px; }
  .entete { margin-bottom: 28px; }
  .champs, .ligne-saisie { grid-template-columns: 1fr; }
  .ligne-saisie .champ.dirigeant { grid-column: auto; }
  dl.faits { grid-template-columns: 1fr; gap: 2px; }
  dl.faits dd { margin-bottom: 10px; }
  .montant-principal { font-size: 24px; }
  .bouton { white-space: normal; text-align: center; }
  table.empilable thead { display: none; }
  table.empilable tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.empilable td { display: block; padding: 2px 0; border: 0; text-align: left; }
  table.empilable td[data-titre]::before { content: attr(data-titre) " : "; color: var(--ink-3); font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) { .bouton { transition: none; } }
