/* ============================================================
   FILARIANE — Système de design « L'atelier numérique »
   Vitrine (papier clair) + espace client + Studio (outils internes)
   ============================================================

   FEUILLES (chargées dans cet ordre ; l'ordre compte : à spécificité égale, la dernière l'emporte)
     1. base.css          toutes les pages : polices, jetons, base, accessibilité, composants partagés
     2. une feuille de zone, selon l'hôte :
          vitrine.css        site public (views/partials/head.html)
          studio.css         Studio (application views/studio-app.html) + page de connexion du Studio
     3. final.css         toutes les pages, EN DERNIER : utilitaires d'espacement, impression A4
   Une règle utile à deux zones va dans base.css, jamais en double. Les pages de connexion (client et
   Studio) partagent leur gabarit : il est ici, en fin de fichier.

   SOMMAIRE de base.css (chercher « ZONE » ou « ---------- » pour naviguer)
     0. Polices auto-hébergées (@font-face, woff2 dans /assets/fonts/)
     1. ZONE COMMUNE : jetons, base, accessibilité (focus, mouvement réduit)
     2. COMPOSANTS PARTAGÉS : boutons, surtitre, annotation, cartes, grilles, champs, barre d'actions,
        bandeau d'erreur, boutons secondaires, pastilles, jauges, tableaux, bannière PWA, connexion
   Contrastes vérifiés par script : texte ≥ 4,5:1 ; grand texte, composants, focus ≥ 3:1. */

/* Polices auto-hébergées (sous-ensembles latin + latin-ext), téléchargées depuis Google Fonts.
   Licence : SIL Open Font License 1.1 (Bricolage Grotesque, Outfit, Caveat). */
/* latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url(/assets/fonts/bricolage-grotesque-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Caveat : fichiers VARIABLES (axe wght 400 à 700) → UNE seule déclaration par sous-ensemble, plage
   500 700. Deux @font-face (500 et 700) sur le même fichier créaient deux polices distinctes : fichier
   demandé deux fois selon le navigateur, décodé et gardé deux fois en mémoire. */
/* latin-ext */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/assets/fonts/caveat-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(/assets/fonts/caveat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/assets/fonts/outfit-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/assets/fonts/outfit-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   1. ZONE COMMUNE — jetons, base, accessibilité
   ============================================================ */
:root {
  /* Palette « mercerie » */
  --papier: #F7F1E6;
  --craie: #FFFDF8;
  --encre: #22252e;
  --encre-2: #3a3e4a;
  --garance: #d8442b;        /* le fil rouge : décor, filets, focus — pas pour du petit texte */
  --garance-fonce: #b33420;  /* textes rouges et fonds sous texte blanc (≥ 5,4:1) */
  --ocre: #e09c33;
  --ocre-texte: #8a5d0e;     /* ocre des textes : badges, étoiles (≥ 4,6:1) */
  --loire: #2e6b5e;
  --bleu-nuit: #28344d;
  --gris-fil: #b9b0a0;
  --ombre: 0 14px 40px -18px rgba(34, 37, 46, .35);

  --f-titre: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-texte: "Outfit", system-ui, sans-serif;
  --f-main: "Caveat", cursive;

  --radius: 14px;
  --maxw: 1180px;
  --stitch: 1px solid rgba(34,37,46,.16);

  /* Thème clair du Studio (outils internes) */
  --at-panneau: #fffdf8;
  --at-surface: #f7f1e4;
  --at-creux: #f3ecdd;
  --at-creux2: #ece4d2;
  --at-texte: #22252e;
  --at-texte2: #4a4537;
  --at-sourdine: #6e6655;
  --at-sourdine2: #6e6655;
  --at-bordure: rgba(34,37,46,.3);          /* bordures décoratives */
  --at-bordure-champ: rgba(34,37,46,.6);    /* contour des champs de saisie (≥ 3:1) */
  --at-bordure-faible: rgba(34,37,46,.14);
  --at-ok: #1f7a4d;
  --at-alerte: #b33420;
  --at-attention: #8a5d0e;
  --at-accent: #8a5d0e;

  /* Hauteur de l'en-tête de la vitrine (repli ; mesurée par site.js). Sert aussi aux scroll-padding. */
  --entete-h: 78px;
}

* { box-sizing: border-box; }
/* L'attribut hidden masque TOUJOURS : sans cette règle, tout `display` d'auteur (.btn, .btn-icone,
   .champ .aide, .bandeau-erreur…) l'emporte sur la feuille du navigateur et « hidden » ne masque plus
   rien. Seule exception voulue : .entete__tel (zone vitrine, écrans ≤ 980 px). hidden="until-found" épargné. */
[hidden]:not([hidden="until-found"]) { display: none !important; }
html { scroll-behavior: smooth; }
/* Mouvement réduit. `iteration-count: 1` : sans lui, une animation infinie ramenée à .01ms « tremble ». */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  .ruban__piste { animation: none !important; }
}

html, body { overflow-x: clip; }

/* Ni le focus clavier ni les ancres ne passent sous l'en-tête collant (+ sous-menu) ; --entete-h mesurée par site.js. */
html { scroll-padding-top: calc(var(--entete-h, 78px) + var(--sous-menu-h, 0px) + 1rem); }
html:has(.sous-menu) { --sous-menu-h: 3.6rem; }
html:has(body.atelier) { scroll-padding-top: 6rem; }   /* Studio : en-tête de page collant */
html:has(body.ec-app) { scroll-padding-top: 1rem; }
@media (max-width: 980px) {
  html:has(body.atelier) { scroll-padding-top: calc(52px + 6rem); }   /* + barres supérieures fixes */
  html:has(body.ec-app) { scroll-padding-top: calc(54px + 1rem); }
}

body {
  margin: 0;
  font-family: var(--f-texte);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--encre);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
}

/* Grain papier très léger */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* Aurore colorée : nappe de dégradés fixes qui relie visuellement toutes les sections */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52vw 36vh at 94% -4%, rgba(224,156,51,.32), transparent 64%),   /* doré */
    radial-gradient(44vw 36vh at -6% 22%, rgba(46,107,94,.22), transparent 64%),    /* vert Loire */
    radial-gradient(40vw 32vh at 30% -6%, rgba(123,97,200,.28), transparent 62%),   /* lavande */
    radial-gradient(42vw 34vh at 106% 44%, rgba(86,140,220,.28), transparent 62%),  /* bleu ciel */
    radial-gradient(40vw 32vh at 60% 74%, rgba(224,95,158,.24), transparent 62%),   /* rose pivoine */
    radial-gradient(44vw 34vh at 22% 64%, rgba(216,68,43,.18), transparent 62%),    /* garance */
    radial-gradient(48vw 38vh at 0% 106%, rgba(224,156,51,.24), transparent 64%),   /* doré bas */
    radial-gradient(36vw 30vh at 88% 102%, rgba(96,180,160,.26), transparent 62%);  /* menthe bas */
}
body.atelier::after { display: none; }

::selection { background: var(--garance-fonce); color: var(--craie); }

/* Focus visible partout : anneau garance (≥ 3:1 sur les fonds clairs), blanc sur les zones sombres,
   tracé vers l'intérieur dans les conteneurs en overflow:hidden. */
:focus-visible { outline: 3px solid var(--garance); outline-offset: 2px; border-radius: 4px; }
.skip-link:focus-visible { outline-color: var(--encre); }
.offre-360 :focus-visible, .ec-apercu :focus-visible, .toast :focus-visible { outline-color: #fff; }
.faq summary:focus-visible { outline-offset: -3px; border-radius: 12px; }

img { max-width: 100%; display: block; }
a { color: var(--garance-fonce); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--garance-fonce); text-decoration-thickness: 2.5px; }   /* survol : soulignement épaissi (le rouge clair était sous 4,5:1) */

h1, h2, h3, h4 { font-family: var(--f-titre); line-height: 1.08; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
h1 em, h2 em {
  font-style: normal; color: inherit;
  background: linear-gradient(180deg, transparent 60%, rgba(216,68,43,.32) 60%, rgba(216,68,43,.32) 92%, transparent 92%);
  padding: 0 .06em;
}

.conteneur { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.5rem); }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; position: relative; }
.section--craie { background: rgba(255,253,248,.30); border-top: var(--stitch); border-bottom: var(--stitch); }
/* Section « signature » : ivoire encadré de noir, écho au logo N&B */
.section--encre {
  background:
    repeating-linear-gradient(-45deg, rgba(34,37,46,.022) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, rgba(253,244,228,.92), rgba(248,228,206,.78));
  color: var(--encre); border-top: 3px solid var(--encre); border-bottom: 3px solid var(--encre);
}
.section--encre h2, .section--encre h3 { color: var(--encre); }
.section--encre a { color: var(--garance-fonce); }

/* Accès rapide clavier */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1001;
  background: var(--garance-fonce); color: #fff; padding: .7rem 1.2rem; border-radius: 0 0 10px 0;
  font-weight: 600; min-height: 44px;
}
.skip-link:focus, .skip-link:focus-visible { left: 0; }
/* Texte réservé aux lecteurs d'écran (titres de vue, précisions de liens) */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ============================================================
   2. COMPOSANTS PARTAGÉS (vitrine, espace client, Studio)
   ============================================================ */

/* Boutons (communs) : cible tactile d'au moins 44 px de haut pour toutes les commandes principales. */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px;
  background: linear-gradient(135deg, #C73A20, #b33420); color: #fff !important; text-decoration: none; /* garance foncé : contraste AA du texte blanc (≥ 4.5:1) */
  font-weight: 600; font-size: 1rem; font-family: var(--f-texte);
  padding: .75rem 1.5rem; border-radius: 999px; border: 2px solid var(--garance);
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s;
  box-shadow: 0 4px 0 var(--garance-fonce);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--garance-fonce); background: var(--garance-fonce); border-color: var(--garance-fonce); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--garance-fonce); }
body:not(.atelier) .btn:not(.btn--sm)::after { content: "→"; display: inline-block; transition: transform .2s ease; }
body:not(.atelier) .btn:not(.btn--sm):hover::after { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--encre) !important; border: 2px solid var(--encre); box-shadow: 0 4px 0 var(--encre); }
.btn--ghost:hover { background: var(--encre); color: var(--papier) !important; box-shadow: 0 6px 0 var(--encre-2); border-color: var(--encre); }
.btn--clair { background: var(--encre); color: var(--papier) !important; border-color: var(--encre); box-shadow: 0 4px 0 #000; }
.btn--clair:hover { background: #000; border-color: #000; }
.btn--sm { padding: .45rem 1rem; font-size: .9rem; box-shadow: 0 3px 0 var(--garance-fonce); }

/* ---------- Surtitre et annotation manuscrite ---------- */
.surtitre {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--encre); background: linear-gradient(120deg, rgba(252,228,218,.9), rgba(252,238,211,.9)); border: 1.5px solid var(--encre);
  border-radius: 999px; padding: .32rem .95rem; margin-bottom: 1.2rem;
}
/* Petits écrans : un surtitre trop long passe à la ligne d'un bloc (texte dans un seul élément), et serre l'espacement. */
.surtitre { max-width: 100%; }
@media (max-width: 400px) { .surtitre { font-size: .72rem; letter-spacing: .08em; } }
.surtitre::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--garance); flex: none; }

.annotation { font-family: var(--f-main); font-size: 1.35rem; color: var(--garance-fonce); transform: rotate(-2deg); display: inline-block; }

/* ---------- Étiquettes (cartes à œillet) ---------- */
.etiquette {
  position: relative; background: linear-gradient(180deg, #FFFDF8, #FBF4E7);
  border: 1.5px solid var(--encre);
  border-radius: var(--radius); padding: 1.6rem 1.5rem 1.5rem;
  box-shadow: 4px 4px 0 rgba(34,37,46,.9);
  transition: transform .2s ease, box-shadow .2s ease;
}
.etiquette:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--garance); }
a.etiquette { display: flex; flex-direction: column; }
a.etiquette p { flex: 1; }
a.etiquette .lien-fil { margin-top: auto; padding-top: .6rem; }
.etiquette { overflow: hidden; }
.etiquette::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 1;
  background: linear-gradient(90deg, var(--garance), var(--ocre));
}
.grille-3 > .etiquette:nth-child(3n+2)::before, .grille-4 > .etiquette:nth-child(4n+2)::before { background: linear-gradient(90deg, var(--ocre), #6fae9a); }
.grille-3 > .etiquette:nth-child(3n)::before, .grille-4 > .etiquette:nth-child(4n+3)::before { background: linear-gradient(90deg, #2e6b5e, #6e93d6); }
.grille-4 > .etiquette:nth-child(4n)::before { background: linear-gradient(90deg, #6e93d6, #9a82d8); }
.etiquette h3 { margin-top: .2rem; }
/* Carte dont le titre est un h2 (hiérarchie des titres) : même gabarit visuel qu'un h3. */
.etiquette h2 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); margin-top: .2rem; }
.pico {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: 13px; background: var(--papier); border: 1.5px solid var(--encre);
  color: var(--garance-fonce); margin-bottom: .9rem;
  box-shadow: 2.5px 2.5px 0 rgba(34,37,46,.85);
}
.pico svg { width: 23px; height: 23px; }
/* Rotation de teintes pastel : chaque carte porte sa couleur */
.grille-3 > :nth-child(3n+1) .pico, .grille-4 > :nth-child(4n+1) .pico { background: linear-gradient(135deg, #FCE4DA, #F6CDBC); color: var(--garance-fonce); }
.grille-3 > :nth-child(3n+2) .pico, .grille-4 > :nth-child(4n+2) .pico { background: linear-gradient(135deg, #FCEED3, #F4DCAB); color: #8a5d0e; }
.grille-3 > :nth-child(3n) .pico, .grille-4 > :nth-child(4n+3) .pico { background: linear-gradient(135deg, #DFEEE6, #C5DFCE); color: var(--loire); }
.grille-4 > :nth-child(4n) .pico { background: linear-gradient(135deg, #E2E8F4, #C9D4EA); color: var(--bleu-nuit); }
.centre .pico, .etiquette.centre .pico { margin-inline: auto; }
.etiquette p { color: var(--encre-2); font-size: .98rem; margin: 0; }
.etiquette .lien-fil { display: inline-block; margin-top: .9rem; font-weight: 600; font-size: .95rem; }

/* ---------- Grilles ---------- */
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2.5vw, 1.8rem); }
.grille-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1rem, 2.5vw, 1.8rem); }
.grille-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(.9rem, 2vw, 1.4rem); }
/* Studio : les panneaux côte à côte gardent leur hauteur naturelle (pas d'étirement d'un panneau
   court pour matcher un panneau long → supprime les grands vides internes « pas ordonnés »). */
.atelier .grille-2, .atelier .grille-3, .atelier .grille-4 { align-items: start; }
/* Grilles : toutes les cartes gardent la même largeur (pas de recentrage d'orphelin). */
@media (max-width: 960px) {
  .grille-3, .grille-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grille-3, .grille-2, .grille-4 { grid-template-columns: 1fr; }
}

/* ---------- Formulaires ---------- */
.champ { margin-bottom: 1.1rem; }
.champ label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.champ input, .champ select, .champ textarea {
  width: 100%; font-family: var(--f-texte); font-size: 1rem; color: var(--encre);
  background: var(--craie); border: 1.5px solid var(--encre); border-radius: 10px;
  padding: .7rem .9rem; transition: box-shadow .15s, border-color .15s;
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  border-color: var(--garance); box-shadow: 3px 3px 0 rgba(216,68,43,.35);
}
/* Focus des champs : même anneau que le reste du site ; placeholders lisibles (opacity:1 pour Firefox). */
.champ :is(input, select, textarea):focus-visible, .ligne-tarif input:focus-visible { outline: 3px solid var(--garance); outline-offset: 2px; }
.champ ::placeholder { color: var(--at-sourdine); opacity: 1; }
.champ [aria-invalid="true"] { border-color: var(--garance-fonce); }
.champ .aide { font-size: .83rem; color: var(--encre-2); margin-top: .25rem; }
.champ .aide { display: block; }
/* Erreur d'un champ (formulaire de contact : <p class="aide aide--avert champ__erreur"> posé par site.js après le champ). */
.champ .champ__erreur { margin: .3rem 0 0; }
.aide--ok { color: #2c7a4b; font-weight: 600; }
.aide--avert { color: #b4451f; font-weight: 600; }

/* ---------- Barre d'actions d'un document (devis / facture) ----------
   Hiérarchie visuelle : 1 action primaire, un groupe « Partager » secondaire,
   l'action « suivante » mise en avant, et le danger isolé à droite. */
.barre-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1.4rem; }
.barre-actions__sep { width: 1px; align-self: stretch; min-height: 1.8rem; background: currentColor; opacity: .18; margin: 0 .25rem; }
.barre-actions__lbl { font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--at-sourdine); margin-right: .1rem; }   /* sourdine plutôt qu'opacité .6 (4,16:1) */
.btn-icone--accent { border-color: var(--at-accent, var(--garance)); color: var(--at-accent, var(--garance)); font-weight: 600; }

/* Bandeau d'erreur bloquante persistant (ex. échec d'enregistrement serveur) */
.bandeau-erreur { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; justify-content: space-between;
  margin-top: 1.2rem; padding: .8rem 1rem; border-radius: 12px;
  background: #fdecea; border: 1.5px solid #d8442b; color: #8f2c1c; font-size: .92rem; font-weight: 600; }
.bandeau-erreur[hidden] { display: none; }
.bandeau-erreur .btn-icone { border-color: #d8442b; color: #8f2c1c; background: #fff; font-weight: 700; flex: none; }
/* Liens du bandeau (téléphone, repli e-mail du formulaire de contact) : couleur du texte (7,2:1), soulignés. */
.bandeau-erreur a:not(.btn-icone) { color: #8f2c1c; font-weight: 700; text-decoration: underline; }
.bandeau-erreur a:not(.btn-icone):hover { color: #6e1f12; }

/* ---------- Boutons secondaires (Studio, espace client) ---------- */
/* Bouton secondaire unifié : même langage « pilule » que .btn, aligné, hauteur constante, jamais coupé. */
.btn-icone { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; white-space: nowrap;
  background: var(--at-panneau); border: 1.5px solid var(--at-bordure); color: var(--at-texte2);
  border-radius: 999px; padding: .42rem .9rem; min-height: 2.1rem; line-height: 1; vertical-align: middle;
  font-family: var(--f-texte); font-weight: 600; font-size: .85rem; text-decoration: none; cursor: pointer; transition: .15s; }
.btn-icone:hover { border-color: var(--encre); color: var(--encre); }
/* Variante danger : teinte rouge dès le repos (sinon indistincte d'un bouton neutre). */
.btn-icone--danger { border-color: color-mix(in srgb, var(--at-alerte) 55%, var(--at-bordure)); color: var(--at-alerte); }
.btn-icone--danger:hover { border-color: var(--garance); color: var(--at-alerte); }
.btn-icone--ok { border-color: color-mix(in srgb, var(--at-ok) 55%, var(--at-bordure)); color: var(--at-ok); font-weight: 600; }
.btn-icone--ok:hover { border-color: var(--at-ok); color: #1b6e44; background: color-mix(in srgb, var(--at-ok) 10%, transparent); } /* texte assombri : AA conservé sur fond teinté */

/* ---------- Pastilles de statut ---------- */
.pastille { display: inline-block; padding: .18rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
.pastille--vert { background: rgba(76,160,110,.16); color: #1b6e44; }
.pastille--ocre { background: rgba(224,156,51,.2); color: var(--at-attention); }
.pastille--rouge { background: rgba(216,68,43,.13); color: var(--at-alerte); }
.pastille--bleu { background: rgba(80,110,180,.13); color: #3a5ea8; }
.pastille--gris { background: rgba(34,37,46,.08); color: var(--at-texte2); }

/* Jauges */
.jauge { height: 10px; background: rgba(34,37,46,.12); border-radius: 999px; overflow: hidden; }
.jauge > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--garance), var(--ocre)); transition: width .6s ease; }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; background: var(--craie); border: 1.5px solid var(--encre); border-radius: 12px; overflow: hidden; }
.tableau th, .tableau td { padding: .75rem 1rem; text-align: left; border-bottom: 1px dashed rgba(34,37,46,.2); font-size: .96rem; }
.tableau th { background: var(--encre); color: var(--papier); font-family: var(--f-texte); font-weight: 600; }
.tableau tr:last-child td { border-bottom: none; }

/* ---------- Bannière d'installation PWA (Studio + espace client) ---------- */
.pwa-banniere {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%) translateY(180%);
  z-index: 400; width: min(440px, calc(100% - 1.4rem));
  display: grid; grid-template-columns: auto 1fr auto; gap: .15rem .9rem; align-items: center;
  background: var(--papier); color: var(--encre);
  border: 1.5px solid var(--encre); border-radius: 16px; padding: .95rem 1.1rem;
  box-shadow: 0 14px 44px rgba(34,37,46,.32);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
}
.pwa-banniere.visible { transform: translateX(-50%) translateY(0); }
.pwa-banniere__icone { width: 44px; height: 44px; border-radius: 11px; }
.pwa-banniere__txt strong { display: block; font-size: 1rem; line-height: 1.2; }
.pwa-banniere__txt span { font-size: .85rem; color: var(--encre-2); }
.pwa-banniere .pwa-fermer { background: none; border: none; color: var(--encre-2); font-size: 1.5rem; line-height: 1; cursor: pointer; align-self: start; padding: 0; min-width: 44px; min-height: 44px; margin: -.6rem -.7rem 0 0; }
.pwa-banniere .pwa-fermer:hover { color: var(--garance-fonce); }
.pwa-banniere__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .5rem; }
.pwa-banniere .pwa-installer { margin-right: auto; }
.pwa-banniere .pwa-plus-tard, .pwa-banniere .pwa-jamais {
  background: none; border: none; cursor: pointer; font-family: var(--f-texte);
  font-size: .85rem; color: var(--encre-2); padding: .35rem .5rem; border-radius: 8px; min-height: 44px;
}
.pwa-banniere .pwa-plus-tard:hover, .pwa-banniere .pwa-jamais:hover { color: var(--encre); text-decoration: underline; }
.pwa-banniere .pwa-jamais { color: var(--encre-2); }

/* ---------- Pages de connexion (ec-login, studio-login) : erreur au-dessus des champs, masquée si vide ---------- */
body.page-connexion { min-height: 100vh; display: flex; flex-direction: column; }
body.atelier.page-connexion { padding: 0; }   /* ni barre latérale ni barres mobiles */
.page-connexion main { flex: 1; }
/* Bouton « Retour au site », en haut à gauche, toujours visible. */
.connexion__haut { padding: 1rem clamp(1rem, 3vw, 2rem) 0; }
.connexion__retour-site { min-height: 44px; }
.connexion__boite { max-width: 440px; width: 100%; }
body.atelier.page-connexion .connexion__boite { max-width: 420px; padding-block: 1.5rem 2rem; margin-inline: auto; display: flex; flex-direction: column; justify-content: center; }
.connexion__form { padding: 2.2rem; text-align: center; }
.connexion__form .champ { text-align: left; }
.connexion__form .btn { width: 100%; justify-content: center; }
.connexion__logo { display: inline-block; margin-bottom: .4rem; }
.connexion__logo img { height: 42px; width: auto; }
img.connexion__logo { height: 40px; width: auto; margin-inline: auto; }
.connexion__aide { font-size: .85rem; color: var(--encre-2); text-align: left; line-height: 1.5; margin: 1.1rem 0 0; }
/* Spécificité renforcée : une règle de marge nulle sur les paragraphes collait l'aide au bouton. */
.connexion__form .connexion__aide { margin-top: 1.4rem; }
.connexion__form h1 { font-size: 1.7rem; margin: .2rem 0; }
.atelier .connexion__form h1 { font-size: 1.5rem; }
.connexion__intro { color: var(--encre-2); font-size: .96rem; margin-top: 0; }
.atelier .connexion__intro { color: var(--at-sourdine); font-size: .94rem; }
.login-err, .login-info {
  text-align: left; font-weight: 600; font-size: .95rem; line-height: 1.45;
  border-radius: 10px; padding: .65rem .85rem; margin: 0 0 1rem;
}
.login-err { color: var(--garance-fonce); background: #fdecea; border: 1.5px solid var(--garance-fonce); }
.login-info { color: var(--encre); background: #e7f2ea; border: 1.5px solid var(--loire); }
.login-err:empty, .login-info:empty { display: none; }
/* Mot de passe + bouton « Afficher » (ajouté par connexion.js ; caché sans JavaScript). */
.champ-mdp { position: relative; }
.champ-mdp input { padding-right: 6.2rem; }
.champ-mdp__voir {
  position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); min-height: 36px; padding: 0 .75rem;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font: 600 .85rem var(--f-texte); color: var(--encre-2); text-decoration: underline; text-underline-offset: 3px;
}
.champ-mdp__voir:hover { background: rgba(34,37,46,.07); color: var(--encre); }
.champ-mdp__voir[hidden] { display: none; }
/* Espace client : carte en deux colonnes (ce que l'on y trouve | formulaire), une seule sur mobile. */
.connexion__carte { width: 100%; max-width: 880px; padding: 0; display: grid; grid-template-columns: 1fr 1.1fr; }
.connexion__carte:hover { transform: none; box-shadow: 4px 4px 0 rgba(34,37,46,.9); }
.connexion__marque { padding: 2.4rem 2.2rem; background: linear-gradient(160deg, #fbeee3, #f3e6cf); border-right: 1.5px dashed rgba(34,37,46,.25); }
.connexion__marque h2 { font-size: 1.55rem; margin: 1.4rem 0 1rem; }
.connexion__atouts { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.connexion__atouts li { position: relative; padding-left: 1.9rem; font-weight: 600; color: var(--encre-2); line-height: 1.4; }
.connexion__atouts li::before {
  content: "✓"; position: absolute; left: 0; top: .05rem; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  display: grid; place-items: center; font-size: .78rem; color: #fff; background: var(--loire);
}
.connexion__carte .connexion__form { text-align: left; padding: 2.4rem 2.2rem; }
.connexion__carte .connexion__intro { margin-bottom: 1.3rem; }
@media (max-width: 760px) {
  .connexion__carte { grid-template-columns: 1fr; max-width: 460px; }
  .connexion__marque { padding: 1.6rem 1.5rem 1.3rem; border-right: 0; border-bottom: 1.5px dashed rgba(34,37,46,.25); }
  .connexion__marque h2 { font-size: 1.25rem; margin: .9rem 0 .7rem; }
  .connexion__atouts { gap: .45rem; font-size: .92rem; }
  .connexion__carte .connexion__form { padding: 1.6rem 1.5rem 1.8rem; }
}
/* Mentions et version, sous la carte. */
.connexion__rgpd { width: 100%; max-width: 880px; font-size: .84rem; color: var(--encre-2); line-height: 1.5; margin: 1.3rem 0 0; }
.connexion__rgpd summary { cursor: pointer; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.connexion__rgpd p { margin: .2rem 0 0; }
.connexion__version { font-size: .78rem; color: var(--encre-2); opacity: .8; margin: .8rem 0 0; text-align: center; }
