/*
 * bonus-pac — portage de la maquette « Bonus PAC.dc.html ».
 * Mobile first : styles de base à 320 px, élargissements en min-width (640, 960).
 */
@font-face {
    font-family: Archivo;
    src: url("../fonts/archivo-latin-eYWgLOH.woff2") format('woff2');
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Public Sans';
    src: url("../fonts/public-sans-latin-29KbApT.woff2") format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --green: #0B5E4B;
    --green-hover: #083F33;
    --bg: #F4F2ED;
    --ink: #16211D;
    --ok-bg: #E9F3EF;
    --amber: #A36E1A;
    --amber-bg: #FAF3E6;
    --error: #A3301A;
    --radius-field: 10px;
    --radius-block: 16px;
    --font-title: Archivo, system-ui, sans-serif;
    --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    font-family: 'Public Sans', system-ui, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--green); }
a:hover { color: var(--green-hover); }
input, select, button { font-family: inherit; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}
.visually-hidden {
    position: absolute !important;
    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: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* En-tête */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px var(--gutter);
    background: rgb(255 255 255 / .92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid rgb(22 33 29 / .10);
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand__name { font-family: var(--font-title); font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.brand__sep { width: 1px; height: 16px; background: rgb(22 33 29 / .16); }
.brand__tag { font-size: 13px; color: rgb(22 33 29 / .6); white-space: nowrap; }
.site-header__aside { font-size: 12.5px; color: rgb(22 33 29 / .55); }
.site-header__back { font-size: 13px; text-decoration: none; font-weight: 600; white-space: nowrap; }

/* Contenu */
.main {
    flex: 1;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    padding: clamp(30px, 6vw, 64px) clamp(16px, 4vw, 32px) 60px;
}
.intro { display: flex; flex-direction: column; gap: 11px; margin-bottom: 26px; }
.eyebrow { font-family: var(--font-title); font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--green); }
.intro h1 {
    margin: 0;
    font-family: var(--font-title);
    font-weight: 600;
    font-size: clamp(29px, 5.2vw, 46px);
    line-height: 1.07;
    letter-spacing: -.022em;
    max-width: 19ch;
    text-wrap: pretty;
}
.intro p { margin: 0; max-width: 58ch; font-size: clamp(15px, 2vw, 17.5px); line-height: 1.55; color: rgb(22 33 29 / .66); text-wrap: pretty; }

/* Formulaire de vérification */
.card {
    background: #fff;
    border: 1px solid rgb(22 33 29 / .12);
    border-radius: var(--radius-block);
    padding: clamp(18px, 3.6vw, 30px);
    box-shadow: 0 1px 2px rgb(22 33 29 / .05), 0 20px 44px -34px rgb(22 33 29 / .5);
}
.fields { display: grid; grid-template-columns: 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; position: relative; }
.field__label { font-size: 13px; font-weight: 600; }
.select-wrap { position: relative; display: block; }
.select-wrap::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 11px;
    color: rgb(22 33 29 / .55);
}
.input, .select {
    width: 100%;
    height: 54px;
    padding: 0 15px;
    border: 1px solid rgb(22 33 29 / .22);
    border-radius: var(--radius-field);
    background: #fff;
    font-size: 16px; /* 16 px minimum : pas de zoom automatique sur iOS */
    color: var(--ink);
}
.select { appearance: none; padding-right: 42px; cursor: pointer; }
.select--compact { height: 50px; padding: 0 12px; appearance: auto; }

.form-error { margin: 10px 0 0; font-size: 13.5px; font-weight: 600; color: var(--error); }

.actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    padding: 0 28px;
    border: 0;
    border-radius: var(--radius-field);
    background: var(--green);
    color: #fff;
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .15s ease;
}
.btn:hover { background: var(--green-hover); color: #fff; }
.btn--md { height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn--sm { height: 46px; padding: 0 20px; font-size: 14.5px; }
.btn[aria-busy='true'] { opacity: .7; cursor: progress; }
.link-btn {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgb(22 33 29 / .62);
    font-size: 14.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    white-space: nowrap;
}
.link-btn[hidden] { display: none; }

/* Encarts */
.more { margin-top: clamp(38px, 7vw, 64px); }
.more h2 { margin: 0 0 14px; font-family: var(--font-title); font-size: 15px; font-weight: 600; letter-spacing: .01em; color: rgb(22 33 29 / .62); }
.tiles { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tile {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    width: 100%;
    text-align: left;
    padding: 16px;
    border: 1px solid rgb(22 33 29 / .13);
    border-radius: 12px;
    background: rgb(255 255 255 / .55);
    color: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.tile:hover { border-color: rgb(11 94 75 / .45); background: #fff; }
.tile__icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #EDF2F0; font-size: 16px; }
.tile__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile__title { font-family: var(--font-title); font-size: 14.5px; font-weight: 600; }
.tile__desc { font-size: 13px; line-height: 1.45; color: rgb(22 33 29 / .6); text-wrap: pretty; }

.source {
    margin: clamp(30px, 6vw, 52px) 0 0;
    padding-top: 18px;
    border-top: 1px solid rgb(22 33 29 / .1);
    font-size: 12.5px;
    line-height: 1.6;
    color: rgb(22 33 29 / .5);
    text-wrap: pretty;
}

/* Pied de page */
.site-footer { background: var(--ink); color: rgb(255 255 255 / .78); padding: clamp(30px, 5vw, 48px) var(--gutter) 26px; }
.site-footer__inner { max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.site-footer__cols { display: grid; grid-template-columns: 1fr; gap: 26px; }
.site-footer__col { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.site-footer__brand { font-family: var(--font-title); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.site-footer__heading { font-size: 11.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: rgb(255 255 255 / .5); }
.site-footer__text { margin: 0; font-size: 11.5px; line-height: 1.7; color: rgb(255 255 255 / .62); max-width: 48ch; text-wrap: pretty; }
.site-footer__text--contact { line-height: 1.9; }
.site-footer__text a { color: rgb(255 255 255 / .82); }
.site-footer__nav { display: flex; flex-direction: column; gap: 7px; }
.footer-link {
    align-self: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 11.5px;
    color: rgb(255 255 255 / .82);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}
.footer-link:hover { color: #fff; text-decoration: underline; }
.footer-link--underlined { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__legal {
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid rgb(255 255 255 / .14);
    font-size: 12px;
    line-height: 1.65;
    color: rgb(255 255 255 / .45);
    text-wrap: pretty;
}

/* Modales (<dialog> natif : focus piégé, Échap, retour du focus). Plein écran sur mobile. */
.modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    color: var(--ink);
}
.modal::backdrop { background: rgb(22 33 29 / .55); }
.modal[open] { animation: fade .15s ease; }
.modal__panel { width: 100%; padding: 20px 16px 28px; background: #fff; }
.modal__head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.modal__title {
    flex: 1;
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.015em;
    text-wrap: pretty;
}
.modal__title--sm { font-size: 22px; }
.modal__close {
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: #F1EFEA;
    font-size: 16px;
    cursor: pointer;
    color: var(--ink);
}
.modal__close:hover { background: #E4E1DA; }
.lead { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: rgb(22 33 29 / .75); text-wrap: pretty; }
.lead--last { margin-bottom: 18px; }
.callout {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-left: 3px solid var(--green);
    background: #F5F8F7;
    font-size: 14.5px;
    line-height: 1.6;
    color: rgb(22 33 29 / .8);
    text-wrap: pretty;
}
.chips { margin: 0 0 22px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 12px; border-radius: 999px; background: #EFF5F3; font-size: 13px; font-weight: 500; color: var(--green); }
.dashes { margin: 0 0 22px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.dashes li { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.5; color: rgb(22 33 29 / .8); }
.dashes li::before { content: '—'; color: var(--green); font-weight: 700; }
.facts { margin: 0 0 20px; display: flex; flex-direction: column; }
.facts > div { display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid rgb(22 33 29 / .09); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { flex: none; width: 190px; font-size: 13px; font-weight: 600; color: rgb(22 33 29 / .55); }
.facts dd { flex: 1; min-width: 170px; margin: 0; font-size: 14.5px; }
.rge-filters { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rge-submit { margin-top: 16px; }

/* Pages légales */
.main--legal { max-width: 800px; padding: clamp(30px, 6vw, 60px) clamp(16px, 4vw, 32px) 64px; }
.legal-footer { background: var(--ink); color: rgb(255 255 255 / .6); padding: 26px var(--gutter); }
.legal-footer__note {
    max-width: 800px;
    margin: 0 auto 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgb(255 255 255 / .14);
    font-size: 11.5px;
    line-height: 1.65;
    color: rgb(255 255 255 / .5);
    text-wrap: pretty;
}
.legal-footer__note strong { color: rgb(255 255 255 / .7); }
.legal-footer__bar { max-width: 800px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.legal-footer__bar span { font-size: 12.5px; }
.legal-footer__bar a { font-size: 13px; color: rgb(255 255 255 / .82); text-decoration: none; }
.legal-footer__bar a:hover { color: #fff; text-decoration: underline; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Mention France Rénov' (filets noirs haut et bas, comme le modèle fourni). */
.france-renov { margin-top: clamp(32px, 6vw, 52px); }
.france-renov__link { display: block; width: 100%; max-width: 700px; }
.france-renov__link:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.france-renov__img { display: block; width: 100%; height: auto; }

@media (min-width: 640px) {
    .fields { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
    .tiles { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
    .rge-filters { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .site-footer__cols { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
    .modal {
        width: calc(100% - 32px);
        max-width: 560px;
        height: auto;
        max-height: calc(100% - 2 * clamp(12px, 5vh, 64px));
        margin: clamp(12px, 5vh, 64px) auto 0;
        inset-block-end: auto; /* hauteur au contenu, comme la maquette */
        border-radius: var(--radius-block);
        box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5);
    }
    .modal[open] { animation: rise .2s ease; }
    .modal--wide { max-width: 640px; }
    .modal--narrow { max-width: 520px; }
    .modal__panel { padding: clamp(20px, 4vw, 32px); }
    .modal__close { width: 34px; height: 34px; }
}

@media (min-width: 960px) {
    .tiles { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
