/* Simulateurs Viager Var : viager (/simulateur/) et prêt viager hypothécaire (/pret-viager-hypothecaire/)
   Tous les sélecteurs sont préfixés .s2 pour ne pas toucher au reste du site. */
.s2{
  --s2-brun:#4E321A; --s2-brun2:#6B4423; --s2-or:#B8913A; --s2-or-txt:#8E6D24; --s2-or-clair:#E3C27A;
  --s2-tint:#F8F4EC; --s2-tint-bord:#E6DCCB; --s2-champ:#FFFFFF;
  --s2-occ:#D9C7A3; --s2-bq:#B8913A; --s2-rt:#4E321A;
  --s2-dette:#4E321A; --s2-dette-fond:rgba(78,50,26,.10); --s2-alerte:#A4462F;
  --s2-chiffres:"Lora",Georgia,"Times New Roman",serif;
  padding-block:clamp(2.5rem,5vw,4rem);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .s2{
  --s2-or-txt:#E3C27A; --s2-tint:#262219; --s2-tint-bord:#4A3E2A; --s2-champ:#141C21;
  --s2-occ:#6E5D3F; --s2-rt:#E9DDC4; --s2-dette:#E3C27A; --s2-dette-fond:rgba(227,194,122,.14); --s2-alerte:#E48A72}}
:root[data-theme="dark"] .s2{
  --s2-or-txt:#E3C27A; --s2-tint:#262219; --s2-tint-bord:#4A3E2A; --s2-champ:#141C21;
  --s2-occ:#6E5D3F; --s2-rt:#E9DDC4; --s2-dette:#E3C27A; --s2-dette-fond:rgba(227,194,122,.14); --s2-alerte:#E48A72}

.s2 .s2-grille{display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:1.4rem;align-items:start}
.s2 .s2-carte{background:var(--carte);border:1px solid var(--ligne);border-radius:10px;padding:1.3rem;min-width:0}
.s2 .s2-form{border-top:4px solid var(--s2-or);display:grid;gap:1.1rem}
.s2 .s2-groupe{display:grid;gap:.75rem}
.s2 .s2-groupe+.s2-groupe{border-top:1px solid var(--ligne);padding-top:1.1rem}
.s2 .s2-groupe h3{font:800 1.15rem/1.2 "Playfair Display",Georgia,serif;color:var(--s2-or-txt);margin:0}
.s2 .s2-champ{display:grid;gap:.3rem}
.s2 .s2-champ label{font-size:.85rem;font-weight:600;color:var(--muted)}
.s2 .s2-champ input[type=text],.s2 .s2-champ input[type=number],.s2 .s2-champ select{width:100%;min-height:44px;padding:.55rem .7rem;border:1px solid var(--ligne);border-radius:6px;background:var(--s2-champ);color:var(--fg);font:inherit}
.s2 .s2-unite{display:flex}
.s2 .s2-unite input{border-radius:6px 0 0 6px!important;min-width:0}
.s2 .s2-unite span{display:grid;place-items:center;padding:0 .75rem;border:1px solid var(--ligne);border-left:0;border-radius:0 6px 6px 0;background:var(--s2-tint);color:var(--muted);font-size:.9rem}
.s2 .s2-deux{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}
.s2 .s2-coche{display:flex;align-items:center;gap:.55rem;font-weight:600;cursor:pointer}
.s2 .s2-coche input{width:19px;height:19px;accent-color:var(--s2-or)}
.s2 .s2-aide{font-size:.85rem;color:var(--muted);font-style:italic;margin:-.2rem 0 0}
.s2 .s2-curseur-tete{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem}
.s2 .s2-curseur-tete output{font-weight:700;color:var(--s2-or-txt);font-variant-numeric:tabular-nums}
.s2 input[type=range]{width:100%;accent-color:var(--s2-or)}
.s2 .s2-graduations{display:flex;justify-content:space-between;font-size:.75rem;color:var(--muted)}
.s2 .s2-montant-saisi{font:700 1.4rem/1.2 var(--s2-chiffres)!important;text-align:center;letter-spacing:.02em}
.s2 .s2-montant-saisi.petit{font-size:1.1rem!important}
.s2 .s2-champ.centre label{text-align:center}

.s2 .s2-resultats{display:grid;gap:1.2rem;min-width:0}
.s2 .s2-onglets{display:flex;flex-wrap:wrap;gap:4px;background:var(--s2-tint);border:1px solid var(--s2-tint-bord);border-radius:999px;padding:4px}
.s2 .s2-onglets button{flex:1 1 130px;border:0;background:transparent;border-radius:999px;padding:.6rem .8rem;font:600 .98rem "Source Sans 3",system-ui,sans-serif;color:var(--s2-or-txt);cursor:pointer}
.s2 .s2-onglets button[aria-pressed="true"]{background:var(--s2-or);color:#fff}

.s2 .s2-phrase{font:800 clamp(1.25rem,2.4vw,1.6rem)/1.25 "Playfair Display",Georgia,serif;color:var(--s2-or-txt);text-align:center;margin:0 auto .3rem;max-width:none;text-wrap:balance}
.s2 .s2-sous{color:var(--muted);text-align:center;margin:0 auto 1rem;max-width:68ch;font-size:.97rem}
.s2 .s2-carres{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}
.s2 .s2-carre{container-type:inline-size;border:1px solid var(--ligne);border-radius:8px;padding:.9rem .7rem;text-align:center;background:var(--bg);min-width:0}
.s2 .s2-carre.fort{background:var(--s2-tint);border-color:var(--s2-tint-bord)}
.s2 .s2-carre .k{font:700 1.05rem/1.2 var(--s2-chiffres);color:var(--fg)}
.s2 .s2-carre strong{display:block;font:700 clamp(14px,8.2cqi,22px)/1.25 var(--s2-chiffres);color:var(--s2-or-txt);white-space:nowrap;margin:.45rem 0 .25rem;font-variant-numeric:lining-nums}
.s2 .s2-carre strong.dette{color:var(--s2-dette)}
.s2 .s2-carre small{display:block;color:var(--muted);font-size:.82rem;line-height:1.35}
.s2 .s2-precision{font-size:.74rem;font-weight:400;color:var(--muted)}

.s2 .s2-barre{display:flex;height:20px;border-radius:5px;overflow:hidden;margin:1.1rem 0 .7rem;background:var(--ligne)}
.s2 .s2-barre span{display:block;height:100%;transition:width .35s ease}
.s2 .s2-legende{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem 1rem;font-size:.9rem}
.s2 .s2-legende > div{display:flex;gap:.5rem;justify-content:center;align-items:flex-start;text-align:center;min-width:0}
.s2 .s2-legende i{width:11px;height:11px;border-radius:3px;flex:none;margin-top:.35rem}
.s2 .s2-legende b{display:block;font-variant-numeric:tabular-nums;white-space:nowrap}
.s2 .s2-legende span{display:block;color:var(--muted);font-size:.84rem}

.s2 .s2-titre{font:800 1.2rem/1.2 "Playfair Display",Georgia,serif;color:var(--s2-or-txt);text-align:center;margin:0 0 .25rem}
.s2 .s2-titre-sous{color:var(--muted);text-align:center;font-size:.92rem;margin:0 auto .8rem;max-width:68ch}
.s2 .s2-tableau{overflow-x:auto;border:1px solid var(--ligne);border-radius:8px}
.s2 table{width:100%;border-collapse:collapse}
.s2 th,.s2 td{padding:.6rem .7rem;text-align:center;border-bottom:1px solid var(--ligne);white-space:nowrap}
.s2 thead th{background:var(--s2-brun);color:#F1E4CC;font-size:.78rem;letter-spacing:.06em;text-transform:uppercase;font-weight:700}
.s2 tbody td{font:600 1.02rem/1.3 var(--s2-chiffres);font-variant-numeric:lining-nums}
.s2 tbody td:last-child{color:var(--s2-or-txt)}
.s2 tbody tr:last-child td{border-bottom:0}
.s2 tr.vie td{background:var(--s2-tint);color:var(--s2-or-txt)}
.s2 td.plafond{color:var(--s2-alerte)!important}
.s2 .s2-pastille{display:inline-block;font:700 .66rem/1.4 "Source Sans 3",system-ui,sans-serif;letter-spacing:.04em;text-transform:uppercase;color:var(--s2-or-txt);border:1px solid var(--s2-tint-bord);border-radius:999px;padding:1px 7px;margin-left:6px;vertical-align:2px}

.s2 .s2-graph{width:100%;height:auto;display:block}
.s2 .s2-graph .g{stroke:var(--ligne);stroke-width:1}
.s2 .s2-graph .ax{fill:var(--muted);font:12px "Source Sans 3",system-ui,sans-serif}
.s2 .s2-graph .bien{fill:none;stroke:var(--s2-or);stroke-width:2.5;stroke-dasharray:6 5}
.s2 .s2-graph .dette{fill:none;stroke:var(--s2-dette);stroke-width:3;stroke-linejoin:round}
.s2 .s2-graph .zone{fill:var(--s2-dette-fond)}
.s2 .s2-graph .vie{stroke:var(--s2-or-txt);stroke-width:1.5;stroke-dasharray:2 4}
.s2 .s2-graph .vie-t{fill:var(--s2-or-txt);font:600 12px "Source Sans 3",system-ui,sans-serif}
.s2 .s2-graph .pt{fill:var(--s2-dette)}
.s2 .s2-cles{display:flex;flex-wrap:wrap;justify-content:center;gap:.4rem 1.2rem;font-size:.88rem;color:var(--muted);margin-top:.5rem}
.s2 .s2-cles span{display:flex;align-items:center;gap:.45rem}
.s2 .s2-cles i{display:inline-block;width:22px;border-top:3px solid var(--s2-dette)}
.s2 .s2-cles i.b{border-top:3px dashed var(--s2-or)}

#s2-pret tbody td{font-size:.93rem;padding:.55rem .45rem}
#s2-pret thead th{padding:.6rem .45rem}
/* Comparatif mis en avant (brun et or, comme le tableau comparatif du site) */
.s2 .s2-versus{background:linear-gradient(115deg,#4E321A,#6B4423);color:#fff;border-radius:10px;padding:1.5rem 1.2rem;text-align:center;display:grid;gap:.35rem}
.s2 .s2-versus .sur{color:#E3C27A;margin:0}
.s2 .s2-versus h3{font:800 clamp(1.25rem,2.4vw,1.65rem)/1.25 "Playfair Display",Georgia,serif;color:#fff;margin:0;text-wrap:balance}
.s2 .s2-versus .vs-sous{color:#E7D9C0;font-size:.92rem;margin:0 auto .7rem;max-width:68ch}
.s2 .vs-grille{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.9rem}
.s2 .vs-col{container-type:inline-size;border:1px solid rgba(255,255,255,.2);background:rgba(255,255,255,.06);border-radius:8px;padding:1rem .8rem;min-width:0}
.s2 .vs-col.via{border:1.5px solid #E3C27A;background:rgba(227,194,122,.14)}
.s2 .vs-col h4{font:800 1.08rem/1.2 "Playfair Display",Georgia,serif;color:#fff;margin:0 0 .4rem}
.s2 .vs-total{margin:0;font:700 clamp(17px,10cqi,28px)/1.2 var(--s2-chiffres);color:#fff;white-space:nowrap;max-width:none}
.s2 .vs-col.via .vs-total{color:#E3C27A}
.s2 .vs-total-l{margin:0 0 .8rem;font-size:.82rem;color:#E7D9C0;max-width:none}
.s2 .vs-col dl{margin:0;display:grid;gap:.55rem;border-top:1px solid rgba(255,255,255,.16);padding-top:.7rem}
.s2 .vs-col dt{font-size:.82rem;color:#E7D9C0}
.s2 .vs-col dd{margin:.05rem 0 0;font-weight:600;color:#fff}
.s2 .vs-col .s2-precision{color:#E7D9C0}
.s2 .vs-avis{margin:1rem auto 0;max-width:72ch;background:rgba(255,255,255,.07);border-top:2px solid #E3C27A;border-radius:6px;padding:1rem 1.1rem}
.s2 .vs-avis strong{display:block;font:800 1.15rem/1.2 "Playfair Display",Georgia,serif;color:#E3C27A;margin-bottom:.35rem}
.s2 .vs-avis p{margin:0 auto;max-width:none;font-size:.97rem;color:#F1E4CC}

.s2 .s2-appel{text-align:center;background:var(--s2-tint);border:1px solid var(--s2-tint-bord);border-radius:10px;padding:1.4rem 1.2rem}
.s2 .s2-appel h3{font:800 1.3rem/1.25 "Playfair Display",Georgia,serif;color:var(--s2-or-txt);margin:0 0 .4rem}
.s2 .s2-appel p{margin:0 auto 1rem;max-width:62ch;color:var(--muted)}
.s2 .s2-appel .liens{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.6rem 1.2rem}
.s2 .s2-appel .tel{font:700 1.25rem "Source Sans 3",system-ui,sans-serif;color:var(--s2-or-txt);text-decoration:none}
.s2 .s2-mention{font-size:.8rem;color:var(--muted);text-align:center;margin:0 auto;max-width:90ch}
.s2 .s2-entete{text-align:center;margin-bottom:1.6rem}
.s2 .s2-entete h2{font-family:"Playfair Display",Georgia,serif;font-weight:800;font-size:clamp(1.5rem,3vw,2.1rem);color:#4E321A;margin:0 0 .4rem}
:root[data-theme="dark"] .s2 .s2-entete h2{color:#E3C27A}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .s2 .s2-entete h2{color:#E3C27A}}
.s2 .s2-entete p{margin:0 auto;color:var(--muted);max-width:68ch}



/* Comparatif en tableau */
.s2 .vs-totaux{display:grid;grid-template-columns:1fr 1fr;gap:.8rem;margin:.2rem 0 .9rem}
.s2 .vs-tot{container-type:inline-size;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.06);border-radius:8px;padding:.8rem .6rem;min-width:0}
.s2 .vs-tot.via{border:1.5px solid #E3C27A;background:rgba(227,194,122,.14)}
.s2 .vs-tot span{display:block;font:800 1rem/1.2 "Playfair Display",Georgia,serif;color:#fff}
.s2 .vs-tot strong{display:block;font:700 clamp(16px,9.5cqi,28px)/1.25 var(--s2-chiffres);color:#fff;white-space:nowrap;margin:.3rem 0 .1rem}
.s2 .vs-tot.via strong{color:#E3C27A}
.s2 .vs-tot em{font-style:normal;font-size:.8rem;color:#E7D9C0}
.s2 .vs-table{overflow-x:auto;border:1px solid rgba(255,255,255,.18);border-radius:8px}
.s2 .vs-table table{width:100%;border-collapse:collapse;table-layout:fixed}
.s2 .vs-table th,.s2 .vs-table td,.s2 .vs-table tbody td{white-space:normal;font:500 .93rem/1.35 "Source Sans 3",system-ui,sans-serif;color:#fff;background:transparent;text-transform:none;letter-spacing:0;padding:.6rem .55rem;border-bottom:1px solid rgba(255,255,255,.14);text-align:center;vertical-align:middle}
.s2 .vs-table thead th{font:800 .98rem/1.2 "Playfair Display",Georgia,serif;background:rgba(0,0,0,.18);color:#fff}
.s2 .vs-table thead th:first-child{width:30%}
.s2 .vs-table thead th:last-child{color:#E3C27A}
.s2 .vs-table tbody th{text-align:left;font-weight:600;color:#E7D9C0}
.s2 .vs-table tbody td:last-child{background:rgba(227,194,122,.13);color:#fff;font-weight:600}
.s2 .vs-table tbody tr:last-child th,.s2 .vs-table tbody tr:last-child td{border-bottom:0}
.s2 .vs-table .s2-precision{color:#E7D9C0}
.s2 .visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:640px){.s2 .vs-table th,.s2 .vs-table td,.s2 .vs-table tbody td{font-size:.84rem;padding:.5rem .35rem}.s2 .vs-table thead th{font-size:.86rem}}
/* Accès au comparatif depuis le simulateur viager */
.s2 .s2-vers-comparatif{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.8rem 1.2rem;background:linear-gradient(115deg,#4E321A,#6B4423);color:#fff;border-radius:10px;padding:1.1rem 1.3rem}
.s2 .s2-vers-comparatif > div{min-width:0;flex:1 1 280px}
.s2 .s2-vers-comparatif h3{font:800 1.2rem/1.25 "Playfair Display",Georgia,serif;color:#E3C27A;margin:0 0 .2rem}
.s2 .s2-vers-comparatif p{margin:0;color:#F1E4CC;font-size:.95rem;max-width:none}
.s2 .s2-vers-comparatif .btn{white-space:nowrap}
@media (max-width:640px){.s2 .s2-vers-comparatif{text-align:center;justify-content:center}.s2 .s2-vers-comparatif .btn{width:100%}}
/* Barre d'onglets commune en haut de la page simulateur */
.s2 .s2-onglets-haut{margin:0 auto 1.4rem;max-width:880px}
.s2 .s2-onglets-haut button{flex:1 1 auto;font-size:1rem;padding:.7rem 1rem;white-space:nowrap}
.s2 .s2-onglets-haut button[data-cible="pret"]{position:relative}
@media (max-width:640px){.s2 .s2-onglets-haut{border-radius:14px}.s2 .s2-onglets-haut button{flex:1 1 45%;border-radius:10px;font-size:.92rem;padding:.6rem .5rem;white-space:normal}}
@media (max-width:900px){.s2 .s2-grille{grid-template-columns:1fr}}
@media (max-width:640px){
  .s2 .s2-carres,.s2 .s2-legende,.s2 .vs-grille{grid-template-columns:1fr}
  .s2 .s2-carte{padding:1rem}
}
@media (prefers-reduced-motion:reduce){.s2 .s2-barre span{transition:none}}
