/* Calculateur TF / TG — complète legal_v2.css (en-tête, pied, typographie,
   sections .lg-sec) avec le formulaire, les résultats et le tableau des
   moyennes par secteur. Mêmes jetons de couleur (--lg-*). */

/* Page outil : l'ouverture est plus compacte que celle des pages légales,
   pour que le calculateur apparaisse dès l'arrivée sur la page. */
.ct .lg-hero { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(32px, 4vw, 48px); }
.ct .lg-fil { margin-bottom: 24px; }
.ct .lg-titre { max-width: 22ch; font-size: clamp(36px, 5vw, 64px); line-height: 1.04; }
.ct .lg-lead { max-width: 52ch; margin-top: 20px; font-size: clamp(18px, calc(14px + .6vw), 22px); }
.ct .lg-meta { margin-top: 24px; }

/* ── Calculateur ─────────────────────────────────────────────────────── */
.ct-outil { padding: 0 24px clamp(80px, 10vw, 128px); }
.ct-outil-in {
  max-width: 1152px; margin: 0 auto;
  background: var(--lg-fond); border-radius: 32px;
  padding: clamp(24px, 4vw, 48px);
  display: grid; gap: clamp(28px, 4vw, 48px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: start;
}

.ct-champs { display: grid; gap: 20px; }
.ct-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ct-duo + .ct-aide { margin-top: -12px; }
.ct-champ label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.ct-champ input, .ct-champ select {
  width: 100%; height: 54px; padding: 0 18px;
  border: 1px solid var(--lg-trait); border-radius: 14px; background: #fff;
  font-family: inherit; font-size: 17px; font-weight: 500; line-height: 1; color: var(--lg-noir);
  font-variant-numeric: tabular-nums;
  transition: border-color .2s, box-shadow .2s;
}
.ct-champ select {
  -webkit-appearance: none; appearance: none; padding-right: 44px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E") no-repeat right 18px center;
}
.ct-champ input::placeholder { color: #aeaeb2; font-weight: 400; }
.ct-champ input:focus, .ct-champ select:focus {
  outline: none; border-color: var(--lg-orange);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, .16);
}
.ct-champ input[aria-invalid="true"] { border-color: #c2410c; }
.ct-aide { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--lg-gris); }

/* ── Résultats ───────────────────────────────────────────────────────── */
.ct-resultats { display: grid; gap: 12px; }
.ct-res { background: #fff; border-radius: 24px; padding: 22px 26px 20px; }
.ct-res-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ct-res-nom { font-size: 15px; font-weight: 600; color: var(--lg-gris); }
.ct-res-sigle { font-size: 13px; font-weight: 600; color: var(--lg-gris-clair); }
.ct-res-valeur {
  margin: 4px 0 2px; font-size: clamp(44px, 5.4vw, 64px); font-weight: 200;
  line-height: 1.08; letter-spacing: -.05em; font-variant-numeric: tabular-nums;
}
.ct-res.est-vide .ct-res-valeur { color: #c7c7cc; }
.ct-res-unite { font-size: 14px; color: var(--lg-gris); }

/* Jauge : le trait gris au milieu est la moyenne du secteur, l'échelle
   va de zéro au double de cette moyenne. */
.ct-jauge { position: relative; height: 6px; margin: 18px 0 10px; border-radius: 3px; background: #e8e8ed; }
.ct-jauge-rempli {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px;
  background: var(--lg-noir);
  transition: width .6s var(--lg-courbe), background-color .3s;
}
.ct-jauge-moyenne {
  position: absolute; left: 50%; top: -5px; bottom: -5px; width: 2px; margin-left: -1px;
  border-radius: 1px; background: var(--lg-gris-clair);
}
.ct-res.est-au-dessus .ct-jauge-rempli { background: var(--lg-orange); }
.ct-comparaison {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
  min-height: 20px; font-size: 14px; color: var(--lg-gris); font-variant-numeric: tabular-nums;
}
.ct-verdict { font-weight: 600; color: var(--lg-noir); }
.ct-res.est-au-dessus .ct-verdict { color: #c2410c; }

.lg2 .ct-pousse {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-top: 4px; padding: 20px 26px; border-radius: 24px;
  background: var(--lg-noir); color: #f5f5f7; font-size: 15px; line-height: 1.45;
}
.lg2 .ct-pousse:hover { background: #000; color: #f5f5f7; }
.ct-pousse-lien { font-weight: 600; color: var(--lg-orange); white-space: nowrap; }
.ct-pousse-lien::after { content: ' →'; }

/* ── Contenu ─────────────────────────────────────────────────────────── */
.lg-sec .ct-formule {
  margin: 0 0 24px; padding: 18px 22px; border-radius: 18px; background: var(--lg-fond);
  font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--lg-noir);
}
.ct-formule-sigle { color: var(--lg-orange-fonce); }
.lg-sec .ct-source { font-size: 14px; color: var(--lg-gris); }

.ct-tab-hote { margin: 0 0 24px; background: var(--lg-fond); border-radius: 28px; overflow-x: auto; }
.ct-tab { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ct-tab th, .ct-tab td { padding: 14px 16px; text-align: right; vertical-align: top; }
.ct-tab th:first-child { text-align: left; padding-left: 28px; }
.ct-tab th:last-child, .ct-tab td:last-child { padding-right: 28px; }
.ct-tab thead th { padding-top: 22px; font-size: 13px; font-weight: 600; color: var(--lg-gris-clair); }
.ct-tab tbody tr, .ct-tab tfoot tr { border-top: 1px solid var(--lg-trait); }
.ct-tab tbody th { font-size: 15px; font-weight: 600; color: var(--lg-noir); }
.ct-tab td { font-size: 15px; color: var(--lg-texte); }
.ct-tab tfoot th, .ct-tab tfoot td { padding-bottom: 22px; font-size: 15px; font-weight: 600; color: var(--lg-noir); }
.ct-tab-code {
  display: inline-block; min-width: 22px; margin-right: 10px;
  font-size: 13px; color: var(--lg-orange-fonce);
}
.ct-tab-detail { display: block; margin: 2px 0 0 32px; font-size: 13px; font-weight: 400; line-height: 1.4; color: var(--lg-gris); }

@media (max-width: 900px) {
  .ct-outil-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ct-outil { padding: 0 16px 72px; }
  .ct-outil-in { padding: 20px; border-radius: 24px; }
  .ct-res { padding: 20px 20px 18px; }
  .ct-tab th:first-child { padding-left: 20px; }
  .ct-tab th:last-child, .ct-tab td:last-child { padding-right: 20px; }
  .ct-tab th, .ct-tab td { padding-left: 10px; padding-right: 10px; }
  .ct-tab-detail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-jauge-rempli { transition: none; }
}
@media print {
  .ct-outil, .ct-pousse { display: none !important; }
}
