/* « Le bulletin de paie, calculé devant vous » (page Paie) : à gauche, trois données à changer et le net qui suit ;
   à droite, le bulletin d'exemple avec les trois tableaux du PDF de l'appli (brut, cotisations, IR), le net à payer
   et les charges patronales. Un montant qui change s'éclaire un instant. */
.paie-sim { padding-block: var(--space-24); background: var(--papier); }
.paie-sim__grille { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; align-items: start; }

/* ── Les données ── */
.paie-sim__form { position: sticky; top: calc(var(--entete) + 32px); display: grid; gap: 16px; padding: 28px; border: 1px solid var(--filet);
  border-radius: var(--radius-feuille); background: #fff; box-shadow: var(--ombre-papier); }
.paie-sim__champ { display: grid; gap: 6px; font: 600 14px/1.3 var(--font-sans); color: var(--carbone-doux); }
.paie-sim__champ input, .paie-sim__champ select { width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--filet-fort); border-radius: var(--radius-papier);
  background: var(--papier); color: var(--carbone); font: 600 18px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.paie-sim__champ input:focus-visible, .paie-sim__champ select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--bic); }
.paie-sim__champ input[aria-invalid="true"] { border-color: var(--encre-retard); }
.paie-sim__resultat { display: grid; gap: 10px; margin-top: 4px; padding: 16px 18px; border-left: 3px solid var(--bic); border-radius: 0 var(--radius-papier) var(--radius-papier) 0;
  background: var(--bic-voile); }
.paie-sim__resultat p { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; }
.paie-sim__resultat span { font-size: 14.5px; color: var(--carbone-doux); }
.paie-sim__resultat strong { font-size: 17px; }
.paie-sim__resultat p:first-child strong { font-size: 24px; color: var(--bic-fonce); }
.paie-sim__note { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--carbone-doux); }

/* ── Le bulletin ── */
.bulletin { padding: 30px 32px 26px; border-radius: 3px; background: #fff; color: #20253b; font-size: 13.5px; box-shadow: var(--ombre-soulevee); }
.bulletin p { margin: 0; }
.bulletin__tete { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid #20253b; }
.bulletin__tete .chiffre { margin-top: 4px; font-size: 11.5px; color: #4a5070; }
.bulletin__societe { font: 800 16px/1.3 var(--font-sans); }
.bulletin__titre { text-align: right; }
.bulletin__titre p:first-child { font: 800 19px/1.2 var(--font-sans); letter-spacing: .02em; }
.bulletin__titre .chiffre { font-size: 13.5px; color: #20253b; }
.bulletin__salarie { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 4px 12px; margin: 14px 0 16px; padding: 12px 14px;
  border: 1px solid rgba(29, 35, 64, .18); border-radius: 4px; background: #f7f8fb; }
.bulletin__salarie dt { font-weight: 600; color: #4a5070; }
.bulletin__salarie dt:first-child { grid-column: 1 / -1; font: 700 11.5px/1.3 var(--font-mono); letter-spacing: .08em; color: #20253b; }
.bulletin__salarie dd:nth-of-type(1) { display: none; }
.bulletin__salarie dd { margin: 0; font-weight: 600; }

.bulletin__table { width: 100%; margin-top: 12px; border-collapse: collapse; }
.bulletin__table th { padding: 7px 9px; color: #fff; font: 700 11px/1.2 var(--font-mono); letter-spacing: .04em; text-align: left; }
.bulletin__table th:not(:first-child), .bulletin__table td:not(:first-child) { text-align: right; }
.bulletin__table--brut th { background: #2c4a8f; }
.bulletin__table--cotis th { background: #9b2c2c; }
.bulletin__table--ir th { background: #a5530f; }
.bulletin__table td { padding: 6px 9px; border: 1px solid rgba(29, 35, 64, .14); }
.bulletin__table td:nth-child(2) { color: #4a5070; font-size: 12.5px; }
.bulletin__table td:nth-child(3) { width: 112px; font-weight: 600; white-space: nowrap; }
.bulletin__table .total td { font-weight: 800; }
.bulletin__table--brut .total td { background: #e6ecf8; }
.bulletin__table--cotis .total td { background: #fbe4e4; }
.bulletin__table--ir .total td { background: #fdecd5; }
.bulletin__net { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 16px !important; padding: 14px 18px; border-radius: 6px;
  background: var(--sous-main); color: #fff; }
.bulletin__net span { font: 800 16px/1.2 var(--font-sans); letter-spacing: .04em; }
.bulletin__net strong { font-size: 22px; }
.bulletin__patron { margin-top: 12px !important; font-size: 12.5px; line-height: 1.6; color: #4a5070; }
.bulletin__patron strong { color: #20253b; }
.bulletin__pied { margin-top: 14px !important; padding-top: 10px; border-top: 1px solid rgba(29, 35, 64, .12); font-size: 11.5px; font-style: italic; line-height: 1.5;
  color: #6a7090; text-align: center; }

/* Un montant recalculé s'éclaire, puis l'éclat s'éteint (opacité seulement) */
[data-v] { position: relative; }
[data-v]::after { content: ""; position: absolute; inset: 1px; border-radius: 2px; background: rgba(31, 63, 176, .16); opacity: 0; pointer-events: none; }
.vient-de-changer::after { animation: eclat 1s ease-out; }
@keyframes eclat { 0% { opacity: 1; } 100% { opacity: 0; } }
.bulletin__net [data-v]::after { background: rgba(255, 255, 255, .25); }

@media (prefers-reduced-motion: reduce) {
  .vient-de-changer::after { animation: none; }
}
@media (max-width: 1000px) {
  .paie-sim__grille { grid-template-columns: minmax(0, 1fr); }
  .paie-sim__form { position: static; max-width: 560px; }
}
@media (max-width: 560px) {
  .paie-sim { padding-block: 64px; }
  .paie-sim__form { padding: 20px 18px; }
  .bulletin { margin-inline: calc(-1 * var(--gouttiere) + 4px); padding: 18px 12px 16px; font-size: 12.5px; }
  .bulletin__tete { flex-direction: column; gap: 8px; }
  .bulletin__titre { text-align: left; }
  .bulletin__salarie { grid-template-columns: auto minmax(0, 1fr); }
  .bulletin__table th { padding: 6px 5px; font-size: 9.5px; }
  .bulletin__table td { padding: 5px; }
  .bulletin__table td:nth-child(2) { font-size: 11px; }
  .bulletin__table td:nth-child(3) { width: 84px; }
  .bulletin__net { padding: 12px 14px; }
  .bulletin__net span { font-size: 14px; }
  .bulletin__net strong { font-size: 18px; }
}
