/* ═══════════════ STUDIA SUP — FRAIS DE SCOLARITÉ ═══════════════
   Partagé par frais-scolarite.html et la section Frais de l'accueil
   React (importé dans web/src/index.css, couche « vanille ») : une
   seule définition pour les deux mondes — comme bourse.css.

   Les chiffres viennent de js/frais-donnees.js ; ici on ne pose que
   la forme. Le parti pris : une page de lecture calme, où le
   simulateur répond à la seule vraie question des familles —
   « combien faut-il prévoir, et quand ? ». */

.fr { padding-block: clamp(48px, 8vh, 84px); }
.fr__wrap { max-width: 980px; margin: 0 auto; padding-inline: 24px; }

/* ── Le simulateur ───────────────────────────────────────────── */
.fr-simu {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  padding: clamp(22px, 4vw, 34px);
}
.fr-simu__titre {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem); margin-bottom: 6px;
}
.fr-simu__sous {
  font-size: .92rem; color: rgba(247,249,248,.65); margin-bottom: 18px;
}

.fr-simu__controles {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 20px;
}
.fr-select {
  min-height: 48px; padding: 10px 40px 10px 14px;
  background: rgba(11,18,14,.7); color: var(--white);
  border: 1.5px solid rgba(255,255,255,.2); border-radius: 12px;
  font-size: .95rem; font-family: var(--display); font-weight: 700;
  appearance: none; cursor: pointer; color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23F7F9F8' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.fr-select:focus { outline: none; border-color: var(--green); }

.fr-seg {
  display: inline-flex; gap: 3px; padding: 4px; border-radius: 14px;
  background: rgba(11,18,14,.55); border: 1px solid rgba(255,255,255,.14);
}
.fr-seg__btn {
  cursor: pointer; background: none; border: none; border-radius: 10px;
  padding: 9px 15px; font-family: var(--display); font-weight: 700; font-size: .84rem;
  color: rgba(247,249,248,.65);
  transition: background .18s ease, color .18s ease;
}
.fr-seg__btn:hover { color: var(--white); }
.fr-seg__btn.is-actif { background: var(--green); color: #fff; }

/* ── Le résultat : l'échéancier et le coût de rentrée ─────────── */
.fr-simu__resultat {
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: stretch;
}
.fr-panneau {
  background: rgba(11,18,14,.45);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 18px 20px;
}
.fr-panneau__titre {
  font-family: var(--display); font-weight: 700; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(247,249,248,.55); margin-bottom: 12px;
}
.fr-ligne {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 7px 0; font-size: .92rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.fr-ligne:last-child { border-bottom: none; }
.fr-ligne__quoi { color: rgba(247,249,248,.8); }
.fr-ligne__quand { display: block; font-size: .76rem; color: rgba(247,249,248,.45); }
.fr-ligne__combien {
  font-family: var(--display); font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fr-ligne--totale { border-top: 1px solid rgba(255,255,255,.16); margin-top: 4px; padding-top: 11px; }
.fr-ligne--totale .fr-ligne__combien { color: var(--green); font-size: 1.05rem; }
.fr-remise {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 99px;
  background: rgba(46,158,79,.16); color: #7ede9c;
  border: 1px solid rgba(46,158,79,.45); font-size: .72rem; font-weight: 700;
}

/* Le « combien prévoir à la rentrée » — la carte que les familles
   photographient. Elle se distingue du reste. */
.fr-panneau--rentree {
  background: linear-gradient(160deg, rgba(46,158,79,.14) 0%, rgba(46,158,79,.05) 100%);
  border-color: rgba(46,158,79,.4);
  display: flex; flex-direction: column;
}
.fr-rentree__total {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.5rem, 3.4vw, 2rem); color: var(--white);
  margin: 2px 0 4px; font-variant-numeric: tabular-nums;
}
.fr-rentree__detail { font-size: .8rem; line-height: 1.6; color: rgba(247,249,248,.6); }
.fr-rentree__note {
  margin-top: auto; padding-top: 12px;
  font-size: .76rem; line-height: 1.55; color: rgba(242,194,48,.85);
}

/* ── La grille complète ──────────────────────────────────────── */
.fr-table-wrap {
  overflow-x: auto;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
}
.fr-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.fr-table th {
  text-align: left; padding: 13px 16px;
  font-family: var(--display); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(247,249,248,.55);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.fr-table td {
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.05);
  font-variant-numeric: tabular-nums;
}
.fr-table tr:last-child td { border-bottom: none; }
.fr-table .fr-niveau { font-family: var(--display); font-weight: 700; white-space: nowrap; }
.fr-table .fr-mini { display: block; font-size: .72rem; color: rgba(247,249,248,.45); }

/* Deux axes de couleur : la ligne dit le cycle, la colonne le mode
   de paiement. La pastille devant le niveau porte la teinte du cycle,
   un fond à peine perceptible regroupe les lignes de la même famille. */
.fr-cycle {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 9px; vertical-align: 1px;
}
.fr-t--dut { background: rgba(94,234,212,.05); }
.fr-t--dut .fr-cycle { background: #5EEAD4; }
.fr-t--dut .fr-niveau { color: #99F6E4; }
.fr-t--lic { background: rgba(74,222,128,.055); }
.fr-t--lic .fr-cycle { background: #4ADE80; }
.fr-t--lic .fr-niveau { color: #A7F3D0; }
.fr-t--mas { background: rgba(242,194,48,.05); }
.fr-t--mas .fr-cycle { background: #F2C230; }
.fr-t--mas .fr-niveau { color: #F0DDA0; }
.fr-table th.fr-c--comptant, .fr-table td.fr-c--comptant { color: #7EDE9C; }
.fr-table th.fr-c--tranches, .fr-table td.fr-c--tranches { color: #F2C230; }
.fr-table th.fr-c--mensu,    .fr-table td.fr-c--mensu    { color: #7DD8C8; }
.fr-table td.fr-c--comptant .fr-mini { color: rgba(126,222,156,.6); }

/* ── La section de l'accueil (web/src/sections/Frais.jsx) ─────── */
/* L'en-tête suit le canon des autres sections de l'accueil : centré,
   avec le point vert qui pulse devant l'eyebrow. */
.fr__tete {
  max-width: 780px; margin: 0 auto clamp(28px, 5vh, 44px);
  text-align: center;
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.16,1,.3,1);
}
.fr__tete.is-in { opacity: 1; transform: none; }
.fr-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: .74rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--green); margin-bottom: 8px;
}
.fr-eyebrow__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(46,158,79,.7);
  animation: fr-ping 2.4s ease-out infinite;
}
@keyframes fr-ping {
  0%   { box-shadow: 0 0 0 0 rgba(46,158,79,.7); }
  70%  { box-shadow: 0 0 0 9px rgba(46,158,79,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,158,79,0); }
}
@media (prefers-reduced-motion: reduce) {
  .fr-eyebrow__dot { animation: none; }
  .fr__tete { opacity: 1; transform: none; transition: none; }
}
.fr-titre {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem); line-height: 1.15;
  margin-bottom: 10px;
}
.fr-sous {
  font-size: clamp(.94rem, 1.7vw, 1rem); line-height: 1.65;
  color: rgba(247,249,248,.65); max-width: 62ch; margin-inline: auto;
}
.fr-simu__annuel { font-size: .92rem; color: rgba(247,249,248,.65); }
.fr-simu__annuel strong { font-family: var(--display); color: var(--white); }

/* Les trois façons de payer, côte à côte : on compare d'un regard. */
.fr-options {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}
.fr-option {
  background: rgba(11,18,14,.45);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 16px 18px;
}
.fr-option__nom {
  font-family: var(--display); font-weight: 700; font-size: .78rem;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--green); margin-bottom: 8px;
}
.fr-option__val {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-variant-numeric: tabular-nums; margin-bottom: 6px;
}
.fr-option__det { font-size: .76rem; line-height: 1.5; color: rgba(247,249,248,.5); }

.fr-simu__rentree {
  font-size: .88rem; line-height: 1.6; color: rgba(247,249,248,.65);
  padding: 12px 16px; border-radius: 12px;
  background: rgba(46,158,79,.1); border: 1px solid rgba(46,158,79,.35);
  margin-bottom: 18px;
}
.fr-simu__rentree strong { font-family: var(--display); color: var(--white); }
/* Le bouton emprunte .fil-btn--primary, dont le fond vient de
   var(--accent) — définie seulement dans les panneaux filières. Ici on
   la fournit, et le texte passe en blanc : le vert de la charte est
   trop profond pour l'encre sombre prévue sur l'accent doré. Au survol,
   le remplissage clair reprend l'encre sombre d'origine. */
.fr-simu__cta.fil-btn--primary {
  display: inline-flex; --accent: var(--green); color: #fff;
}
@media (hover: hover) {
  .fr-simu__cta.fil-btn--primary:hover { color: #07100b; }
}

/* ── Tablette ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .fr-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* La troisième carte prend toute la largeur plutôt que d'orpheliner
     une colonne vide à côté d'elle. */
  .fr-options > :last-child { grid-column: 1 / -1; }
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .fr { padding-block: clamp(36px, 6vh, 60px); }
  .fr__wrap { padding-inline: 16px; }
  .fr-simu { padding: 18px 16px; border-radius: 16px; }
  .fr-simu__resultat { grid-template-columns: 1fr; }
  .fr-simu__controles { align-items: stretch; flex-direction: column; gap: 10px; }
  .fr-select { width: 100%; }
  .fr-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fr-seg__btn { padding-inline: 6px; font-size: .78rem; }
  .fr-options { grid-template-columns: 1fr; }
  .fr-options > :last-child { grid-column: auto; }
  .fr-panneau { padding: 15px 16px; }
  /* Libellé à gauche, montant à droite — le montant ne se coupe jamais,
     c'est le libellé qui passe à la ligne s'il manque de place. */
  .fr-ligne { gap: 10px; }
  .fr-ligne__quoi { flex: 1 1 auto; min-width: 0; }
  .fr-ligne__combien { flex: 0 0 auto; }
  .fr-simu__cta { width: 100%; }

  /* Le tableau devient une carte par niveau : l'en-tête de colonne
     revient devant chaque montant (data-label), et plus rien ne défile
     latéralement. */
  .fr-table-wrap {
    overflow-x: visible; background: none; border: 0; border-radius: 0;
  }
  .fr-table { min-width: 0; display: block; font-size: .9rem; }
  .fr-table thead { display: none; }
  .fr-table tbody, .fr-table tr, .fr-table td { display: block; }
  .fr-table tr {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px; overflow: hidden;
    margin-bottom: 12px;
  }
  .fr-table tbody tr:last-child { margin-bottom: 0; }
  .fr-table td {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 14px; padding: 10px 15px;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .fr-table tr td:last-child { border-bottom: none; }
  .fr-table td::before {
    content: attr(data-label);
    flex: 0 0 auto; max-width: 48%;
    font-family: var(--display); font-size: .72rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
    color: rgba(247,249,248,.5);
  }
  .fr-table .fr-val { text-align: right; font-weight: 700; }
  .fr-table .fr-mini { text-align: right; font-weight: 500; }
  /* Le niveau devient l'en-tête de la carte. */
  .fr-table td.fr-niveau {
    justify-content: flex-start; gap: 0;
    padding: 12px 15px; font-size: 1rem;
    background: rgba(255,255,255,.04);
    border-bottom-color: rgba(255,255,255,.1);
  }
  .fr-table td.fr-niveau::before { content: none; }
  /* Les fonds de cycle s'appliquent à la carte entière. */
  .fr-t--dut, .fr-t--lic, .fr-t--mas { background-clip: padding-box; }
}

@media (max-width: 380px) {
  .fr__wrap { padding-inline: 13px; }
  .fr-simu { padding: 16px 13px; }
  .fr-seg__btn { font-size: .72rem; padding: 9px 4px; }
  .fr-table td { padding-inline: 13px; }
  .fr-table td::before { font-size: .68rem; max-width: 44%; }
}
