/* Socle commun du site, repris de prototypes/commun/base.css. Les jetons sont dans jetons.css */

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-fonce); text-decoration: underline; }
input, select, button, textarea { font-family: inherit; color: var(--encre); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--encre) !important; box-shadow: 0 0 0 3px var(--accent-pale); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
.gris { color: var(--gris); }
.gris-fonce { color: var(--gris-fonce); }
.ok { color: var(--vert); }
.attente { color: var(--ambre); }
.alerte { color: var(--rouge); }

/* Éléments partagés */
.badge-ia { font: 600 10px var(--sans); letter-spacing: .06em; padding: 2px 5px; border-radius: 3px; background: var(--accent-pale); color: var(--accent-fonce); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--encre); color: var(--fond); border-radius: 8px; padding: 12px 18px; font-size: 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 12px 32px rgba(29, 27, 24, .3); z-index: 40; max-width: calc(100vw - 32px); }
.toast-ok { color: var(--vert-clair); }
.toast-info { color: var(--accent-pale); }
.toast-alerte { color: #F2B8A8; }

/* Badges de statut d'une fiche (charte du 21/10, option 1A : échelle du gris au vert profond,
   un picto par statut, lisible sans la couleur ; l'or est réservé au sceau d'« Attestée ») */
.statut { font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 5px; line-height: 1.3; }
.statut.brouillon, .statut.a-completer, .statut.complete, .statut.validee, .statut.attestee, .statut.adaptee { padding-left: 7px; }
.statut.brouillon::before, .statut.a-completer::before, .statut.complete::before, .statut.adaptee::before { content: ''; width: 13px; height: 13px; flex: none; background: currentColor; -webkit-mask: var(--picto) center / contain no-repeat; mask: var(--picto) center / contain no-repeat; }
.statut.validee::before, .statut.attestee::before { content: ''; width: 13px; height: 13px; flex: none; background: var(--picto) center / contain no-repeat; }
.statut.brouillon { background: var(--tag); color: var(--gris-fonce); --picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19l1.1-4.2L15.6 5.3a1.7 1.7 0 0 1 2.4 0l.7.7a1.7 1.7 0 0 1 0 2.4L9.2 17.9 5 19z' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M14 7l3 3' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }
.statut.a-completer { background: var(--statut-fond); color: var(--ambre); --picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='7.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M12 4.4a7.6 7.6 0 0 0 0 15.2z'/%3E%3C/svg%3E"); }
.statut.complete { background: var(--vert-pale); color: var(--vert); --picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='7.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M8.6 12.3l2.3 2.3 4.6-4.8' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.statut.validee { background: var(--statut-validee); color: #fff; --picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4.4' y='4.4' width='15.2' height='15.2' rx='3' fill='%23fff'/%3E%3Cpath d='M8.4 12.3l2.5 2.5 4.9-5.1' fill='none' stroke='%232D7139' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.statut.attestee { background: var(--statut-attestee); color: #fff; border-color: var(--or); --picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.4L13.58 4.06L15.67 3.13L16.5 5.27L18.79 5.21L18.73 7.5L20.87 8.33L19.94 10.42L21.6 12L19.94 13.58L20.87 15.67L18.73 16.5L18.79 18.79L16.5 18.73L15.67 20.87L13.58 19.94L12 21.6L10.42 19.94L8.33 20.87L7.5 18.73L5.21 18.79L5.27 16.5L3.13 15.67L4.06 13.58L2.4 12L4.06 10.42L3.13 8.33L5.27 7.5L5.21 5.21L7.5 5.27L8.33 3.13L10.42 4.06Z' fill='%23E3B54A'/%3E%3Cpath d='M8.3 12.2l2.6 2.6 4.9-5.2' fill='none' stroke='%231C4A2A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.statut.adaptee { background: #EFE7F8; color: #4A2D73; --picto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8.6' y='8.6' width='11' height='11' rx='2' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M15.4 8.4V6.6a2 2 0 0 0-2-2H6.6a2 2 0 0 0-2 2v6.8a2 2 0 0 0 2 2h1.8' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E"); }

/* Boutons et utilitaires partagés (repris de prototypes/editeur-fiche/styles.css) */
.btn { font-size: 14px; background: #fff; border: 1px solid var(--trait-fort); border-radius: 6px; padding: 9px 12px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; color: var(--encre); }
.btn:hover { border-color: var(--gris); }
/* :where() garde la spécificité d'un simple lien : la couleur d'une variante (.btn-primaire…) l'emporte (texte noir sur fond noir, revue du 19/10) */
a:where(.btn), a:where(.btn):hover { color: var(--encre); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-petit { font-size: 13px; padding: 7px 11px; }
.btn-actif { background: var(--accent-pale); }
.btn-primaire { font-weight: 500; background: var(--accent); color: #fff; border: 0; padding: 10px 18px; }
.btn-primaire:hover { background: var(--accent-fonce); }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Une case cachée dans son étiquette se place sur l'étiquette : sinon, au clic, le focus fait défiler la page jusqu'à son vrai emplacement (page blanche, revue du 19/10). */
label:has(> .visuellement-cache) { position: relative; }
/* L'attribut hidden l'emporte toujours sur l'affichage d'un composant (bouton vide de « Lire une étude thermique », revue du 19/10). */
[hidden] { display: none !important; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.message { font-size: 14px; padding: 10px 14px; border-radius: 6px; background: var(--vert-pale); color: var(--vert); }
.message.error, .message.warning { background: var(--rouge-pale); color: var(--rouge); }
/* Lien de retour au-dessus d'un titre de page (revue du 19/10) */
.lien-retour { display: inline-block; font-size: 13px; color: var(--gris-fonce); margin-bottom: 2px; }
.lien-retour:hover { color: var(--accent); text-decoration: none; }

/* Fenêtre de confirmation commune (revue n°3, R3-32, static/js/confirmation.js) */
.confirmation { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 10px; background: #fff; color: var(--encre); box-shadow: 0 24px 60px rgba(29, 27, 24, .22); }
.confirmation::backdrop { background: rgba(29, 27, 24, .35); }
.confirmation-corps { padding: 24px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.confirmation-titre { font: 400 22px/1.2 var(--serif); }
.confirmation-texte { margin: 0; font-size: 14px; line-height: 1.55; color: var(--gris-fonce); white-space: pre-line; }
.confirmation-boutons { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.btn.btn-danger-plein { background: var(--rouge); border-color: var(--rouge); color: #fff; font-weight: 500; }

/* BL-60 : pastille d'offre masquée quand l'offre est déjà souscrite (data-offre sur <body>) */
body[data-offre="2"] .badge-offre[data-niveau],
body[data-offre="1"] .badge-offre[data-niveau="1"] { display: none; }
