/* Socle de la démo TRS Courtage : couleurs et typographies du site trscourtage.com, barre, étapes, composants communs.
   Bleu : ce que la machine a fait. Losange pétrole : ce que le courtier décide.
   Vert : couvert. Ambre : point de vigilance. Rouge : exclu. */
:root {
  --papier: #eef3f4;
  --feuille: #ffffff;
  --petrole: #153a44;
  --petrole-2: #214f5d;
  --petrole-voile: #e3ecee;
  --bleu: #318eaa;
  --bleu-texte: #22708a;
  --bleu-voile: #e5f2f6;
  --vert: #2dbc9a;
  --vert-texte: #137a61;
  --vert-voile: #e1f5ef;
  --ambre: #d4952a;
  --ambre-texte: #8f5508;
  --ambre-voile: #fcf1dc;
  --rouge: #b23a30;
  --rouge-voile: #fbe8e5;
  --encre: #182a30;
  --encre-2: #55676d;
  --filet: #d8e2e5;
  --filet-fort: #b3c5ca;
  --police: 'Roboto', system-ui, sans-serif;
  --police-titre: 'Bellefair', Georgia, serif;
  --police-texte: Georgia, 'Times New Roman', serif;
  --rayon: 10px;
  --rayon-petit: 6px;
  --ombre: 0 1px 2px rgba(21, 58, 68, 0.06), 0 10px 28px rgba(21, 58, 68, 0.08);
  --largeur: 1280px;
  --marge: clamp(16px, 3vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 16px/1.5 var(--police);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--police-titre); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: 0.005em; }
sup { font-size: 0.62em; line-height: 0; vertical-align: 0.48em; margin-left: 0.04em; }
p, ul, ol { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
mark { background: none; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; border-radius: 3px; }

.evitement { position: absolute; left: -9999px; top: 8px; background: var(--feuille); padding: 8px 12px; z-index: 10; }
.evitement:focus { left: 8px; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px var(--marge); }

/* Barre du haut, pétrole comme l'en-tête du site */
.barre {
  display: flex; align-items: center; gap: 28px;
  padding: 0 var(--marge);
  min-height: 60px;
  background: var(--petrole);
  color: #fff;
  position: sticky; top: 0; z-index: 5;
}
.barre__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.barre__logo img { border-radius: 7px; }
.barre__marque { font-family: var(--police-titre); font-size: 24px; letter-spacing: 0.02em; }
.onglets { display: flex; gap: 4px; align-self: stretch; }
.onglets a {
  display: flex; align-items: center; padding: 0 14px;
  text-decoration: none; font-weight: 500; font-size: 15px; color: rgba(255, 255, 255, 0.72);
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.onglets a:hover { color: #fff; }
.onglets .court { display: none; }
.onglets a[aria-current] { color: #fff; border-bottom-color: var(--vert); }
.barre__utilisateur { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.barre__utilisateur > span { display: grid; line-height: 1.2; }
.barre__utilisateur small { color: rgba(255, 255, 255, 0.65); font-size: 12px; }
.barre__utilisateur i {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--vert); color: var(--petrole); font-style: normal; font-weight: 700; font-size: 12px;
}

/* Étapes de l'étude : une vraie séquence, donc numérotée */
.etapes { background: var(--feuille); border-bottom: 1px solid var(--filet); overflow-x: auto; scrollbar-width: none; }
.etapes ol { list-style: none; margin: 0 auto; padding: 0 var(--marge); display: flex; gap: 4px; max-width: var(--largeur); }
.etapes a {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 11px;
  text-decoration: none; border-bottom: 3px solid transparent;
  color: var(--encre-2); font-weight: 500; font-size: 15px; white-space: nowrap;
}
.etapes a span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid currentColor; font-size: 12px;
}
.etapes a:hover { color: var(--encre); }
.etapes a[aria-current] { color: var(--petrole); border-bottom-color: var(--petrole); font-weight: 700; }
.etapes a.faite span { background: var(--petrole); border-color: var(--petrole); color: #fff; }

/* Page */
main { outline: none; }
.page { max-width: var(--largeur); margin: 0 auto; padding: 30px var(--marge) 72px; }
.page.entree { animation: entree 0.32s ease-out both; }
@keyframes entree { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 24px; }
.entete h1 { font-size: clamp(30px, 3.6vw, 42px); max-width: 26ch; color: var(--petrole); }
.entete p { color: var(--encre-2); max-width: 64ch; margin-top: 8px; }
.entete .surtitre { color: var(--encre-2); font-size: 15px; margin: 0 0 6px; }

.panneau { background: var(--feuille); border: 1px solid var(--filet); border-radius: var(--rayon); }
.panneau__titre { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; padding: 18px 20px 12px; }
.panneau__titre h2 { font-size: 23px; color: var(--petrole); }
.panneau__titre span { color: var(--encre-2); font-size: 14px; }

/* Boutons, en pilule comme sur le site */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  background: var(--petrole-2); color: #fff; border: 1px solid var(--petrole-2);
  font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background 0.15s;
}
.bouton:hover { background: var(--petrole); }
.bouton--discret { background: var(--feuille); color: var(--petrole); border-color: var(--filet-fort); }
.bouton--discret:hover { background: var(--petrole-voile); }
.bouton[aria-disabled='true'] { opacity: 0.45; cursor: default; }
.bouton--fait { background: var(--vert-voile); color: var(--vert-texte); border-color: transparent; cursor: default; }
.bouton--fait:hover { background: var(--vert-voile); }

/* Ce que la machine a fait : filet bleu. Ce que le courtier décide : losange pétrole. */
.machine { border-left: 3px solid var(--bleu); padding-left: 14px; }
.decision { border-left: 3px solid var(--petrole); padding-left: 14px; }
.signe-machine { display: inline-flex; align-items: center; gap: 6px; color: var(--bleu-texte); font-size: 14px; font-weight: 500; }
.signe-machine::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bleu); }
.signe-decision { display: inline-flex; align-items: center; gap: 6px; color: var(--petrole); font-size: 14px; font-weight: 500; }
.signe-decision::before { content: ''; width: 8px; height: 8px; transform: rotate(45deg); background: var(--petrole); }

.pastille { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 999px; white-space: nowrap; background: var(--papier); color: var(--encre-2); }
.pastille--exclu { background: var(--rouge-voile); color: var(--rouge); }
.pastille--vigilance { background: var(--ambre-voile); color: var(--ambre-texte); }
.pastille--ok { background: var(--vert-voile); color: var(--vert-texte); }
.pastille--info, .pastille--machine { background: var(--bleu-voile); color: var(--bleu-texte); }

/* Tableaux */
.defile { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { text-align: left; font-weight: 500; font-size: 13px; color: var(--encre-2); padding: 8px 14px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.tableau td { padding: 12px 14px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.tableau tr:last-child td, .tableau tbody tr:last-child th { border-bottom: 0; }
.tableau .nombre { text-align: right; white-space: nowrap; }

.chiffre { font-family: var(--police-titre); font-weight: 400; font-variant-numeric: lining-nums tabular-nums; }
.muet { color: var(--encre-2); }
.source { color: var(--encre-2); font-size: 13px; }

/* Compteurs d'en-tête */
.compteurs { display: flex; gap: 28px; margin: 0; }
.compteurs div { display: grid; }
.compteurs dt { font-size: 14px; color: var(--encre-2); order: 2; }
.compteurs dd { margin: 0; font-size: 44px; line-height: 1; color: var(--petrole); order: 1; }
.compteurs__exclu dd { color: var(--rouge); }

/* Choix à boutons bascule */
.choix {
  min-height: 40px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: var(--feuille); border: 1px solid var(--filet-fort); color: var(--petrole); font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.choix small { font-size: 12px; font-weight: 500; color: var(--vert-texte); background: var(--vert-voile); padding: 1px 7px; border-radius: 999px; }
.choix[aria-pressed='true'] { background: var(--petrole); border-color: var(--petrole); color: #fff; }
.choix[aria-pressed='true'] small { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* Message de confirmation */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--petrole); color: #fff; padding: 12px 18px; border-radius: var(--rayon);
  box-shadow: var(--ombre); font-size: 15px; max-width: min(560px, calc(100vw - 32px)); z-index: 20;
  animation: toast 0.25s ease-out both;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .barre { gap: 14px; min-height: 54px; }
  .barre__marque { font-size: 21px; }
  .barre__utilisateur > span { display: none; }
  .onglets a { padding: 0 8px; font-size: 14px; white-space: nowrap; }
  .onglets .long { display: none; }
  .onglets .court { display: inline; }
  .page { padding-top: 22px; }
  .compteurs { gap: 18px; }
  .compteurs dd { font-size: 34px; }
}
@media (max-width: 420px) {
  .barre__marque { display: none; }
  .barre { gap: 10px; }
  .onglets a { padding: 0 7px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
