/* Flairloc — écrans d'application (connexion, espace client, bienvenue, pages légales, admin).
   Même identité que l'accueil (Plus Jakarta Sans, bleu Flairloc), en version sobre : surfaces blanches, filets clairs. */
@font-face { font-family: "Jakarta"; src: url("../fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("../fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("../fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --navy: #0B6CD8; --navy-2: #0858B3;
  --ink: #111827; --ink-2: #374151; --muted: #6B7280; --line: #E5E7EB;
  --bg: #F2F7FE; --card: #FFFFFF;
  --green: #047857; --green-2: #34D399; --green-bg: #EDF6F0; --green-ink: #2F6B3C;
  --red: #9F2F2D; --red-bg: #FDEBEC; --amber: #8A5A00; --amber-bg: #FBF3DB; --blue-bg: #E4EEFC; --blue-ink: #0B6CD8;
  --chart-1: #0B6CD8; --chart-2: #16A34A; --grid: #E8EDF3;
  --radius: 8px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --display: "Jakarta", "Segoe UI", system-ui, sans-serif;
  --text: "Jakarta", "Segoe UI", system-ui, sans-serif;
  font-family: var(--text);
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); font-size: 16px; line-height: 1.6; font-variant-numeric: tabular-nums; }
a { color: var(--blue-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(30px, 3.4vw, 44px); }
h2 { font-size: clamp(24px, 2.2vw, 30px); }
h3 { font-size: 17px; font-weight: 600; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* En-tête : barre blanche, logo, quelques liens, une action */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.site-head .logo img { height: 40px; width: auto; display: block; }
.site-head nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-head nav a, .site-head nav button { color: var(--ink); text-decoration: none; font: inherit; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 6px; background: none; border: 0; cursor: pointer; transition: background-color .2s var(--ease); }
.site-head nav a:hover, .site-head nav button:hover { background: var(--bg); }
.site-head nav a.active { background: var(--blue-bg); }
.site-head nav .cta { background: var(--navy); color: #fff; }
.site-head nav .cta:hover { background: var(--navy-2); }

/* Boutons, champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 6px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background-color .2s var(--ease), transform .12s var(--ease); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.green { background: var(--green); color: #fff; }
.btn.green:hover { background: #065F46; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.small { padding: 7px 11px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.oauth { width: 100%; background: var(--card); border: 1px solid #CBD5E1; color: var(--ink); }
.btn.oauth:hover { background: var(--bg); }
.btn.oauth svg { width: 18px; height: 18px; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); }
input, select { width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #CBD5E1; border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
input[type="checkbox"] { width: 18px; height: 18px; margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--navy); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); font-size: 15px; line-height: 1.5; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 140px; }
.msg { min-height: 20px; font-size: 15px; margin: 8px 0 0; }
.msg.error { color: var(--red); }
.msg.ok { color: var(--green-ink); }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.section { padding: 40px 0; }
.page-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 40px 0 20px; }
.page-title h1 { margin: 0; }
.btn { border-radius: 8px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.badge.green { background: var(--green-bg); color: var(--green-ink); border-color: transparent; }
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.badge.navy { background: var(--navy); color: #fff; border-color: transparent; }


/* Offres */
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.offer { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px 18px; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.offer.best { border: 2px solid var(--navy); }
.offer .tag { position: absolute; top: -12px; left: 16px; background: var(--green-bg); color: var(--green-ink); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; }
.offer .name { font-size: 15px; font-weight: 600; color: var(--muted); }
.offer .price b { font-family: var(--display); font-weight: 800; font-size: 38px; letter-spacing: -.02em; }
.offer .price s { color: var(--muted); margin-right: 6px; }
.offer .price span { color: var(--muted); }
.offer .sub { color: var(--green-ink); font-size: 15px; min-height: 21px; }
.offer:not(.best) .sub { color: var(--muted); }
.offer .btn { margin-top: 8px; }
.consent { margin-top: 18px; max-width: 640px; }
.feats { padding-left: 20px; color: var(--ink-2); }
.feats li { margin: 4px 0; }
footer { color: var(--muted); font-size: 14px; padding: 32px 0 48px; border-top: 1px solid var(--line); margin-top: 48px; }
footer .wrap { display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: space-between; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

/* Connexion et bienvenue */
.auth { max-width: 440px; margin: 56px auto; }
.auth .card { padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.auth h1, .auth h2 { font-size: 30px; margin: 0; }
.auth .lead { font-weight: 600; margin: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.welcome { max-width: 680px; margin: 56px auto; }
.welcome ol { padding-left: 22px; margin: 20px 0; }
.welcome li { margin: 10px 0; }
.welcome .state { padding: 18px 22px; border-radius: var(--radius); background: var(--amber-bg); margin-top: 24px; }
.welcome .state.ok { background: var(--green-bg); }
.welcome .state p { margin: 0; }

/* Pages légales */
.legal-page { max-width: 760px; margin: 48px auto 0; }
.legal-page h1 { margin-bottom: 8px; }
.legal-page h2 { font-size: 24px; margin-top: 40px; }
.legal-page h3 { margin-top: 28px; }
.legal-page p, .legal-page li { max-width: 68ch; }
.legal-page table { margin: 16px 0; }
.todo { background: var(--amber-bg); color: var(--amber); padding: 0 4px; border-radius: 3px; font-weight: 600; }
.draft-note { background: var(--amber-bg); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0 8px; color: var(--ink); }

/* Espace client */
.empty { text-align: center; color: var(--muted); padding: 32px 10px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; margin: 0; }

/* Admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile .value { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.tile .sub { font-size: 13px; color: var(--muted); }
.tile[data-k="providers"] .value { font-size: 19px; line-height: 1.3; font-family: var(--text); font-weight: 600; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.chart-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chart-card h3 small { font-weight: 400; color: var(--muted); font-size: 14px; }
.chart { position: relative; height: 200px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--navy); color: #fff; font-size: 13px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--bg); }
.table-wrap { overflow-x: auto; }
td .btn.small { white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--navy); }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select, .inline-form input { width: auto; margin: 0; padding: 6px 8px; font-size: 14px; }

/* Entrées discrètes */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .card, .js-reveal .banner { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}

@media (max-width: 800px) {
  .charts { grid-template-columns: 1fr; }
  .site-head .wrap { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .card { padding: 22px; }
  .auth, .welcome { margin: 32px auto; }
}

/* ===== Habillage « même esprit que l'accueil » (fond bleu pâle, cartes blanches arrondies, ombres douces) ===== */
:root { --radius: 16px; --shadow: 0 10px 30px rgba(17, 24, 39, .08); --shadow-sm: 0 2px 10px rgba(17, 24, 39, .06); }
body { background: #F2F7FE; color: var(--ink-2); font-size: 16.5px; }
.wrap { max-width: 1140px; padding: 0 24px; }
a { color: var(--navy); }

.site-head { position: sticky; top: 0; z-index: 20; background: rgba(242, 247, 254, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid transparent; }
.site-head .wrap { height: 68px; gap: 32px; }
.site-head .logo img { height: 36px; }
.site-head .main-links { margin-left: 32px; gap: 20px; }
.site-head .main-links a { font-weight: 500; padding: 6px 0; background: none; }
.site-head .main-links a:hover { color: var(--navy); background: none; }
.site-head .acct-links { margin-left: auto; gap: 10px; }
.site-head nav a, .site-head nav button { border-radius: 8px; }
.site-head nav a.active { background: #fff; box-shadow: var(--shadow-sm); color: var(--navy); }
.site-head nav .login { color: var(--navy); font-weight: 700; }
.site-head nav .cta { background: var(--navy); color: #fff; padding: 9px 16px; }
.site-head nav .cta:hover { background: var(--navy-2); }

h1 { font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem); font-weight: 800; color: var(--ink); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700; color: var(--ink); }
h3 { color: var(--ink); font-weight: 700; }
.page-title { margin: 48px 0 28px; }

.btn { border-radius: 8px; padding: 12px 20px; font-weight: 700; }
.btn.primary:hover, .btn.green:hover { box-shadow: 0 6px 18px rgba(11, 108, 216, .25); }
.btn.ghost { border: 2px solid var(--navy); color: var(--navy); background: #fff; }
.btn.ghost:hover { background: var(--blue-bg); }
.btn.small { padding: 7px 12px; }
.btn.oauth { border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
input, select { border-radius: 8px; border-color: var(--line); padding: 11px 13px; }
input:focus, select:focus { outline: 2px solid var(--navy); border-color: var(--navy); }
/* Flèche des menus déroulants : dessinée, avec de l'air à droite (la flèche du navigateur colle au bord) */
select { -webkit-appearance: none; appearance: none; padding-right: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 12px 8px; }
select::-ms-expand { display: none; }
.inline-form select { padding-right: 30px; background-position: right 10px center; }

.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 30px; }
.card h3 { font-size: 1.15rem; margin-bottom: 14px; }
.badge { border: 0; font-weight: 700; letter-spacing: .03em; }
.badge.green { background: #DCFCE7; color: #15803D; }
.badge.amber { background: #FEF3C7; color: #92400E; }
.badge.navy { background: var(--navy); }


/* Offres : mêmes cartes que les tarifs de l'accueil */
.offers { gap: 20px; margin-top: 40px; align-items: start; }
.offer { border: 0; border-radius: 12px; box-shadow: var(--shadow-sm); padding: 28px 24px 22px; }
.offer.best { border: 2px solid var(--navy); padding-top: 62px; box-shadow: var(--shadow); }
.offer .tag { top: -2px; left: -2px; right: -2px; background: var(--navy); color: #fff; border-radius: 10px 10px 0 0; padding: 10px 22px; font-size: 13px; font-weight: 800; letter-spacing: .03em; }
.offer .name { font-size: 1.4rem; font-weight: 700; color: var(--green); }
.offer.best .name { color: var(--navy); }
.offer .price b { font-family: var(--text); font-weight: 500; font-size: 2.2rem; color: var(--ink); }
.offer .sub { color: var(--muted) !important; font-size: .9rem; }
.offer .btn { margin-top: 14px; }
.consent { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm); }

.toolbar { margin-bottom: 22px; }
.empty { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 40px 24px; }


/* Connexion, bienvenue */
.auth { max-width: 460px; margin: 64px auto; }
.auth .card { padding: 36px; box-shadow: var(--shadow); }
.welcome .card { box-shadow: var(--shadow); }
.welcome .state { border-radius: 12px; }

/* Pages légales */
.legal-page { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 48px clamp(20px, 5vw, 64px); margin: 40px auto 0; }

/* Admin */
.tile { border: 0; border-radius: 14px; box-shadow: var(--shadow-sm); }
.tile .value { font-weight: 800; color: var(--ink); }
.tabs button.active { color: var(--navy); border-bottom-color: var(--navy); }
table { background: #fff; border-radius: 12px; overflow: hidden; }

footer { background: #F3F6FA; border-top: 1px solid var(--line); margin-top: 72px; padding: 32px 0 40px; }

@media (max-width: 860px) {
  .site-head .main-links { display: none; }
  .site-head .wrap { height: auto; padding: 12px 18px; }
  .site-head nav .login { display: none; }
}

/* ===== Espace client (compte.html) — bloc unique ===== */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 40; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bandeau : une seule prochaine étape */
.banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; padding: 22px 26px; margin-bottom: 16px; border-radius: var(--radius); background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.banner p { margin: 0; font-weight: 600; font-size: 1.08rem; color: #fff; text-wrap: pretty; }
.banner .btn.primary { background: #fff; color: var(--navy); }
.banner .btn.primary:hover { background: var(--blue-bg); }
.banner.green { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.banner.green p { color: var(--ink); }
.banner.green .btn.primary { background: var(--navy); color: #fff; }
.page-msg:empty { min-height: 0; margin: 0; }
.load-error { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.load-error p { margin: 0; }

/* Onglets */
.acct-tabs { margin: 8px 0 28px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.acct-tabs button { min-height: 44px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: color .2s var(--ease), border-color .2s var(--ease); }
.acct-tabs button:hover { color: var(--ink); }
.acct-tabs button.active, .acct-tabs button.active:hover { color: var(--navy); }
.acct-tabs .count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--blue-bg); color: var(--navy); }
.panel:focus { outline: none; }
.show-sm { display: none; }
.panel > .card + .card { margin-top: 16px; }
.flush { margin-top: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.actions input { width: auto; flex: 1 1 160px; margin: 0; }
.confirm { background: var(--blue-bg); border-radius: 12px; padding: 16px 18px; margin-top: 4px; }

/* Abonnement */
.plan-text { font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.meter { height: 10px; margin-top: 10px; border-radius: 99px; overflow: hidden; background: var(--blue-bg); }
.meter span { display: block; height: 100%; background: var(--navy); transition: width .6s var(--ease); }
.manage { display: flex; flex-direction: column; gap: 12px; }
.manage h3 { margin-bottom: 0; }
.offers-block { margin-top: 36px; }
.price-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.price-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.price-list .price { font-weight: 700; color: var(--ink); }
.promo-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; max-width: 440px; }
.promo-row label { flex: 1 1 200px; }
.offers-wrap { max-width: 640px; }

/* Paramètres */
.infos { margin: 0; display: grid; gap: 14px; }
.infos dt { font-size: 14px; color: var(--muted); }
.infos dd { margin: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.danger-zone { margin-top: 40px !important; box-shadow: none; border: 1px solid #F5C9CB; }
.danger-zone h3 { color: var(--red); }
.sub-block { background: var(--amber-bg); border-radius: 8px; padding: 10px 12px; }
.btn.danger:hover { background: #F9D7D9; }

/* Analyses sauvegardées */
.hint { margin: -12px 0 20px; }
.analyses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.analysis { background: var(--card); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.analysis:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.analysis .thumb { height: 160px; background: var(--blue-bg) url("../img/illus/maison.svg") center / cover no-repeat; }
.analysis .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.analysis .body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.analysis .title { margin: 0; font-size: 1.05rem; line-height: 1.3; color: var(--ink); font-weight: 800; }
.analysis .stats { display: flex; gap: 6px; flex-wrap: wrap; }
.stat { font-size: 13px; padding: 4px 10px; border-radius: 8px; background: #F6F8FB; font-weight: 700; color: var(--ink); }
.stat.pos { background: #DCFCE7; color: #15803D; }
.stat.neg { background: #FEE2E2; color: #B91C1C; }
.analysis .foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.link-btn.remove { color: var(--muted); font-size: 14px; text-decoration: none; padding: 10px 4px; }
.link-btn.remove:hover { color: var(--red); text-decoration: underline; }
.analysis.skeleton { min-height: 330px; background: #fff; box-shadow: var(--shadow-sm); }
.analysis.skeleton:hover { transform: none; box-shadow: var(--shadow-sm); }
.more { text-align: center; margin-top: 28px; }
.empty-title { font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.empty p { margin: 0 0 10px; }
.empty p:last-child { margin-bottom: 0; }

/* Message « Analyse retirée — Annuler » */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 16px; max-width: calc(100% - 32px); padding: 10px 10px 10px 18px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.toast-undo { background: none; border: 0; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px 10px; min-height: 44px; }
.toast-undo:focus-visible { outline-color: #fff; }

@media (max-width: 600px) {
  .acct-tabs { gap: 0; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .acct-tabs button { padding: 10px 9px; font-size: 15px; }
  #panel-analyses .toolbar input, #panel-analyses .toolbar select { flex: 1 1 100%; width: 100%; }
  .banner { padding: 18px 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .analysis.skeleton { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .55; } }
  /* Changement d'onglet : fondu court ; pas d'entrée décalée des cartes dans les onglets */
  .js-reveal .panel .card { animation: none; }
  .panel:not([hidden]) { animation: fade .25s var(--ease) both; }
  @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .analysis:hover { transform: none; }
  .meter span { transition: none; }
}

/* Espace client, onglet « Mon financement » (même langage que les autres onglets : cartes blanches, bleu Flairloc) */
.fin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.fin-main { display: flex; flex-direction: column; gap: 22px; }
.fin-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 10px; }
.fin-note { margin: 12px 0 0; }
.fin-privacy { margin: 0 6px; }
.fields { display: grid; gap: 16px 18px; margin-top: 18px; }
.fields.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.fields.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.in-unit { position: relative; display: block; }
.in-unit input { padding-right: 36px; }
.in-unit i { position: absolute; right: 13px; top: 50%; transform: translateY(-38%); font-style: normal; color: var(--muted); pointer-events: none; }
.fin-layout input[aria-invalid="true"], .fin-layout select[aria-invalid="true"] { border-color: var(--red); background-color: var(--red-bg); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.choice:hover { border-color: #C7D7F0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-title { font-weight: 700; color: var(--ink); font-size: 16px; }
.choice-text { font-size: 14px; color: var(--muted); line-height: 1.45; }
.choice:has(input:checked) { border-color: var(--navy); background: var(--blue-bg); }
.sci-choice { margin-top: 18px; padding-left: 50px; }
.sci-flow { display: block; margin-top: 14px; font-weight: 600; font-size: 14px; }
.sci-choice input { opacity: 1; pointer-events: auto; position: absolute; left: 18px; top: 18px; width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.choice:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 2px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg); }
.seg-opt { position: relative; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:has(input:checked) { background: var(--card); color: var(--navy); box-shadow: var(--shadow-sm); }
.seg-opt:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 1px; }
.fin-layout:not(.apport-pct) .apport-percent, .fin-layout.apport-pct .apport-amount { display: none; }
.fin-layout:not(.societe) .societe-only { display: none; }
.fin-more { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.fin-more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.fin-summary dl { margin: 0; display: flex; flex-direction: column; }
.fin-summary dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fin-summary dt { color: var(--muted); font-size: 14px; }
.fin-summary dd { margin: 0; font-weight: 700; text-align: right; }
.fin-summary .big dd { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); }
.fin-summary .actions .btn { flex: 1; }
@media (max-width: 900px) {
  .fin-layout { grid-template-columns: 1fr; }
  .fin-side { position: static; }
}

/* Analyse en pleine page (analyse.html) */
.an-page { padding-bottom: 24px; }
.an-back { display: inline-block; margin: 28px 0 14px; font-weight: 700; text-decoration: none; }
.an-h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); margin: 4px 0 6px; line-height: 1.15; }
.an-hero { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 26px; padding: 18px; align-items: start; }
.an-photo { border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--blue-bg) url("../img/illus/maison.svg") center / cover no-repeat; }
.an-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.an-hero-body { padding: 6px 6px 6px 0; }
.an-sub { margin: 0 0 12px; color: var(--ink-2); }
.an-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 4px; }
.an-price b { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.an-price span { color: var(--muted); font-weight: 600; }
.an-frozen { margin: 12px 0 0; }
.an-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 420px; margin: 26px 0 16px; padding: 4px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
.an-switch button { border: 0; background: none; padding: 10px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.an-switch button:hover:not(:disabled) { color: var(--ink); }
.an-switch button[aria-checked="true"] { background: var(--blue-bg); color: var(--navy); }
.an-switch button:disabled { opacity: .45; cursor: not-allowed; }
.an-mode { display: grid; gap: 14px; }
.an-verdict { border-radius: 16px; padding: 18px 22px; background: var(--card); box-shadow: var(--shadow-sm); }
.an-verdict.good { background: #DCFCE7; box-shadow: none; } .an-verdict.neutral { background: #FEF3C7; box-shadow: none; } .an-verdict.bad { background: #FEE2E2; box-shadow: none; }
.an-verdict p { margin: 8px 0 0; font-size: 1.05rem; color: var(--ink); }
.an-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .03em; padding: 2px 10px; border-radius: 999px; background: #F1F5F9; color: var(--ink-2); vertical-align: middle; }
.an-tag.good { background: #DCFCE7; color: #15803D; } .an-tag.warn, .an-tag.neutral { background: #FEF3C7; color: #92400E; } .an-tag.bad { background: #FEE2E2; color: #B91C1C; }
.an-verdict .an-tag { background: #fff; }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.an-kpi { background: var(--card); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 14px 16px; min-width: 0; }
.an-kpi span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.an-kpi b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.an-kpi small { display: block; font-size: 12.5px; color: var(--muted); }
.an-kpi.pos b, .an-mini.pos b { color: #15803D; } .an-kpi.neg b, .an-mini.neg b { color: #B91C1C; }
.an-years { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.an-years button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 14px; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.an-years button[aria-pressed="true"] { background: var(--blue-bg); border-color: transparent; color: var(--navy); }
.an-inner { padding: 22px; }
.an-flow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) auto; gap: 8px 14px; align-items: center; font-size: 14px; margin: 6px 0 12px; }
.an-flow .track { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.an-flow .bar { display: block; height: 100%; border-radius: 5px; background: #FCA5A5; }
.an-flow .bar.plus { background: #93C5FD; } .an-flow .bar.total { background: #86EFAC; } .an-flow .bar.total.neg { background: #F87171; }
.an-flow b { text-align: right; white-space: nowrap; }
.an-flow .sum { font-weight: 800; color: var(--ink); }
.an-nav { position: sticky; top: 69px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 28px -4px 14px; padding: 10px 4px; background: var(--bg); }
.an-nav a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-sm); font-weight: 700; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.an-nav a:hover { color: var(--navy); }
.an-section { margin-top: 18px; scroll-margin-top: 140px; }
.an-section h2 { font-size: 1.35rem; margin-bottom: 14px; }
.an-section h3 { font-size: 1rem; margin: 20px 0 8px; }
.an-section h4 { font-size: .95rem; margin: 16px 0 6px; }
.an-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 32px; }
.an-cols h3:first-child, .an-cols > div > h3:first-child { margin-top: 0; }
.an-kv { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.an-kv th, .an-kv td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; background: none; font-size: 14.5px; }
.an-kv th { color: var(--muted); font-weight: 500; padding-right: 14px; width: 48%; }
.an-kv td { font-weight: 600; color: var(--ink); }
.an-scroll { overflow-x: auto; }
.an-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.an-table th, .an-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.an-table th:first-child, .an-table td:first-child { text-align: left; white-space: normal; }
.an-table thead th { font-size: 12.5px; color: var(--muted); background: var(--bg); }
.an-table tbody th { font-weight: 500; color: var(--ink-2); background: none; }
.an-table tr.hl td, .an-table tr.hl th { background: var(--blue-bg); }
.an-table tr.na td { color: var(--muted); }
.an-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.an-details summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.an-calc { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.an-calc td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.an-calc td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.an-calc tr.subtotal td { font-weight: 800; color: var(--ink); }
.an-calc tr.deduct td:last-child { color: #B91C1C; } .an-calc tr.info td { color: var(--muted); }
.an-calc .note { display: block; font-size: 12.5px; color: var(--muted); }
.an-box { border-radius: 12px; padding: 14px 16px; background: var(--bg); font-size: 14.5px; }
.an-box.good { background: #DCFCE7; } .an-box.warn { background: #FEF3C7; } .an-box.bad { background: #FEE2E2; }
.an-gauge { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .7); margin: 10px 0 8px; }
.an-gauge i { display: block; height: 100%; border-radius: 5px; background: var(--navy); }
.an-gauge em { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--ink); }
.an-fig { margin: 12px 0 0; }
.an-fig figcaption { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.an-chart { width: 100%; max-width: 820px; height: auto; display: block; }
.an-chart text { font-size: 12px; fill: var(--muted); }
.an-chart .grid { stroke: var(--line); }
.an-chart .area { fill: var(--navy); fill-opacity: .08; }
.an-chart .l1 { fill: none; stroke: var(--navy); stroke-width: 2.5; }
.an-chart .l2 { fill: none; stroke: #94A3B8; stroke-width: 2.5; stroke-dasharray: 5 4; }
.an-chart .bar-pos { fill: var(--navy); } .an-chart .bar-neg { fill: #EB6834; } .an-chart .axis0 { stroke: #94A3B8; }
.an-proj td, .an-proj th { text-align: right; white-space: nowrap; } .an-proj th:first-child { text-align: left; } .an-proj tbody th { font-weight: 600; vertical-align: middle; }
.an-chart .lab1 { fill: var(--navy); font-weight: 700; } .an-chart .lab2 { fill: #64748B; font-weight: 700; }
.an-insights { display: grid; gap: 8px; margin-bottom: 6px; }
.an-insight { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: 14.5px; }
.an-insight.good { background: #DCFCE7; color: #14532D; } .an-insight.warn { background: #FEF3C7; color: #78350F; }
.an-minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.an-mini { border-radius: 12px; background: var(--bg); padding: 12px 14px; }
.an-mini span { display: block; font-size: 13px; color: var(--muted); }
.an-mini b { display: block; font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.an-mini small { display: block; font-size: 12.5px; color: var(--muted); }
.an-spark { display: block; width: 100%; height: 70px; margin-top: 10px; }
.an-spark polygon { fill-opacity: .08; } .an-spark polyline { fill: none; stroke-width: 2; }
.an-spark.up polygon { fill: #15803D; } .an-spark.up polyline { stroke: #15803D; }
.an-spark.down polygon { fill: #B91C1C; } .an-spark.down polyline { stroke: #B91C1C; }
.an-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.an-list { margin: 10px 0 0; padding-left: 18px; font-size: 14.5px; }
.an-list li { margin: 3px 0; }
.an-empty { margin-top: 10px; }
.an-disclaimer { margin: 22px 4px 0; }
.analysis .foot { flex-wrap: wrap; }
.analysis .card-links { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.analysis .card-links .btn { width: 100%; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.analysis .card-links .btn:only-child { grid-column: 1 / -1; }
.analysis .foot .remove { margin-left: auto; }
.an-ctl { margin-top: 18px; padding: 20px 22px; }
.an-ctl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.an-ctl-grid label { font-size: 14px; }
.an-ctl-note { margin: 10px 0 0; }
.an-ctl .btn { margin-top: 10px; }
.an-ctl-err { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #FEE2E2; color: #7F1D1D; font-size: 14px; }
.an-demand { border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: 14.5px; }
.an-demand.good { background: #DCFCE7; color: #14532D; } .an-demand.neutral { background: #FEF3C7; color: #78350F; } .an-demand.warn { background: #FEE2E2; color: #7F1D1D; }
.an-demand .small { display: block; margin-top: 2px; }
@media (max-width: 760px) {
  .an-nav { position: static; margin-top: 20px; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .an-kpi { padding: 12px; } .an-kpi b { font-size: 1.25rem; }
  .an-photo { aspect-ratio: 16 / 9; }
  .an-section { scroll-margin-top: 90px; }
  .an-hero { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .an-hero-body { padding: 0 4px 4px; }
  .an-flow { grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) auto; gap: 8px 10px; font-size: 13.5px; }
}
@media print {
  .site-head, footer, .an-back, .an-nav, .an-switch, .skip-link { display: none !important; }
  .an-section { break-inside: avoid; box-shadow: none; border: 1px solid var(--line); }
}

/* Menu « Mon compte » de l'en-tête */
.acct-menu { position: relative; }
.site-head nav .acct-toggle { display: inline-flex; align-items: center; gap: 8px; }
.acct-toggle .chev { transition: transform .2s var(--ease); }
.acct-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.site-head nav .acct-toggle.active { background: #fff; box-shadow: var(--shadow-sm); color: var(--navy); }
.acct-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 230px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .12); display: flex; flex-direction: column; }
.acct-list[hidden] { display: none; }
.site-head nav .acct-list a { display: block; padding: 10px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.site-head nav .acct-list a:hover, .site-head nav .acct-list a:focus-visible { background: var(--bg); color: var(--navy); }
.site-head nav .acct-list a[aria-current="page"] { color: var(--navy); font-weight: 700; }
@media (max-width: 640px) { .acct-list { right: auto; left: 0; } }

/* Estimation d'un bien */
.est-intro { max-width: 680px; margin: -12px 0 24px; }
.est-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 56px; }
.est-form { display: flex; flex-direction: column; gap: 14px; }
.est-form label { font-weight: 600; font-size: 14px; }
.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.est-grid label:first-child { grid-column: 1 / -1; }
.est-card .est-place { margin: 0 0 6px; }
.est-value { font-family: var(--display); font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.est-range { color: var(--ink-2); margin: 2px 0 10px; }
.est-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.est-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 4px; }
.est-table th { text-align: right; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.est-table td { text-align: right; padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.est-table th:first-child, .est-table td:first-child { text-align: left; white-space: normal; }
.est-table .addr { display: block; color: var(--ink); }
.est-table .sub { display: block; color: var(--muted); font-size: 12.5px; }
.est-alts { margin-top: 8px; font-size: 14px; }
.est-alts .link-btn { display: block; margin: 6px 0; text-align: left; }
@media (max-width: 860px) { .est-layout { grid-template-columns: 1fr; } }
