/* ==========================================================================
   dispositif-relance-logement.net — feuille de style
   Inspiration : charte des sites institutionnels (sobriété, lisibilité,
   accessibilité). Aucun élément d'identité de l'État n'est repris.
   ========================================================================== */

:root {
  --blue: #000091;
  --blue-hover: #1212ff;
  --blue-light: #e3e3fd;
  --blue-lighter: #f5f5fe;
  --red: #c9191e;
  --green: #18753c;
  --green-light: #b8fec9;
  --orange: #b34000;
  --orange-light: #ffe9e6;
  --text: #161616;
  --text-mention: #666666;
  --border: #dddddd;
  --grey-bg: #f6f6f6;
  --grey-bg-2: #eeeeee;
  --white: #ffffff;
  --focus: #0a76f6;
  --radius: 4px;
  --container: 1200px;
  --font: "Public Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 1rem; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin-bottom: .35rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .container { padding: 0 1.5rem; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--blue); color: var(--white); padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }

/* ---------- Bandeau d'indépendance ---------- */
.topbar {
  background: var(--grey-bg);
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-mention);
}
.topbar .container { padding-top: .35rem; padding-bottom: .35rem; }

/* ---------- En-tête ---------- */
.header { border-bottom: 1px solid var(--border); background: var(--white); }
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1rem; padding-bottom: 1rem;
}
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__logo {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--blue); display: grid; place-items: center;
}
.brand__logo svg { width: 30px; height: 30px; }
.brand__name { font-weight: 700; font-size: 1.15rem; line-height: 1.2; display: block; }
.brand__tagline { font-size: .85rem; color: var(--text-mention); display: block; }

.btn.header__cta { display: none; }
@media (min-width: 992px) { .btn.header__cta { display: inline-flex; } }

.mobile-cta { padding-bottom: 1rem; }
@media (min-width: 992px) { .mobile-cta { display: none; } }

.menu-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .5rem .75rem; font: inherit; font-size: .9rem; color: var(--blue); cursor: pointer;
}
@media (min-width: 992px) { .menu-toggle { display: none; } }

/* ---------- Navigation ---------- */
.nav { border-bottom: 1px solid var(--border); background: var(--white); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nav li { margin: 0; }
.nav a {
  display: block; padding: .9rem 1rem; text-decoration: none; color: var(--text);
  font-size: .95rem; border-left: 3px solid transparent;
}
.nav a:hover { background: var(--grey-bg); color: var(--text); }
.nav a[aria-current="page"] { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
.nav .container { padding: 0; }
@media (max-width: 991px) {
  .nav { display: none; }
  .nav.is-open { display: block; }
}
@media (min-width: 992px) {
  .nav .container { padding: 0 1.5rem; }
  .nav ul { flex-direction: row; }
  .nav a { border-left: 0; border-bottom: 3px solid transparent; padding: 1rem 1.1rem; }
  .nav a[aria-current="page"] { border-bottom-color: var(--blue); }
}

/* ---------- Bandeau d'information ---------- */
.notice { background: var(--blue-light); color: var(--blue); font-size: .9rem; }
.notice .container { display: flex; gap: .6rem; align-items: flex-start; padding-top: .7rem; padding-bottom: .7rem; }
.notice svg { flex: 0 0 auto; margin-top: .2rem; }
.notice a { font-weight: 600; }

/* ---------- Fil d'Ariane ---------- */
.breadcrumb { font-size: .8rem; color: var(--text-mention); padding: 1rem 0 0; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: .3rem; }
.breadcrumb a { color: var(--text-mention); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: var(--radius); border: 1px solid var(--blue);
  background: var(--blue); color: var(--white); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; line-height: 1.3; text-align: center;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: var(--white); }
.btn--secondary { background: var(--white); color: var(--blue); }
.btn--secondary:hover { background: var(--blue-lighter); color: var(--blue); }
.btn--white { background: var(--white); color: var(--blue); border-color: var(--white); }
.btn--white:hover { background: var(--blue-light); color: var(--blue); border-color: var(--blue-light); }
.btn--lg { padding: .9rem 1.8rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn-group { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Sections ---------- */
.section { padding: 3rem 0; }
@media (min-width: 768px) { .section { padding: 4rem 0; } }
.section--grey { background: var(--grey-bg); }
.section--blue { background: var(--blue); color: var(--white); }
.section--blue a:not(.btn) { color: var(--white); }
.section__intro { max-width: 760px; color: var(--text-mention); font-size: 1.05rem; }
.section--blue .section__intro { color: #dcdcff; }

.lead { font-size: 1.15rem; }
.mention { font-size: .8rem; color: var(--text-mention); }

/* ---------- Héros ---------- */
.hero { background: var(--blue-lighter); border-bottom: 1px solid var(--border); padding: 2.5rem 0 3rem; }
.hero__grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 992px) { .hero__grid { grid-template-columns: 1.3fr 1fr; gap: 3rem; } }
.hero__kicker {
  display: inline-block; background: var(--blue); color: var(--white);
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: .2rem .6rem; border-radius: var(--radius); margin-bottom: 1rem;
}
.hero h1 { color: var(--blue); }
.hero .lead { margin-bottom: 1.5rem; }

.page-header { background: var(--blue-lighter); border-bottom: 1px solid var(--border); padding: 1rem 0 2.5rem; }
.page-header h1 { color: var(--blue); margin-top: 1.5rem; }
.page-header .lead { max-width: 820px; margin-bottom: 0; }

/* ---------- Chiffres clés ---------- */
.keyfigures { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.keyfigure {
  background: var(--white); border: 1px solid var(--border); border-bottom: 4px solid var(--blue);
  padding: 1.1rem; border-radius: var(--radius);
}
.keyfigure__value { font-size: 1.6rem; font-weight: 800; color: var(--blue); line-height: 1.1; display: block; }
.keyfigure__label { font-size: .85rem; color: var(--text-mention); display: block; margin-top: .35rem; }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 3rem; } }
/* Empêche le contenu (tableaux) d'élargir les colonnes au-delà de l'écran */
.grid > *, .layout > *, .simulator > * { min-width: 0; }
.layout__aside { align-self: start; }
@media (min-width: 992px) {
  .layout--form-first > .layout__aside { grid-column: 2; grid-row: 1; }
  .layout--form-first > :not(.layout__aside) { grid-column: 1; grid-row: 1; }
}
@media (min-width: 992px) { .layout__aside { position: sticky; top: 1.5rem; } }

/* ---------- Cartes / tuiles ---------- */
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; height: 100%;
}
.card h3 { color: var(--blue); }
.card p:last-child { margin-bottom: 0; }
.card--link { position: relative; border-bottom: 4px solid var(--blue); transition: background .15s; }
.card--link:hover { background: var(--blue-lighter); }
.card--link a::after { content: ""; position: absolute; inset: 0; }
.card__more { margin-top: auto; padding-top: 1rem; font-weight: 600; color: var(--blue); }
.card__icon {
  width: 48px; height: 48px; border-radius: 50%; background: var(--blue-light); color: var(--blue);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.card__icon svg { width: 24px; height: 24px; }

.tag {
  display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .55rem;
  border-radius: 1rem; background: var(--blue-light); color: var(--blue); margin-bottom: .75rem;
}
.tag--green { background: var(--green-light); color: var(--green); }
.tag--orange { background: var(--orange-light); color: var(--orange); }

/* ---------- Encadrés ---------- */
.callout {
  background: var(--blue-lighter); border-left: 4px solid var(--blue);
  padding: 1.25rem 1.5rem; margin: 1.5rem 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.callout__title { font-weight: 700; font-size: 1.05rem; margin-bottom: .5rem; display: block; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout--warning { background: var(--orange-light); border-left-color: var(--orange); }
.callout--warning .callout__title { color: var(--orange); }
.callout--success { background: #e6feda; border-left-color: var(--green); }
.callout--success .callout__title { color: var(--green); }

.highlight {
  border-left: 4px solid var(--blue); padding-left: 1.25rem; margin: 1.5rem 0; font-size: 1.1rem;
}

/* ---------- Contenu éditorial ---------- */
.prose h2 { margin-top: 2.5rem; padding-top: .5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.75rem; }

.toc { background: var(--grey-bg); padding: 1.25rem 1.5rem; border-radius: var(--radius); margin-bottom: 2rem; }
.toc strong { display: block; margin-bottom: .5rem; }
.toc ol { margin: 0; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: 1.25rem 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--white); }
caption { text-align: left; font-weight: 700; padding: .9rem 1rem; background: var(--grey-bg); border-bottom: 1px solid var(--border); }
th, td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--blue); color: var(--white); font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--grey-bg); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.total td, tr.total th { font-weight: 700; background: var(--blue-light) !important; color: var(--blue); }
@media (max-width: 575px) {
  table { font-size: .85rem; }
  th, td { padding: .6rem .65rem; }
  thead th { white-space: normal; }
  caption { padding: .75rem .65rem; }
}

/* ---------- Étapes ---------- */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1rem; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li {
  counter-increment: step; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin: 0; position: relative;
}
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; background: var(--blue); color: var(--white); font-weight: 700; margin-bottom: .75rem;
}
.steps strong { display: block; margin-bottom: .25rem; }

/* ---------- Liste de contrôle ---------- */
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.9rem; margin-bottom: .6rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/70% no-repeat;
}
.checklist--cross li::before {
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center/60% no-repeat;
}

/* ---------- Accordéon (FAQ) ---------- */
.accordion { border-top: 1px solid var(--border); }
.accordion details { border-bottom: 1px solid var(--border); }
.accordion summary {
  cursor: pointer; list-style: none; padding: 1rem 2.5rem 1rem 0; font-weight: 600;
  color: var(--blue); position: relative;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+"; position: absolute; right: .5rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400;
}
.accordion details[open] summary::after { content: "−"; }
.accordion details[open] summary { background: var(--blue-lighter); }
.accordion .accordion__body { padding: 0 0 1rem; }

/* ---------- Formulaires ---------- */
.form-box {
  background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--blue);
  border-radius: var(--radius); padding: 1.5rem;
}
.form-box h2, .form-box h3 { color: var(--blue); }
.form-box--elevated { box-shadow: 0 6px 18px rgba(0, 0, 18, .12); }
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 576px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.form-group { margin-bottom: 1rem; }
.form-grid .form-group { margin-bottom: 0; }
label, .label { display: block; font-size: .95rem; margin-bottom: .35rem; font-weight: 500; }
.hint { display: block; font-size: .8rem; color: var(--text-mention); font-weight: 400; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; font: inherit; padding: .65rem .8rem; color: var(--text);
  background: var(--grey-bg-2); border: 0; border-bottom: 2px solid #3a3a3a;
  border-radius: var(--radius) var(--radius) 0 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-bottom-color: var(--red); }
.error-msg { color: var(--red); font-size: .85rem; margin-top: .3rem; display: none; }
.form-group.has-error .error-msg { display: block; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; margin: 1rem 0; }
.checkbox input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; flex: 0 0 auto; accent-color: var(--blue); }
.checkbox label { font-weight: 400; margin: 0; font-size: .85rem; }
.radio-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-group label {
  display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border);
  border-radius: var(--radius); padding: .45rem .8rem; cursor: pointer; margin: 0; font-weight: 400;
}
.radio-group input { accent-color: var(--blue); }
.radio-group label:has(input:checked) { border-color: var(--blue); background: var(--blue-lighter); color: var(--blue); font-weight: 600; }
.hp { position: absolute; left: -9999px; }
.form-success { display: none; }
.form-success.is-visible { display: block; }
form.is-hidden { display: none; }

/* ---------- Simulateur ---------- */
.simulator { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .simulator { grid-template-columns: 1fr 1fr; } }
.sim-results { background: var(--blue-lighter); border: 1px solid var(--blue-light); border-radius: var(--radius); padding: 1.5rem; }
.sim-results h3 { color: var(--blue); }
.sim-results dl { margin: 0; }
.sim-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--blue-light); }
.sim-row dt { color: var(--text); }
.sim-row dd { margin: 0; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sim-total {
  margin-top: 1.25rem; background: var(--blue); color: var(--white); border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.sim-total span { display: block; font-size: .9rem; opacity: .9; }
.sim-total strong { font-size: 2rem; line-height: 1.2; }
.sim-warning { font-size: .85rem; color: var(--orange); margin-top: .75rem; display: none; }
.sim-warning.is-visible { display: block; }

/* ---------- Guide ---------- */
.guide-cover {
  background: var(--blue); color: var(--white); border-radius: var(--radius); padding: 2rem;
  aspect-ratio: 3 / 4; max-width: 320px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 12px 12px 0 var(--blue-light);
}
/* Mobile / tablette : couverture centrée au-dessus du formulaire */
.guide-cover--mobile { width: 100%; max-width: 260px; margin: 0 auto; }
@media (max-width: 991px) {
  .guide-cover--desktop { display: none; }
  .guide-intro { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 992px) { .guide-cover--mobile { display: none; } }
.guide-cover__top { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.guide-cover__title { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.guide-cover__sub { font-size: .95rem; opacity: .9; }

/* ---------- Bandeau CTA ---------- */
.cta-band { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 768px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { margin-bottom: .5rem; }
.cta-band p { margin: 0; }

/* ---------- Pied de page ---------- */
.footer { border-top: 3px solid var(--blue); background: var(--white); padding: 2.5rem 0 0; font-size: .9rem; }
.footer__grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h2 { font-size: 1rem; }
.footer ul { list-style: none; padding: 0; }
.footer a { color: var(--text); }
.footer__disclaimer { color: var(--text-mention); }
.footer__bottom {
  border-top: 1px solid var(--border); margin-top: 2rem; padding: 1rem 0; font-size: .8rem;
  color: var(--text-mention); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
}
.footer__bottom a { color: var(--text-mention); }

/* ---------- Utilitaires ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; } .mb-2 { margin-bottom: 2rem; }
.text-blue { color: var(--blue); }
.text-center { text-align: center; }
