/* =====================================================================
   Mouvement et « cerveau »
   ===================================================================== */
@keyframes entree { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.entree { animation: entree .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }

.cerveau { margin-bottom: 22px; border-radius: 24px; overflow: hidden; position: relative; color: #eaf1f4;
  background: radial-gradient(900px 420px at 50% 45%, rgba(29, 74, 95, .85), transparent 70%), linear-gradient(160deg, #10303d 0%, #0f2833 55%, #0b1c24 100%);
  box-shadow: 0 18px 50px rgba(15, 40, 51, .28); }
.cerveau-ciel svg { display: block; width: 100%; height: auto; }
.cerveau .decor line { stroke: rgba(159, 179, 189, .13); stroke-width: 1; }
.cerveau .decor circle { fill: rgba(207, 221, 227, .55); animation: scintille 4s ease-in-out infinite; }
@keyframes scintille { 0%, 100% { opacity: .25; } 50% { opacity: .95; } }
.cerveau .arete { fill: none; stroke: rgba(251, 188, 5, .38); stroke-width: 1.6; stroke-dasharray: 3 8; stroke-linecap: round; animation: flux 1.8s linear infinite; }
@keyframes flux { to { stroke-dashoffset: -22; } }
.cerveau .pulse { fill: #FBBC05; filter: drop-shadow(0 0 6px rgba(251, 188, 5, .95)); }
.cerveau .coeur { fill: #12394a; stroke: #FBBC05; stroke-width: 2.5; filter: drop-shadow(0 0 18px rgba(251, 188, 5, .45)); }
.cerveau .onde { fill: none; stroke: #FBBC05; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: onde 3.6s ease-out infinite; opacity: 0; }
@keyframes onde { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(2.1); opacity: 0; } }
.cerveau .centre-titre { fill: #fff; font: 800 19px Montserrat, system-ui, sans-serif; letter-spacing: .08em; }
.cerveau .centre-sous { fill: #FBBC05; font: 600 11.5px Montserrat, system-ui, sans-serif; }
.cerveau .noeud { cursor: pointer; outline: none; }
.cerveau .noeud-interieur { animation: flotte 6.5s ease-in-out infinite; }
@keyframes flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.cerveau .corps { fill: #0f2833; stroke-width: 2.5; transition: fill .2s; }
.cerveau .halo { opacity: 0; transition: opacity .25s; }
.cerveau .noeud:hover .halo, .cerveau .noeud:focus-visible .halo { opacity: .22; }
.cerveau .noeud:hover .corps, .cerveau .noeud:focus-visible .corps { fill: #17475b; }
.cerveau .noeud.inactif .corps { stroke-dasharray: 5 5; }
.cerveau .noeud-nombre { fill: #fff; font: 800 22px Montserrat, system-ui, sans-serif; }
.cerveau .noeud-nom { fill: #fff; font: 700 15px Montserrat, system-ui, sans-serif; }
.cerveau .noeud-sous { fill: #9fb3bd; font: 500 12px Montserrat, system-ui, sans-serif; }
.cerveau-liste { display: none; }

.chiffres { margin-bottom: 8px; }
.chiffre .gros { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }

/* ---------- anneaux ---------- */
.cartes-resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 18px; }
.anneau-carte { display: flex; align-items: center; gap: 18px; }
.anneau-carte h3 { font-size: 16px; font-weight: 800; margin: 6px 0 2px; }
.anneau { position: relative; width: 92px; height: 92px; flex: none; }
.anneau svg { width: 100%; height: 100%; }
.anneau .fond { fill: none; stroke: #e6ecee; stroke-width: 8; }
.anneau .arc { fill: none; stroke: var(--ok); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .7, .2, 1); }
.centre-anneau { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.centre-anneau strong { font-size: 17px; font-weight: 800; }
.centre-anneau small { font-size: 11px; color: var(--doux); }
.sous { color: var(--doux); font-size: 13px; }

/* ---------- points d'avancement ---------- */
.points { display: flex; gap: 5px; }
.points i { width: 14px; height: 6px; border-radius: 99px; background: #dbe3e6; display: block; }
.points i.fait { background: var(--ok); }
.points i.actuel { background: var(--jaune); box-shadow: 0 0 0 3px rgba(251, 188, 5, .28); animation: respire 2s ease-in-out infinite; }
@keyframes respire { 50% { box-shadow: 0 0 0 5px rgba(251, 188, 5, .12); } }

/* ---------- pipeline d'un domaine ---------- */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 14px; overflow-x: auto; padding: 4px 2px 18px; scroll-snap-type: x proximity; }
.pipeline .col { background: #e9eef0; border-radius: 16px; padding: 12px; min-height: 140px; scroll-snap-align: start; }
.pipeline .col > header { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 12px; }
.pipeline .col h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #3d4f58; }
.compte { min-width: 24px; text-align: center; padding: 1px 8px; border-radius: 99px; background: #fff; font-size: 12px; font-weight: 700; color: var(--doux); }
.col-corps { display: flex; flex-direction: column; gap: 10px; }
.col-vide { text-align: center; color: #9aa9b1; padding: 14px 0; }
.carte-chantier { display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 12px; padding: 12px; text-decoration: none; color: inherit; border: 1px solid var(--trait); box-shadow: var(--ombre); transition: transform .15s, box-shadow .15s; }
.carte-chantier:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 40, 51, .14); }
.carte-chantier strong { font-size: 14px; word-break: break-word; }
.pipeline.clim .col:first-child { box-shadow: inset 0 3px 0 var(--clim); }
.pipeline.pv .col:first-child { box-shadow: inset 0 3px 0 var(--pv); }
.pipeline.irve .col:first-child { box-shadow: inset 0 3px 0 var(--irve); }
.repli { margin-top: 22px; }
.repli summary { cursor: pointer; font-weight: 700; }
.repli ul { margin: 12px 0 0; padding-left: 20px; color: var(--doux); font-size: 14px; }

/* ---------- frise d'un chantier ---------- */
.frise-bloc { margin: 4px 0 22px; }
.frise { list-style: none; margin: 0; padding: 6px 0 14px; display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
.etape { flex: 1 0 118px; position: relative; scroll-snap-align: center; }
.etape::before { content: ''; position: absolute; top: 25px; left: -50%; width: 100%; height: 4px; background: #d5dde1; border-radius: 4px; }
.etape:first-child::before { display: none; }
.etape.fait::before, .etape.actuel::before { background: var(--ok); }
.etape.actuel::before { background: linear-gradient(90deg, var(--ok), var(--jaune)); }
.etape button { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 6px 8px; background: none; border: 0; cursor: pointer; text-align: center; border-radius: 12px; }
.etape button:hover .rond { transform: scale(1.1); }
.etape .rond { width: 42px; height: 42px; border-radius: 50%; display: grid; place-content: center; font-weight: 800; font-size: 15px; background: #fff; border: 3px solid #cfd8dc; color: #8a9aa3; transition: transform .2s; }
.etape .rond svg { width: 20px; height: 20px; }
.etape.fait .rond { background: var(--ok); border-color: var(--ok); color: #fff; }
.etape.actuel .rond { border-color: var(--jaune); color: #1c2b33; background: #fff8de; animation: halo-jaune 2.2s ease-in-out infinite; }
@keyframes halo-jaune { 0%, 100% { box-shadow: 0 0 0 0 rgba(251, 188, 5, .55); } 50% { box-shadow: 0 0 0 9px rgba(251, 188, 5, 0); } }
.etape-nom { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.etape-etat { font-size: 11.5px; color: var(--doux); }
.etape.fait .etape-etat { color: #11694a; font-weight: 600; }
.etape.actuel .etape-etat { color: var(--attente); font-weight: 700; }
.etape-date { font-size: 11px; color: var(--doux); }
.etape.ouverte button { background: #fff; box-shadow: 0 0 0 2px var(--petrole); }
.panneau-etape { margin-top: 6px; }
.panneau-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tri.large { display: flex; flex-wrap: wrap; width: 100%; margin-bottom: 14px; }
.tri.large button { flex: 1 1 auto; padding: 10px 14px; }

/* ---------- À valider ---------- */
.connexions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.connexion { display: flex; align-items: center; gap: 14px; }
.connexion > div { flex: 1; }
.connexion strong { display: block; font-size: 14px; }
.connexion small { color: var(--doux); font-size: 12.5px; }
.gros-ico { width: 26px; height: 26px; color: var(--petrole); opacity: 1; }
.flux { display: flex; flex-direction: column; gap: 16px; }
.proposition .actions { margin-bottom: 14px; }
.proposition .actions.bas { margin: 6px 0 0; }

@media (max-width: 860px) {
  .cerveau-ciel svg { display: none; }
  .cerveau-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
  .cerveau-liste a, .cerveau-liste .inactif { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
  .cerveau-liste .inactif { border-style: dashed; opacity: .7; }
  .cerveau-liste .rond { width: 40px; height: 40px; border-radius: 50%; display: grid; place-content: center; font-weight: 800; border: 2.5px solid var(--c); flex: none; }
  .cerveau-liste strong { display: block; font-size: 13.5px; }
  .cerveau-liste small { color: #9fb3bd; font-size: 12px; }
  .pipeline { grid-auto-columns: minmax(240px, 82vw); }
}
@media (max-width: 420px) { .cerveau-liste { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .cerveau .arete, .cerveau .decor circle, .cerveau .noeud-interieur, .etape.actuel .rond, .points i.actuel, .entree { animation: none !important; }
}

/* ---------- branchement de la boîte mail ---------- */
.etapes-mail { margin: 0 0 16px; padding-left: 20px; color: #3d4f58; font-size: 14px; line-height: 1.55; }
.etapes-mail li { margin-bottom: 6px; }
.note-securite { font-size: 12.5px; color: var(--doux); background: #f1f5f6; border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.remarques { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 14px; }
.repli-texte { margin: 4px 0 14px; }
.repli-texte summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--petrole-2); }
.repli-texte pre { margin: 8px 0 0; padding: 12px; background: #f1f5f6; border-radius: 10px; font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.connexions .connexion + .connexion { padding-top: 10px; border-top: 1px solid var(--trait); }
.connexions .actions { margin: 10px 0 0 40px; }

/* ---------- connexion et appareils ---------- */
body.deconnecte .menu, body.deconnecte .barre-mobile { display: none; }
body.deconnecte .contenu { margin-left: 0; max-width: none; }
.centre-connexion { min-height: 80vh; display: grid; place-items: center; }
.page-connexion { width: min(440px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 6px; }
.page-connexion h1 { font-size: 24px; }
.page-connexion .sous { margin-bottom: 14px; }

.page-connexion input { text-transform: uppercase; letter-spacing: .08em; }
.page-connexion #appareil { text-transform: none; letter-spacing: 0; }
.carte-code { background: var(--nuit); color: #fff; border-radius: 16px; padding: 20px; margin-bottom: 18px; }
.carte-code .sous { color: #b6c7ce; }
.code-gros { font: 800 30px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: var(--jaune); margin: 10px 0 14px; word-break: break-all; }
.carte-code .btn { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.ligne-appareil { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; }
@media (max-width: 860px) { body.deconnecte .contenu { padding-top: 40px; } .ligne-appareil { grid-template-columns: 1fr auto; } .ligne-appareil > :nth-child(2) { display: none; } }

/* ---------- pièces jointes et stockage ---------- */
.bloc-pieces { display: flex; flex-direction: column; gap: 10px; }
.pieces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pieces li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 8px 12px; background: #f6f8f9; border-radius: 10px; }
.pieces li a { font-weight: 600; word-break: break-word; }
.choix-drive { min-height: 34px; padding: 4px 8px; border: 1px solid #c9d4d9; border-radius: 8px; background: #fff; font-size: 13px; max-width: 100%; }
.progres { height: 6px; border-radius: 99px; background: #e6ecee; overflow: hidden; }
.progres i { display: block; height: 100%; width: 0; background: var(--jaune); transition: width .2s; }
.fichiers-generaux { margin-top: 26px; }
.fichiers-generaux h2 { margin-bottom: 4px; }
.fichiers-generaux > .sous { margin-bottom: 12px; }
.ligne-drive { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; }
.liste-simple { margin: 8px 0 0; padding-left: 20px; color: var(--doux); font-size: 14px; line-height: 1.6; }
@media (max-width: 860px) { .pieces li { grid-template-columns: 1fr auto; } .pieces li .sous { grid-column: 1; } .ligne-drive { grid-template-columns: 1fr; } }

/* ---------- page d'installation ---------- */
body.page-installer .contenu { margin: 0 auto; max-width: 860px; padding-top: 40px; }
.marque.sombre { color: var(--texte); padding-left: 0; }
.marque.sombre small { color: var(--doux); }
.installer h1 { margin: 8px 0 10px; }
.installer .grille { margin: 22px 0; }
.installer code { background: #eef2f4; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.aide-install { margin-bottom: 18px; }
.carte.app .sous { word-break: break-all; font-size: 11.5px; }

/* ---------- logo de la société ---------- */
.menu .marque { flex-direction: column; align-items: flex-start; gap: 8px; padding: 6px 12px 22px; }
.menu .marque .logo-menu { width: 132px; height: auto; display: block; }
.menu .marque small { display: block; font-size: 11.5px; color: #9fb3bd; font-weight: 600; letter-spacing: .02em; }
.marque.sombre { flex-direction: column; align-items: flex-start; gap: 8px; }
.marque.sombre .logo-menu { width: 150px; height: auto; }
.logo-connexion { width: 170px; height: auto; margin-bottom: 14px; }
.marque-mini-logo { height: 26px; width: auto; display: block; }
@media (max-width: 860px) { .barre-mobile { gap: 10px; } }
