:root {
  --bg: #0d1b2a;
  --bg2: #13243a;
  --card: #ffffff;
  --ink: #16202c;
  --muted: #5d6b7a;
  --line: #e6ebf1;
  --brand: #1b9c6b;
  --brand-d: #157a53;
  --accent: #f4a534;
  --danger: #d6453f;
  --radius: 14px;
  /* couleurs étiquettes DPE officielles */
  --A: #319834; --B: #33cc31; --C: #cbfc34; --D: #fbfe06; --E: #fbcc05; --F: #fc9935; --G: #fc0205;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: #f3f6fa; line-height: 1.55; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

.site-header { background: var(--bg); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.brand { font-weight: 800; letter-spacing: -.5px; font-size: 20px; }
#nav { font-size: 14px; display: flex; align-items: center; gap: 14px; }
#nav a { color: #cfe; cursor: pointer; text-decoration: none; }
.nav-btn { background: var(--brand); color: #fff !important; padding: 8px 16px; border-radius: 999px; font-weight: 700; }
.nav-btn:hover { background: var(--brand-d); }
.nav-badge { background: var(--accent); color: #2a1c00; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }

/* Modal connexion */
.modal-overlay { position: fixed; inset: 0; background: rgba(13,27,42,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 26px; width: 100%; max-width: 380px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 16px; }
.modal .modal-x { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal input { margin-bottom: 10px; }
.modal .btn { width: 100%; margin-top: 4px; }
.modal .acct-alt { display: inline-block; margin-top: 12px; }

.hero { padding: 44px 0; }
.hero h1 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -1px; }
.hero h1 em { color: var(--brand); font-style: normal; }
.lead { color: var(--muted); font-size: 17px; max-width: 660px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 6px 24px rgba(13,27,42,.06); }
.form-card { margin-top: 24px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { border: 1px solid var(--line); background: #f7fafc; padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 6px; }
input, select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.error { color: var(--danger); font-weight: 600; min-height: 20px; }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; margin-top: 14px; }
.btn.primary:hover { background: var(--brand-d); }
.btn.accent { background: var(--accent); color: #2a1c00; }
.btn.ghost { background: #fff; border: 1px solid var(--line); }
.btn:disabled { opacity: .6; cursor: progress; }

/* Résultat */
#result { padding: 10px 0 50px; }
.res-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.badge-class { width: 92px; height: 92px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 48px; font-weight: 800; color: #1a1a1a; }
.axes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.axis { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.axis .k { font-size: 13px; color: var(--muted); }
.axis .v { font-size: 24px; font-weight: 800; }
.axis .pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #1a1a1a; }
.axis.limiting { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(214,69,63,.12) inset; }
.axis.limiting .tag { color: var(--danger); font-weight: 700; font-size: 12px; }

.callout { background: #fff6e8; border: 1px solid #f3d49a; border-radius: 12px; padding: 16px; margin: 16px 0; }
.callout.good { background: #e9f8f1; border-color: #b8e6d2; }

h2.section { font-size: 20px; margin: 30px 0 10px; }
.dep-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.dep-bar .lab { width: 200px; color: var(--muted); }
.dep-bar .track { flex: 1; background: #eef2f6; border-radius: 6px; overflow: hidden; height: 16px; }
.dep-bar .fill { height: 100%; background: var(--brand); }

.reco { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 10px 0; background: #fff; }
.reco h3 { margin: 0 0 6px; font-size: 16px; }
.reco .meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.reco .meta b { color: var(--ink); }
.tag-fam { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.fam-papier { background: #e9f8f1; color: var(--brand-d); }
.fam-equipement { background: #eef3ff; color: #2d5bd6; }
.fam-travaux { background: #fff1e6; color: #c2651a; }
.tag-unblock { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag-notdpe { background: #2a1c00; color: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 999px; }

.paywall { background: var(--bg); color: #fff; border-radius: var(--radius); padding: 26px; margin-top: 20px; text-align: center; }
.paywall h3 { margin: 0 0 8px; font-size: 22px; }
.paywall ul { text-align: left; max-width: 460px; margin: 14px auto; padding-left: 20px; color: #d8e3ee; }
.locked-list { color: #9fb3c8; font-size: 14px; max-width: 460px; margin: 8px auto; }

/* Alerte réforme (DPE périmé) */
.reform-alert { background: #fdecea; border: 1px solid #f3b4ae; border-left: 5px solid var(--danger); border-radius: 12px; padding: 16px 18px; margin: 0 0 18px; }
.reform-h { font-weight: 800; color: var(--danger); font-size: 16px; margin-bottom: 6px; }
.reform-alert p { margin: 6px 0; }
.reform-action { background: #fff; border-radius: 8px; padding: 8px 10px; }

/* Lien "où trouver mon DPE" */
.find-link { color: var(--brand-d); font-weight: 700; cursor: pointer; text-decoration: none; }
.find-link:hover { text-decoration: underline; }
.modal code { background: #eef3f8; padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* Panneau d'analyse "scan" (futuriste) */
.scan { background: var(--bg); color: #cfe3f5; border-radius: 16px; padding: 24px 26px; max-width: 580px; margin: 34px auto; box-shadow: 0 14px 44px rgba(13,27,42,.28); position: relative; overflow: hidden; }
.scan-top { font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; font-size: 17px; }
.scan-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(27,156,107,.6); animation: pulse 1.4s infinite; flex: 0 0 auto; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(27,156,107,.55); } 70% { box-shadow: 0 0 0 12px rgba(27,156,107,0); } 100% { box-shadow: 0 0 0 0 rgba(27,156,107,0); } }
.scan-sub { color: #8fb0cc; font-size: 13.5px; margin: 6px 0 16px; line-height: 1.5; }
.scan-bar { height: 6px; background: rgba(255,255,255,.09); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.scan-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #4fd1a5); transition: width .35s ease; }
.scan-steps { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; }
.scan-steps li { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: #6f8ba6; opacity: .45; transition: opacity .3s, color .3s; }
.scan-steps li .scan-ic::before { content: "○"; }
.scan-steps li.active { opacity: 1; color: #eaf3fb; }
.scan-steps li.active .scan-ic::before { content: "▸"; color: var(--accent); }
.scan-steps li.done { opacity: 1; color: #9fc0dc; }
.scan-steps li.done .scan-ic::before { content: "✓"; color: var(--brand); }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 70px; top: -70px; background: linear-gradient(180deg, transparent, rgba(79,209,165,.10), transparent); animation: scanline 2.6s linear infinite; pointer-events: none; }
@keyframes scanline { to { transform: translateY(760px); } }

/* Analyse animée */
.analyzing { text-align: center; padding: 40px 0; }
.spinner { width: 48px; height: 48px; border: 5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 18px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ana-steps { list-style: none; padding: 0; max-width: 380px; margin: 16px auto 0; text-align: left; }
.ana-steps li { color: var(--muted); padding: 6px 0 6px 28px; position: relative; opacity: .5; transition: opacity .3s; }
.ana-steps li::before { content: "○"; position: absolute; left: 4px; }
.ana-steps li.done { opacity: 1; color: var(--ink); }
.ana-steps li.done::before { content: "✓"; color: var(--brand); font-weight: 800; }

/* Paywall screen (pay-first) */
.paywall-screen { padding: 8px 0 40px; }
.pw-found { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.pw-found h2 { margin: 0; }
.pw-found p { margin: 4px 0 0; color: var(--muted); }
.back { margin-top: 18px; }
.back a { color: var(--muted); text-decoration: none; }

/* Bandeau compte / facture */
.acct { background: #eef3ff; border: 1px solid #cfe; border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.acct.good { background: #e9f8f1; border-color: #b8e6d2; }
.acct-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.acct-form input { width: auto; flex: 1; min-width: 180px; }
.acct-alt { color: var(--muted); cursor: pointer; font-size: 14px; text-decoration: underline; }
.btn.sm { padding: 8px 12px; font-size: 14px; margin: 0; }
.invoice { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 12px; font-size: 14px; }
.invoice > div { margin: 2px 0; }

/* Situation (Volet 1 input) */
.situation { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.sit-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sit-row select { width: auto; flex: 1; min-width: 220px; }
.chk { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; color: var(--ink); }
.chk input { width: auto; }

/* Exceptions (Volet 1) */
.exc { margin-top: 10px; }
.exc summary { cursor: pointer; font-weight: 700; color: var(--brand-d); }
.exc-item { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--line); }
.exc-item p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.disc { font-size: 12px; color: var(--muted); margin-top: 10px; font-style: italic; }

/* Scénario (Volet 3) */
.step { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 12px 14px; margin: 8px 0; background: #fff; }
.step.cross { border-left-color: var(--accent); background: #fffdf7; }
.step-h { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-n { background: var(--ink); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.cross-badge { background: var(--accent); color: #2a1c00; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.step-meta { font-size: 13px; color: var(--muted); margin: 6px 0; }
/* Simulateur interactif (Volet 3) */
.sim-live { position: sticky; top: 8px; z-index: 5; background: var(--bg); color: #fff; border-radius: 12px; padding: 14px 16px; margin: 12px 0 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; box-shadow: 0 6px 20px rgba(13,27,42,.18); }
.live-pair { display: flex; align-items: center; gap: 12px; }
.live-from, .live-to { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: #9fb3c8; }
.live-arrow { font-size: 24px; color: #9fb3c8; }
.badge-class.sm { width: 46px; height: 46px; border-radius: 10px; font-size: 26px; }
.live-info { font-size: 14px; line-height: 1.5; }
.live-info b { color: #fff; }

.sim-measures { display: flex; flex-direction: column; gap: 8px; }
.sim-m { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.sim-m:hover { border-color: #cdd8e3; }
.sim-m.on { border-color: var(--brand); background: #f3fbf7; }
.sim-m input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; cursor: pointer; accent-color: var(--brand); }
.sim-body { flex: 1; }
.sim-h { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sim-pct { background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; padding: 2px 9px; border-radius: 999px; min-width: 44px; text-align: center; }
.sim-m:not(.on) .sim-pct { background: var(--muted); }
.sim-meta { font-size: 13px; color: var(--muted); margin: 4px 0; }
.sizing { font-size: 13px; background: #fff6e8; border: 1px solid #f3d49a; border-radius: 8px; padding: 6px 9px; margin: 6px 0; color: #7a5a1a; }

.mat { background: #f4f8fb; border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }
.mat-spec { color: var(--muted); }
.mat-note { font-size: 13px; color: var(--muted); margin-top: 4px; font-style: italic; }
.mat-list { list-style: none; padding: 0; margin: 8px 0 0; }
.mat-list li { padding: 10px 0; border-top: 1px solid #e2e9f0; }
.mat-list li:first-child { border-top: 0; }
.mat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; }
.mat-name { font-weight: 600; }
.mat-top .mat-best, .mat-top .mat-budget, .mat-top .mat-alt { margin-left: 0; white-space: nowrap; flex: 0 0 auto; }
.err-el { background: #fdecea; color: var(--danger); font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; flex: 0 0 auto; }

/* Checklist "à faire vérifier" (section 2) */
h3.sub { font-size: 16px; margin: 22px 0 10px; }
.check-item { border-left: 3px solid var(--line); padding: 8px 0 8px 14px; margin: 8px 0; }
.check-item b { color: var(--ink); }

/* Bloc fiabilité & recours */
.reli { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin: 26px 0 8px; }
.reli summary { cursor: pointer; font-weight: 800; padding: 14px 0; font-size: 16px; color: var(--ink); }
.reli ul, .reli ol { padding-left: 20px; }
.reli li { margin: 6px 0; }
.mat-best { font-size: 11px; background: #e9f8f1; color: var(--brand-d); padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.mat-budget { font-size: 11px; background: #fff1e6; color: #c2651a; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.mat-alt { font-size: 11px; background: #eef3ff; color: #2d5bd6; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.mat-link { display: inline-block; margin-top: 4px; color: var(--brand-d); font-weight: 700; text-decoration: none; }
.mat-link:hover { text-decoration: underline; }

/* Back-office admin */
.admin-scroll { overflow-x: auto; }
.admin-tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.admin-tbl th { text-align: left; background: #f3f6fa; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 10px 12px; }
.admin-tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.admin-tbl tr:hover td { background: #f9fbfd; }
.rep-link { color: var(--brand-d); font-weight: 700; cursor: pointer; text-decoration: none; }
.rep-link:hover { text-decoration: underline; }

/* Page article SEO */
.article { max-width: 760px; margin: 0 auto; padding: 30px 0 20px; }
.article h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.5px; margin: 0 0 12px; }
.article h2 { font-size: 23px; margin: 34px 0 10px; }
.article h3 { font-size: 18px; margin: 22px 0 6px; }
.article p, .article li { font-size: 16.5px; line-height: 1.65; color: #2b3947; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 8px 0; }
.cta-band { background: var(--bg); color: #fff; border-radius: var(--radius); padding: 28px; margin: 34px 0; text-align: center; }
.cta-band h3 { margin: 0 0 8px; font-size: 22px; color: #fff; }
.cta-band p { color: #d8e3ee; max-width: 520px; margin: 0 auto 16px; }

.site-footer { background: var(--bg2); color: #9fb3c8; font-size: 13px; margin-top: 40px; }
.site-footer .wrap { padding: 22px 20px; }
@media (max-width: 640px) { .grid2, .axes { grid-template-columns: 1fr; } .hero h1 { font-size: 27px; } }
