/* MaterioScan : bleu de travail, mètre jaune, enduit frais */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/fonts/public-sans.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --enduit: #E7EBEF;
  --feuille: #FFFFFF;
  --bleu: #17357A;
  --bleu-fonce: #0F2659;
  --bleu-clair: #C9D6F2;
  --metre: #FFC917;
  --encre: #1E2430;
  --gris: #566072;
  --filet: #D3D9E1;
  --ok: #0B6E46;
  --ko: #B42E18;
  --titre: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --texte: "Public Sans", Verdana, Arial, sans-serif;
  --colonne: 760px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--enduit); color: var(--encre); font: 400 1.0625rem/1.5 var(--texte); padding-bottom: calc(76px + env(safe-area-inset-bottom)); overflow-x: hidden; }
h1, h2, h3 { font-family: var(--titre); font-weight: 800; letter-spacing: -0.015em; line-height: 1.08; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bleu); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--metre); outline-offset: 2px; box-shadow: 0 0 0 5px var(--bleu-fonce); border-radius: 4px; }
.colonne { max-width: var(--colonne); margin: 0 auto; padding: 0 20px; }
.page { padding-top: 32px; padding-bottom: 40px; }

/* Barre haute et onglets */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--bleu); color: #fff; }
.marque { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 1.25rem var(--titre); }
.marque img { border-radius: 8px; display: block; }
.nav-haut { display: none; gap: 6px; }
.nav-haut a { color: var(--bleu-clair); text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 8px; }
.nav-haut a:hover { color: #fff; }
.nav-haut a[aria-current="page"] { background: var(--metre); color: var(--encre); }
.onglets { position: fixed; z-index: 20; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--feuille); border-top: 1px solid var(--filet); padding-bottom: env(safe-area-inset-bottom); }
.onglets a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 8px; color: var(--gris); font-size: .8125rem; font-weight: 700; text-decoration: none; border-top: 3px solid transparent; margin-top: -1px; }
.onglets a[aria-current="page"] { color: var(--bleu); border-top-color: var(--metre); }

/* Saisie du projet */
.bandeau { background: var(--bleu); color: #fff; padding: 30px 0 34px; }
.bandeau h1 { font-size: clamp(2.5rem, 9vw, 4.25rem); max-width: 13em; margin-bottom: 26px; }
.saisie { background: var(--feuille); color: var(--encre); border-radius: 14px; padding: 16px; }
.saisie label { display: block; font-weight: 700; margin-bottom: 6px; }
.saisie textarea { display: block; width: 100%; border: 0; resize: vertical; min-height: 84px; font-size: 1.1875rem; padding: 2px 0; background: transparent; }
.saisie textarea:focus { outline: none; }
.saisie:focus-within { box-shadow: 0 0 0 3px var(--metre); }
.saisie-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.bouton-jaune, .bouton-bleu { border: 0; border-radius: 10px; font-weight: 700; padding: 13px 20px; cursor: pointer; }
.bouton-jaune { background: var(--metre); color: var(--encre); }
.bouton-jaune:hover { background: #FFD84F; }
.bouton-bleu { background: var(--bleu); color: #fff; }
.bouton-bleu:hover { background: var(--bleu-fonce); }
.bouton-clair { border: 2px solid var(--bleu); background: transparent; color: var(--bleu); border-radius: 10px; font-weight: 700; padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-block; }
.bouton-clair:hover { background: var(--bleu); color: #fff; }
.large { width: 100%; margin-top: 18px; }
button:disabled { opacity: .55; cursor: progress; }
.bouton-micro { display: inline-flex; align-items: center; gap: 6px; background: var(--enduit); border: 0; border-radius: 10px; padding: 0 14px; font-weight: 700; cursor: pointer; margin-right: auto; }
.bouton-micro[aria-pressed="true"] { background: var(--ko); color: #fff; }
.exemples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.exemples button { background: transparent; color: #fff; border: 1px solid #6F88C4; border-radius: 99px; padding: 6px 14px; font-size: .9375rem; cursor: pointer; }
.exemples button:hover { background: var(--bleu-fonce); }
.alerte { background: #FFF1EC; color: var(--ko); border-radius: 10px; padding: 12px 14px; margin: 14px 0 0; font-weight: 700; }

/* Questions */
.questions { padding-top: 28px; padding-bottom: 40px; }
.questions h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); margin-bottom: 6px; }
.recap { color: var(--gris); margin: 0 0 24px; }
.modifier { background: none; border: 0; padding: 0; color: var(--bleu); text-decoration: underline; cursor: pointer; font-weight: 700; }
.choix-mode { display: grid; gap: 12px; }
.choix-mode button { text-align: left; background: var(--feuille); border: 2px solid transparent; border-radius: 14px; padding: 18px 20px; cursor: pointer; display: grid; gap: 3px; }
@media (hover: hover) { .choix-mode button:hover { border-color: var(--bleu); } }
.choix-mode strong { font: 800 1.375rem/1.15 var(--titre); }
.choix-mode span { color: var(--gris); font-size: .96875rem; }
.champ { margin-bottom: 20px; }
.champ label, .sous-question { display: block; font-weight: 700; margin-bottom: 6px; }
input:not([type="file"]), select { width: 100%; border: 1.5px solid #AEB7C4; border-radius: 10px; padding: 11px 12px; background: #fff; }
.plus { margin-top: 18px; }
.plus summary { cursor: pointer; font-weight: 700; color: var(--bleu); }
.preciser .champ:first-of-type { margin-top: 16px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastilles button { border: 1.5px solid #AEB7C4; background: #fff; border-radius: 99px; padding: 7px 14px; cursor: pointer; }
.pastilles button[aria-pressed="true"] { background: var(--bleu); border-color: var(--bleu); color: #fff; }

/* Résultat : la règle */
.res-bandeau { background: var(--bleu); color: #fff; padding: 26px 0 30px; }
.res-titre { font-size: 1.1875rem; font-family: var(--texte); font-weight: 700; letter-spacing: 0; color: var(--bleu-clair); margin-bottom: 14px; }
.bascule { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--bleu-fonce); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.bascule button { border: 0; background: transparent; color: #fff; border-radius: 9px; padding: 9px 14px; font-weight: 700; cursor: pointer; }
.bascule button[aria-pressed="true"] { background: var(--metre); color: var(--encre); }
.total { font: 800 clamp(3.5rem, 15vw, 6.5rem)/.95 var(--titre); letter-spacing: -0.03em; margin: 0 0 18px; }
.regle { position: relative; height: 62px; background-color: var(--metre); color: var(--encre); border-radius: 3px; overflow: visible;
  background-image:
    repeating-linear-gradient(90deg, var(--encre) 0 2px, transparent 2px var(--maj)),
    repeating-linear-gradient(90deg, var(--encre) 0 1px, transparent 1px calc(var(--maj) / 10));
  background-size: 100% 22px, 100% 11px; background-repeat: no-repeat; }
.regle .gradu { position: absolute; bottom: 7px; font: 700 .875rem var(--titre); transform: translateX(5px); white-space: nowrap; transition: opacity .25s; }
.regle .gradu.masque { opacity: 0; }
.regle .joint { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(30, 36, 48, .28); }
.regle .joint::after { content: ""; position: absolute; left: -3px; top: 50%; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: #B98A12; }
.repere { position: absolute; top: -13px; bottom: -9px; width: 3px; margin-left: -1.5px; background: #fff; transition: left .55s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 0 1px var(--bleu-fonce); }
.repere::before { content: ""; position: absolute; left: -7px; top: -3px; border: 8.5px solid transparent; border-top: 11px solid #fff; border-bottom: 0; }
.repere-mat { top: 22px; background: var(--bleu); box-shadow: none; }
.repere-mat::before { display: none; }
.fourchette { position: relative; height: 5px; margin-top: 15px; }
.fourchette i { position: absolute; top: 0; bottom: 0; background: var(--bleu-clair); border-radius: 3px; transition: left .55s, width .55s; }
.detail-total { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.detail-total li { display: flex; justify-content: space-between; gap: 16px; }
.detail-total b { font-family: var(--titre); white-space: nowrap; }
.cle { display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -1px; border-radius: 2px; background: linear-gradient(90deg, var(--metre) 5px, var(--bleu) 5px 8px, var(--metre) 8px); }
.fourchette-texte { margin: 10px 0 0; color: var(--bleu-clair); font-size: .96875rem; }

/* Détail */
.res-corps { padding-top: 26px; padding-bottom: 40px; }
.res-corps h2 { font-size: 1.625rem; margin: 26px 0 10px; }
.res-corps h2:first-child { margin-top: 0; }
.feuille { background: var(--feuille); border-radius: 14px; overflow: hidden; }
.ligne { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--filet); }
.feuille > :first-child, .feuille > :first-child > summary { border-top: 0; }
.ligne b { white-space: nowrap; font-family: var(--titre); }
.ligne > span:last-child:not(.ligne-actions) { white-space: nowrap; }
.lot > summary { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; font-weight: 700; cursor: pointer; border-top: 1px solid var(--filet); list-style-position: inside; }
.lot > summary b { white-space: nowrap; font-family: var(--titre); }
.lot[open] > summary { background: #F3F5F8; }
.article { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; padding: 8px 16px; font-size: .96875rem; border-top: 1px solid #ECEFF3; }
.article .qte { color: var(--gris); white-space: nowrap; }
.article .prix { min-width: 62px; text-align: right; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.limites { color: var(--gris); font-size: .9375rem; margin: 20px 0 0; }

/* Bons plans */
.entete-page { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.entete-page h1 { font-size: clamp(2.25rem, 8vw, 3.25rem); }
.intro { color: var(--gris); max-width: 60ch; margin: 12px 0 20px; }
.filtre { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filtre label { font-weight: 700; }
.filtre input { width: 76px; }
.lien { background: none; border: 0; padding: 0; color: var(--bleu); text-decoration: underline; cursor: pointer; font-size: .9375rem; }
.plan { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; padding: 18px 16px; background: var(--feuille); border-top: 1px solid var(--filet); }
.plan:first-child { border-top: 0; border-radius: 14px 14px 0 0; }
.plan:last-child { border-radius: 0 0 14px 14px; }
.plan:only-child { border-radius: 14px; }
.etiquette { grid-row: span 2; align-self: start; background: var(--metre); padding: 14px 13px 11px 24px; font: 800 1.375rem/1 var(--titre); white-space: nowrap; clip-path: polygon(13px 0, 100% 0, 100% 100%, 13px 100%, 0 50%); transform: rotate(-2.5deg); position: relative; min-width: 96px; text-align: right; }
.etiquette::before { content: ""; position: absolute; left: 11px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--feuille); }
.plan h3 { font: 700 1.125rem/1.25 var(--texte); letter-spacing: 0; overflow-wrap: anywhere; }
.plan-info { color: var(--gris); font-size: .9375rem; margin: 2px 0 0; }
.plan-comment { margin: 6px 0 0; font-size: .96875rem; }
.plan-photo { max-width: 160px; border-radius: 8px; margin-top: 8px; display: block; }
.plan-bas { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.vote { border: 1.5px solid #AEB7C4; background: #fff; border-radius: 9px; padding: 7px 12px; cursor: pointer; font-weight: 700; font-size: .9375rem; }
.vote:hover:not(:disabled) { border-color: var(--bleu); }
.vote.choisi-oui { background: var(--ok); border-color: var(--ok); color: #fff; opacity: 1; }
.vote.choisi-non { background: var(--ko); border-color: var(--ko); color: #fff; opacity: 1; }
.vote:disabled { cursor: default; }
.statut { font-size: .875rem; font-weight: 700; color: var(--gris); }
.statut-ok { color: var(--ok); }
.plan-bas .lien { margin-left: auto; color: var(--gris); font-size: .875rem; }
.vide { background: var(--feuille); border-radius: 14px; padding: 26px 20px; }
.vide h3 { font-size: 1.375rem; margin-bottom: 6px; }
.vide p { margin: 0 0 14px; color: var(--gris); }
.alertes-telegram { color: var(--gris); margin-top: 18px; font-size: .96875rem; }
.chargement { color: var(--gris); padding: 18px 0; }

/* Fiche de partage */
dialog { border: 0; border-radius: 16px; padding: 22px; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); color: var(--encre); }
dialog::backdrop { background: rgba(15, 38, 89, .6); }
.fiche-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fiche-tete h2 { font-size: 1.625rem; }
.fermer { background: none; border: 0; cursor: pointer; padding: 4px; color: var(--encre); }
dialog label { display: block; font-weight: 700; margin: 12px 0 5px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aide { color: var(--gris); font-size: .875rem; margin: 5px 0 0; }
.alerte-claire { margin-top: 14px; }

/* Moi */
.moi-tete h1 { font-size: clamp(2.25rem, 8vw, 3.25rem); }
.moi-niveau { color: var(--gris); margin: 6px 0 20px; }
.regle-xp { --maj: 20%; margin-bottom: 8px; }
.progres-texte { display: flex; justify-content: space-between; gap: 12px; font-size: .9375rem; color: var(--gris); margin: 16px 0 22px; }
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--filet); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.chiffres div { background: var(--feuille); padding: 14px 10px; text-align: center; }
.chiffres b { display: block; font: 800 1.625rem/1.1 var(--titre); }
.chiffres span { font-size: .875rem; color: var(--gris); }
.page h2.section { font-size: 1.5rem; margin: 30px 0 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.badges li { background: var(--feuille); border-radius: 99px; padding: 7px 14px; font-weight: 700; font-size: .9375rem; }
.ligne button.lien { white-space: nowrap; }
.ligne-chiffrage { align-items: center; flex-wrap: wrap; }
.ligne-chiffrage > span:first-child { flex: 1 1 220px; white-space: normal; }
.ligne-chiffrage small { display: block; color: var(--gris); font-size: .875rem; }
.ligne-actions { display: flex; gap: 14px; }
.connexion { background: var(--bleu); color: #fff; border-radius: 14px; padding: 22px 20px; margin-top: 20px; }
.connexion h2 { font-size: 1.5rem; margin-bottom: 6px; }
.connexion p { margin: 0 0 16px; color: var(--bleu-clair); }
.connexion .actions { margin-top: 0; }
.connexion a { text-decoration: none; }
.connexion .sur-bleu { color: #fff; border: 2px solid #6F88C4; border-radius: 10px; padding: 11px 16px; font-weight: 700; }

/* Pied de page, offre, compte, pages légales */
.pied { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; padding: 20px; font-size: .875rem; }
.pied a { color: var(--gris); }
.teaser { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 12px; padding: 16px; border-radius: 14px; background: var(--metre); }
.teaser p { margin: 0; font-weight: 700; flex: 1 1 240px; }
.teaser a { text-decoration: none; }
.simple { background: var(--enduit); padding-bottom: 0; }
.simple .barre { justify-content: flex-start; }
.etroit { max-width: 480px; margin: 0 auto; padding: 32px 20px 48px; }
.etroit h1 { font-size: clamp(2.25rem, 8vw, 3rem); margin-bottom: 18px; }
.onglets-compte { display: grid; grid-template-columns: 1fr 1fr; background: #D5DBE3; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.onglets-compte button { border: 0; background: transparent; border-radius: 9px; padding: 10px; font-weight: 700; cursor: pointer; }
.onglets-compte button[aria-pressed="true"] { background: var(--feuille); }
.formulaire { background: var(--feuille); border-radius: 14px; padding: 20px; }
.formulaire label { display: block; font-weight: 700; margin: 14px 0 5px; }
.formulaire label:first-child { margin-top: 0; }
.formulaire .accord { display: grid; grid-template-columns: auto 1fr; gap: 10px; font-weight: 400; font-size: .96875rem; margin-top: 16px; }
.formulaire .accord input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--bleu); }
.message-ok { background: #E6F4EE; color: var(--ok); border-radius: 10px; padding: 12px 14px; margin: 14px 0 0; font-weight: 700; }
.note { color: var(--gris); font-size: .9375rem; margin-top: 14px; }
.prix-pro { font: 800 clamp(3.5rem, 15vw, 5.5rem)/1 var(--titre); letter-spacing: -0.03em; margin: 0; }
.prix-pro small { font: 700 1.125rem var(--texte); letter-spacing: 0; }
.avantages { list-style: none; padding: 0; margin: 16px 0 0; }
.avantages li { padding: 11px 0; border-top: 1px solid var(--filet); font-weight: 700; }
.avantages li:first-child { border-top: 0; }
.legal { max-width: 720px; margin: 0 auto; padding: 32px 20px 56px; }
.legal h1 { font-size: clamp(2.25rem, 8vw, 3rem); margin-bottom: 12px; }
.legal h2 { font-size: 1.375rem; margin: 28px 0 8px; }
.legal p, .legal li { max-width: 68ch; }
.legal .maj { color: var(--gris); font-size: .9375rem; }

#toast { position: fixed; z-index: 40; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--encre); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 700; width: max-content; max-width: calc(100vw - 32px); text-align: center; }

#bloc-saisie { min-height: calc(100dvh - 58px - 72px); }

@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .barre { padding: 14px 32px; }
  .nav-haut { display: flex; }
  .onglets { display: none; }
  .bandeau { padding: 52px 0 56px; }
  #bloc-saisie { min-height: calc(100dvh - 62px); }
  .choix-mode { grid-template-columns: 1fr 1fr; }
  #toast { bottom: 28px; }
}
@media (max-width: 400px) {
  .bascule button { padding: 9px 8px; font-size: .9375rem; }
  .article { grid-template-columns: 1fr auto; }
  .article .qte { grid-column: 1; grid-row: 2; }
  .article .prix { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Résiliation en trois étapes */
.etape-res { color: var(--gris); margin: 6px 0 16px; }
.texte-res { margin: 14px 0 0; }
.valeur-res { text-align: right; overflow-wrap: anywhere; }
.champ-res { margin: 20px 0 0; }
