/* =====================================================================
   JALONS — Design system « Soleil doux »
   Source de vérité visuelle UNIQUE et AGNOSTIQUE.
   Importée par : le tunnel (public/index.html), et plus tard le gabarit du
   document et l'app. Ne contient AUCUNE mise en page spécifique à un écran
   du tunnel — seulement les tokens et les composants réutilisables.

   Grammaire de couleur (impérative) :
     vert  = droit / bonne nouvelle
     bleu  = action
     ambre = vigilance
   Jamais de rouge.
   ===================================================================== */

:root {
  /* — Palette chaude — */
  --paper:       #FFF6EC;   /* canvas abricot très doux */
  --paper-deep:  #EFE4D6;   /* fond derrière une feuille */
  --card:        #FFFFFF;
  --peach:       #FBE7D4;   /* bandeaux, chips */
  --peach-deep:  #A65332;
  --orange:      #E2854C;   /* marque + action primaire */
  --orange-deep: #C96E38;   /* survol primaire */
  --ink:         #45382E;   /* brun chaud, jamais noir pur */
  --ink-soft:    #7A6A5C;   /* texte secondaire */
  --line:        #EBD9C2;   /* lignes/pointillés chauds */

  /* — Grammaire sémantique — */
  --green:      #2F7D58;  --green-deep: #1F5E40;  --green-tint: #DEF0E4;
  --blue:       #44699C;                          --blue-tint:  #E3ECF7;
  --amber:      #956212;                          --amber-tint: #FBEDCF;

  /* — Typographie — */
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* — Échelle d'espacement — */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-8: 48px;

  /* — Rayons — */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px; --r-pill: 999px;

  /* — Ombres chaudes — */
  --shadow-card: 0 2px 4px rgba(105,75,45,.05), 0 8px 22px rgba(105,75,45,.07);
  --shadow-soft: 0 2px 6px rgba(105,75,45,.10);
  --shadow-lift: 0 12px 34px rgba(105,75,45,.12);
}

/* =====================================================================
   BASE — typographie et fondations partagées
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
.jl, body.jl {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.jl :where(svg) { display: block; }

/* Focus visible chaud (accessibilité) */
.jl :where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 6px;
}

/* =====================================================================
   MARQUE — bloc logo Jalons
   ===================================================================== */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 34px; height: 34px; flex: none; border-radius: 12px;
  background: var(--orange); color: #fff;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 800; line-height: 1;
}
.brand .name { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.brand .sub  { font-size: 12px; color: var(--peach-deep); font-weight: 700; margin-top: -2px; }

/* =====================================================================
   BOUTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid transparent; border-radius: var(--r-sm);
  font-family: var(--sans); font-weight: 800; font-size: 15.5px; line-height: 1.2;
  padding: 13px 22px; cursor: pointer; text-decoration: none;
  transition: background-color .16s, border-color .16s, color .16s, transform .16s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn--primary   { background: var(--orange); color: #fff; }
.btn--primary:hover { background: var(--orange-deep); color: #fff; }
.btn--secondary { background: var(--peach); color: var(--peach-deep); }
.btn--secondary:hover { background: #F6DBC1; }
.btn--ghost     { background: #fff; color: var(--peach-deep); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--orange); color: var(--orange-deep); }
.btn--link      { background: none; color: var(--ink-soft); padding: 8px 4px; border: 0; }
.btn--link:hover { color: var(--orange-deep); }
.btn--lg        { padding: 15px 28px; font-size: 16.5px; }
.btn--block     { width: 100%; }

/* =====================================================================
   CARTE générique
   ===================================================================== */
.card {
  background: var(--card); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-card);
}

/* =====================================================================
   BADGES (grammaire sémantique)
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; white-space: nowrap;
  padding: 5px 12px; border-radius: var(--r-pill);
}
.badge svg { width: 13px; height: 13px; }
.badge--green { background: var(--green); color: #fff; }
.badge--blue  { background: var(--blue-tint); color: var(--blue); }
.badge--amber { background: var(--amber-tint); color: var(--amber); }

/* Petite étiquette claire (en-tête, méta) */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
  color: var(--peach-deep); background: #fff;
  padding: 4px 12px; border-radius: var(--r-pill);
}
.tag svg { width: 14px; height: 14px; color: var(--orange); }

/* =====================================================================
   ENCADRÉS DOUX (callouts)
   ===================================================================== */
.note {
  border-radius: var(--r-md); padding: 10px 14px;
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.5; font-weight: 600;
}
.note .nic {
  width: 26px; height: 26px; flex: none; border-radius: var(--r-pill);
  display: grid; place-items: center; background: #fff;
}
.note strong { display: block; font-weight: 800; margin-bottom: 1px; }
.note--amber { background: var(--amber-tint); color: #6B4A10; }
.note--amber .nic { color: var(--amber); }
.note--blue  { background: var(--blue-tint); color: #34527C; }
.note--blue .nic { color: var(--blue); }
.note--green { background: var(--green-tint); color: var(--green-deep); }
.note--green .nic { color: var(--green); }

/* =====================================================================
   TITRE DE SECTION (puce icône + libellé)
   ===================================================================== */
.sec { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 800; color: var(--ink); }
.sec .sic {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--peach); color: var(--peach-deep);
  display: grid; place-items: center;
}
.sec .sic svg { width: 16px; height: 16px; }

/* =====================================================================
   PANNEAU « BONNE NOUVELLE » (le grand chiffre vert)
   ===================================================================== */
.goodnews {
  background: var(--green-tint); border-radius: var(--r-xl);
  padding: 16px 24px; display: flex; align-items: center; gap: 20px;
}
.goodnews .ic {
  width: 46px; height: 46px; flex: none; border-radius: var(--r-pill);
  background: var(--green); color: #fff; display: grid; place-items: center;
}
.goodnews .label { font-size: 12.5px; font-weight: 800; color: var(--green); }
.goodnews .big   { font-size: 31px; font-weight: 900; line-height: 1.08; letter-spacing: -.02em; color: var(--green-deep); }
.goodnews .big em { font-style: normal; font-size: 17px; font-weight: 800; color: var(--green); }
.goodnews .sub   { color: #3E6B52; font-size: 12.5px; font-weight: 600; margin-top: 2px; }

/* =====================================================================
   CHAMPS DE FORMULAIRE (styles réutilisables, sans agencement)
   ===================================================================== */
.field-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 0 0 7px; }
.input {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; background: #fff;
}
.input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--peach); }

/* =====================================================================
   COMPOSANTS DOCUMENT (SPEC hybride v2 — blocs riches du diagnostic)
   Rendus par jalons-render.js. Grammaire de couleur respectée :
   vert = droit/bonne nouvelle, bleu = action, ambre = vigilance.
   Mobile-safe : cartes empilables, tableaux qui défilent sans casser.
   ===================================================================== */

/* — Callout (encadré sémantique) — */
.callout {
  border: 1.5px solid var(--line); border-left-width: 5px;
  border-radius: var(--r-md); background: var(--card);
  padding: var(--sp-4) var(--sp-5); margin: var(--sp-4) 0;
  box-shadow: var(--shadow-soft);
}
.callout-titre { font-weight: 800; margin: 0 0 var(--sp-2); }
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.callout--risque        { border-left-color: var(--amber); background: var(--amber-tint); }
.callout--risque .callout-titre { color: var(--amber); }
.callout--action        { border-left-color: var(--blue);  background: var(--blue-tint); }
.callout--action .callout-titre { color: var(--blue); }
.callout--bonne-nouvelle{ border-left-color: var(--green); background: var(--green-tint); }
.callout--bonne-nouvelle .callout-titre { color: var(--green-deep); }
.callout--info          { border-left-color: var(--orange); background: var(--peach); }
.callout--info .callout-titre { color: var(--peach-deep); }

/* — Droits / gains (tableau argent) — */
.droits, .frise { margin: var(--sp-5) 0; }
.droits-titre, .frise-titre {
  font-weight: 800; font-size: 17px; margin: 0 0 var(--sp-3); color: var(--ink);
}
.droits .tw, .frise .tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.droits table, .frise table {
  width: 100%; border-collapse: collapse; min-width: 420px;
  background: var(--card); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.droits th, .frise th {
  text-align: left; font-weight: 800; font-size: 13px;
  padding: 11px 14px; color: #fff; background: var(--green);
}
.frise th { background: var(--blue); }
.droits td, .frise td {
  padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14.5px; vertical-align: top;
}
.droits tbody tr:nth-child(even), .frise tbody tr:nth-child(even) { background: #FCF4EA; }
.droits td:nth-child(2) { font-weight: 800; color: var(--green-deep); white-space: nowrap; }
/* Frise : 1re colonne = rail temporel (période en bleu, marqueur d'étape). */
.frise td:first-child {
  font-weight: 800; color: var(--blue); white-space: nowrap;
  border-left: 3px solid var(--blue);
}
.frise tbody tr:first-child td:first-child { border-top-left-radius: var(--r-sm); }
/* Ligne « Total potentiel » : l'accroche chiffrée, lue comme une bonne nouvelle. */
.droits p {
  margin: var(--sp-3) 0 0; padding: 10px 14px;
  background: var(--green-tint); border-radius: var(--r-md);
  font-size: 15px; color: var(--green-deep); text-align: right;
}
.droits p strong { color: var(--green-deep); }

/* — Courrier (carte distincte) — */
.courrier-card {
  border: 1.5px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--shadow-card);
  padding: var(--sp-5); margin: var(--sp-5) 0;
}
.courrier-titre {
  font-weight: 800; font-size: 16px; color: var(--blue);
  padding-bottom: var(--sp-2); margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.courrier-dest { font-size: 13px; color: var(--ink-soft); margin-bottom: var(--sp-3); }
.courrier-body { font-size: 14.5px; line-height: 1.6; }
.courrier-body > :first-child { margin-top: 0; }
.courrier-body > :last-child { margin-bottom: 0; }
/* Bouton « Copier » (coin haut-droit des cartes courrier et de la frise). */
.courrier-card, .frise { position: relative; }
.copy-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-family: var(--sans); font-size: 12.5px; font-weight: 700;
  color: var(--blue); background: var(--blue-tint);
  border: 1px solid var(--blue); border-radius: var(--r-pill);
  padding: 4px 12px; cursor: pointer; line-height: 1.4;
}
.copy-btn:hover { background: var(--blue); color: #fff; }
.copy-btn.is-done { background: var(--green); border-color: var(--green); color: #fff; }
.frise .copy-btn { top: 0; right: 0; }

/* Champ à compléter par l'utilisateur : surligné ambre, visible d'un coup d'œil. */
.fillin {
  background: var(--amber-tint); color: var(--amber);
  font-weight: 700; border-radius: 5px; padding: 0 5px;
  border-bottom: 2px solid var(--amber); white-space: nowrap;
}

/* — Lecture à voix haute (encadré calme) — */
.voix-haute {
  background: var(--peach); border-radius: var(--r-lg);
  padding: var(--sp-5); margin: var(--sp-5) 0;
}
.voix-haute-label {
  font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--peach-deep); margin-bottom: var(--sp-2);
}
.voix-haute-body { font-size: 16px; line-height: 1.7; color: var(--ink); }
.voix-haute-body > :first-child { margin-top: 0; }
.voix-haute-body > :last-child { margin-bottom: 0; }

/* — Checklist stylée — */
.checklist { margin: var(--sp-5) 0; }
.checklist-titre { font-weight: 800; font-size: 17px; margin: 0 0 var(--sp-3); }
.checklist-list { list-style: none; margin: 0; padding: 0; }
.check-item {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--card); margin-bottom: var(--sp-2); box-shadow: var(--shadow-soft);
}
.check-box {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--blue); color: #fff; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; line-height: 1; margin-top: 1px;
}
.check-item.is-done .check-box { background: var(--green); border-color: var(--green); }
.check-item.is-done .check-main { color: var(--ink-soft); }
.check-main { flex: 1; font-size: 14.5px; }
.check-ech {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--blue); margin-top: 2px;
}
