/* Étape 3, l'écran wow : les devis identiques en gris, les conditions générales en couleur, l'article en vis-à-vis. */
.page.conditions { max-width: 1480px; }
.conditions .entete h1 { max-width: none; }

/* Les cinq conditions générales : des documents qui se lisent */
.documents { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.document {
  position: relative; display: grid; gap: 2px; align-content: start;
  padding: 11px 14px 10px; background: var(--feuille); border: 1px solid var(--filet); border-radius: var(--rayon-petit);
}
.document::before {
  content: ''; position: absolute; top: -1px; right: -1px; width: 18px; height: 18px;
  background: linear-gradient(225deg, var(--papier) 50%, var(--filet) 50%); border-bottom-left-radius: 3px;
}
.document__nom { font-family: var(--police-titre); font-size: 20px; line-height: 1.15; color: var(--petrole); padding-right: 14px; }
.document__meta { font-size: 13px; color: var(--encre-2); }
.document__lecture { display: block; height: 4px; border-radius: 2px; background: var(--filet); margin: 8px 0 4px; overflow: hidden; }
.document__lecture i { display: block; height: 100%; width: calc(var(--lu) * 100%); background: var(--bleu); }
.document__pages { font-size: 13px; color: var(--bleu-texte); font-weight: 500; }
.document--lu .document__lecture i { background: var(--petrole-2); }
.document--lu .document__pages { color: var(--encre-2); font-weight: 400; }

/* Outils : filtre et légende */
.conditions__outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 12px; }
.filtre { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.legende { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--encre-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende span::before { content: ''; width: 4px; height: 16px; border-radius: 2px; }
.legende__ok::before { background: var(--vert); }
.legende__vigilance::before { background: var(--ambre); }
.legende__exclu::before { background: var(--rouge); }
.legende__info::before { background: var(--bleu); }

/* Le tableau */
.glisser { display: none; font-size: 14px; color: var(--encre-2); margin-bottom: 8px; }
.conditions__grille { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.grille-offres { background: var(--feuille); border: 1px solid var(--filet); border-radius: var(--rayon); overflow-x: auto; }
.comparatif { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; min-width: 860px; table-layout: fixed; }
.comparatif .col-point { width: 190px; }
.comparatif thead th {
  position: sticky; top: 0; background: var(--feuille); z-index: 1;
  text-align: left; padding: 14px 12px 10px; border-bottom: 2px solid var(--petrole); vertical-align: bottom;
}
.comparatif thead th span { display: block; font-family: var(--police-titre); font-weight: 400; font-size: 22px; color: var(--petrole); white-space: nowrap; }
.comparatif thead th small { display: block; font-size: 12px; color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comparatif thead .col-point { font-size: 13px; font-weight: 500; color: var(--encre-2); }
.comparatif tbody th[scope='row'] {
  position: sticky; left: 0; z-index: 1; background: var(--feuille);
  text-align: left; font-weight: 500; font-size: 15px; padding: 10px 12px; border-bottom: 1px solid var(--filet);
}
.comparatif tbody th small { display: block; font-size: 12px; font-weight: 400; color: var(--ambre-texte); margin-top: 1px; }
.groupe th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--encre-2);
  padding: 14px 12px 6px; background: var(--papier); border-bottom: 1px solid var(--filet);
}
.groupe--cg th { color: var(--petrole); border-top: 1px solid var(--filet); }

.case { padding: 0; border-bottom: 1px solid var(--filet); vertical-align: middle; height: 58px; }
.case button {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  width: 100%; min-height: 58px; padding: 6px 12px 6px 14px; border: 0; background: none; text-align: left; cursor: pointer;
  position: relative;
}
.case button::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 2px; }
.case__valeur { font-weight: 500; line-height: 1.25; }
.case__page { font-size: 12px; color: var(--encre-2); text-decoration: underline; text-underline-offset: 2px; }
.case button:hover .case__page { color: var(--petrole); }
.case--ok .case__valeur { color: var(--vert-texte); font-weight: 400; }
.case--ok button::before { background: var(--vert); opacity: 0.55; }
.case--vigilance { background: var(--ambre-voile); }
.case--vigilance .case__valeur { color: var(--ambre-texte); }
.case--vigilance button::before { background: var(--ambre); }
.case--exclu { background: var(--rouge-voile); }
.case--exclu .case__valeur { color: var(--rouge); font-weight: 700; }
.case--exclu button::before { background: var(--rouge); }
.case--info .case__valeur { color: var(--bleu-texte); }
.case--info button::before { background: var(--bleu); }
.case--choisie { box-shadow: inset 0 0 0 2px var(--petrole); }

/* Les devis : une seule case grise, identique pour tous */
.case--devis { padding: 0 14px; color: #5c6c71; }
.case--devis .case__valeur { font-weight: 400; display: inline; margin-right: 10px; }
.case__identique { display: block; font-size: 13px; font-style: italic; }
.ligne--devis th[scope='row'] { color: #5c6c71; font-weight: 400; }
.ligne--devis .case, .ligne--devis th { height: 48px; }

.case--attente { padding: 0 12px; }
.case--attente .trame { margin-top: 0; }

.ligne--prime th[scope='row'], .ligne--prime .case { border-bottom: 0; border-top: 2px solid var(--petrole); height: 70px; }
.case--prime { padding: 0 12px; }
.case--prime .case__valeur { display: block; font-family: var(--police-titre); font-size: 24px; color: var(--petrole); font-weight: 400; }
.case--recommandee { background: var(--vert-voile); }
.verdict { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; margin-top: 2px; }
.verdict--ok { background: var(--vert); color: #06392c; }
.verdict--exclu { background: var(--rouge); color: #fff; }
.conditions:not(.conditions--fini) .case:not(.case--attente) { animation: apparait 0.35s ease-out both; }
@keyframes apparait { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* L'article : une page de conditions générales, avec le passage qui compte surligné */
.extrait { position: sticky; top: 84px; display: grid; gap: 14px; }
.extrait--attente { background: var(--feuille); border: 1px dashed var(--filet-fort); border-radius: var(--rayon); padding: 24px 20px; color: var(--encre-2); font-size: 15px; }
.extrait__page {
  background: #fffefb; border: 1px solid var(--filet); border-radius: 3px; box-shadow: var(--ombre);
  padding: 18px 22px 14px; display: grid; gap: 12px;
}
.extrait__en-tete { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: #5f6f74; padding-bottom: 8px; border-bottom: 1px solid #e5e9ea; }
.extrait__en-tete span:last-child { text-align: right; }
.extrait__article { font-family: var(--police-texte); font-weight: 700; font-size: 16px; color: #23343a; }
.extrait__texte { margin: 0; font-family: var(--police-texte); font-size: 16px; line-height: 1.65; color: #2d3b40; hyphens: auto; }
.extrait__texte mark { padding: 1px 2px; border-radius: 2px; color: inherit; }
.extrait__texte--exclu mark { background: rgba(178, 58, 48, 0.16); box-shadow: inset 0 -2px 0 var(--rouge); }
.extrait__texte--vigilance mark { background: rgba(212, 149, 42, 0.22); box-shadow: inset 0 -2px 0 var(--ambre); }
.extrait__texte--ok mark { background: rgba(45, 188, 154, 0.18); box-shadow: inset 0 -2px 0 var(--vert); }
.extrait__texte--info mark { background: rgba(49, 142, 170, 0.16); box-shadow: inset 0 -2px 0 var(--bleu); }
.extrait__folio { font-size: 11px; color: #5f6f74; text-align: right; }

.extrait__lecture { background: var(--feuille); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 16px 18px; display: grid; gap: 12px; }
.extrait__qui { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.extrait__note, .extrait__rapport { font-size: 15px; }
.extrait__note strong, .extrait__rapport strong { display: block; font-size: 13px; font-weight: 500; color: var(--bleu-texte); }
.extrait__rapport { background: var(--papier); border-radius: var(--rayon-petit); padding: 10px 12px; font-family: var(--police-texte); font-style: italic; }
.extrait__rapport strong { font-family: var(--police); font-style: normal; color: var(--encre-2); }

/* Suite : synthèse et décision */
.conditions__suite { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.synthese__liste { list-style: none; padding: 0 20px 20px; display: grid; gap: 12px; }
.synthese__offre { border-left: 3px solid var(--filet-fort); padding-left: 14px; display: grid; gap: 2px; }
.synthese__offre p:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.synthese__offre strong { font-weight: 500; color: var(--petrole); }
.synthese__offre span { font-size: 14px; color: var(--encre-2); }
.synthese__offre p:last-child { font-size: 15px; }
.synthese__offre--recommandee { border-left-color: var(--vert); }
.synthese__offre--ecartee { border-left-color: var(--rouge); }

.decision-contrat { border-top: 4px solid var(--petrole); }
.decision-contrat__corps { padding: 0 20px 22px; display: grid; gap: 14px; justify-items: start; }
.decision-contrat__nom { font-family: var(--police-titre); font-size: 30px; color: var(--petrole); line-height: 1.1; }
.decision-contrat__nom span { display: block; font-family: var(--police); font-size: 14px; color: var(--encre-2); }
.decision-contrat__prix { color: var(--encre-2); font-size: 15px; }
.decision-contrat__prix .chiffre { font-size: 34px; color: var(--petrole); margin-right: 4px; }
.decision-contrat__arguments { padding-left: 18px; display: grid; gap: 6px; font-size: 15px; }

@media (max-width: 1240px) {
  .conditions__grille { grid-template-columns: minmax(0, 1fr); }
  .extrait { position: static; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 1100px) {
  .documents { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .conditions__suite { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .extrait { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .documents {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-right: calc(-1 * var(--marge)); padding-right: var(--marge);
  }
  .document { flex: 0 0 150px; scroll-snap-align: start; }
  .document__nom { font-size: 18px; }
  .document__meta { display: none; }
  .glisser { display: block; }
  .comparatif { min-width: 760px; font-size: 14px; }
  .comparatif .col-point { width: 132px; }
  .comparatif tbody th[scope='row'] { font-size: 14px; }
}
