/* Pages d'accès : connexion, premier mot de passe, erreurs sans session.
   Fond de réseau de personnes aux couleurs de l'entreprise (variables --marque*), un seul cadre, peu de texte.
   Tout mouvement est coupé si l'utilisateur demande moins d'animations. */
body.page-connexion{background:var(--marque-pale);min-height:100vh;overflow-x:hidden}
body.page-connexion main.connexion{position:relative;isolation:isolate;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;min-height:100vh;padding:var(--e6) var(--e4);max-width:none}

/* ---------- Fond ---------- */
.decor{position:fixed;inset:0;z-index:-1;overflow:hidden;
  background:radial-gradient(1100px 680px at 8% 4%,var(--marque-doux),transparent 62%),radial-gradient(900px 620px at 96% 98%,var(--marque-moyen),transparent 64%),var(--marque-pale)}
.decor::before{content:"";position:absolute;inset:0;
  background-image:radial-gradient(circle,color-mix(in srgb,var(--marque-encre) 26%,transparent) 1.3px,transparent 1.8px);background-size:30px 30px;
  -webkit-mask-image:radial-gradient(ellipse 70% 65% at 50% 50%,transparent 0,transparent 30%,#000 100%);mask-image:radial-gradient(ellipse 70% 65% at 50% 50%,transparent 0,transparent 30%,#000 100%);opacity:.7}
.decor svg{position:absolute;inset:0;width:100%;height:100%}
.decor .lien{fill:none;stroke:var(--marque-encre);stroke-opacity:.2;stroke-width:1.3;stroke-linecap:round}
.decor .noeud{fill:var(--surface);stroke:var(--marque-encre);stroke-opacity:.42;stroke-width:1.6}
.decor .noeud.plein{fill:var(--marque);fill-opacity:.85;stroke:var(--marque-encre);stroke-opacity:.5}
.decor .anneau{fill:none;stroke:var(--marque-encre);stroke-opacity:.13;stroke-width:1.5}
.decor .onde{fill:none;stroke:var(--marque-encre);stroke-width:1.5;opacity:0}
.decor .amas{transform-box:fill-box;transform-origin:center}

/* ---------- Cadre ---------- */
.entree{display:flex;flex-direction:column;gap:var(--e4);width:min(420px,100%);padding:var(--e8) var(--e8) var(--e6);border:1px solid color-mix(in srgb,var(--marque-encre) 14%,var(--surface));border-radius:20px;background:var(--surface);box-shadow:0 28px 64px -28px rgba(14,28,35,.35),0 2px 6px rgba(14,28,35,.06);align-self:center;justify-self:center}
.entree-marque{display:flex;justify-content:center;padding-bottom:var(--e1)}
.entree-marque img{width:auto;max-width:200px;max-height:72px;height:auto}
.entree-marque .marque-nom{font-size:var(--t-grand);font-weight:600;letter-spacing:-.01em}
.entree h1{font-size:var(--t-grand);text-align:center;letter-spacing:-.01em}
.entree .sous{color:var(--encre-3);text-align:center;font-size:var(--t-corps)}
.entree .champ{display:flex;flex-direction:column;gap:6px}
.entree .champ>span:first-child,.entree .champ>label{font-size:var(--t-note);font-weight:600;color:var(--encre-2)}
.entree input:not([type=checkbox]):not([type=radio]){min-height:52px;border-radius:12px;border-color:color-mix(in srgb,var(--trait) 70%,var(--surface));background:var(--surface);transition:border-color .15s var(--courbe),box-shadow .15s var(--courbe)}
.entree input:not([type=checkbox]):not([type=radio]):hover{border-color:var(--trait)}
.entree input:not([type=checkbox]):not([type=radio]):focus{outline:0;border-color:var(--marque-encre);box-shadow:0 0 0 4px color-mix(in srgb,var(--marque) 38%,transparent)}
.entree input:focus-visible{outline:0}
.entree .btn-large{min-height:54px;border-radius:12px;font-size:var(--t-fort);border-color:transparent;box-shadow:0 1px 0 rgba(255,255,255,.5) inset;transition:background-color .15s var(--courbe),transform .15s var(--courbe),box-shadow .15s var(--courbe)}
.entree .btn-plein:hover{transform:translateY(-1px);box-shadow:0 10px 22px -12px color-mix(in srgb,var(--marque-encre) 70%,transparent)}
.entree .btn-plein:active{transform:translateY(1px)}
.entree .aide{margin-top:var(--e1);color:var(--encre-3);font-size:var(--t-note);text-align:center}
.entree .message{margin:0;border-radius:12px}
.entree .attention-maj{margin:calc(var(--e2) * -1) 0 0;color:var(--garde);font-size:var(--t-note);font-weight:600}

/* Mot de passe : bouton « afficher » dans le champ */
.mdp{position:relative;display:block}
.mdp input{padding-right:56px}
.voir-mdp{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:10px;background:transparent;color:var(--encre-2);cursor:pointer;transition:background-color .15s var(--courbe),color .15s var(--courbe)}
.voir-mdp:hover{background:var(--marque-pale);color:var(--marque-encre)}
.voir-mdp:focus-visible{outline:3px solid var(--focus);outline-offset:-2px}
.voir-mdp svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.voir-mdp .barre{opacity:0;transition:opacity .15s}
.voir-mdp[aria-pressed=true] .barre{opacity:1}
.sans-js .voir-mdp{display:none}

/* Bouton en attente */
.btn.charge{pointer-events:none;color:transparent;position:relative}
.btn.charge::after{content:"";position:absolute;width:22px;height:22px;border:3px solid color-mix(in srgb,var(--sur-marque) 25%,transparent);border-top-color:var(--sur-marque);border-radius:50%;animation:tourne .7s linear infinite}

/* ---------- Mouvement ---------- */
@keyframes monte{from{opacity:0;transform:translateY(16px) scale(.985)}to{opacity:1;transform:none}}
@keyframes apparait{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes derive{to{transform:translate(var(--dx),var(--dy))}}
@keyframes onde{0%{opacity:.4;transform:scale(1)}100%{opacity:0;transform:scale(2.8)}}
@keyframes secoue{0%,100%{transform:translateX(0)}18%{transform:translateX(-9px)}36%{transform:translateX(8px)}54%{transform:translateX(-6px)}72%{transform:translateX(4px)}}
@keyframes tourne{to{transform:rotate(360deg)}}
@keyframes nait{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:no-preference){
  .entree{animation:monte .6s var(--courbe) both}
  .entree.refusee{animation:monte .6s var(--courbe) both,secoue .45s .5s ease-in-out}
  .entree>*{animation:apparait .5s var(--courbe) both}
  .entree>*:nth-child(1){animation-delay:.12s}.entree>*:nth-child(2){animation-delay:.18s}.entree>*:nth-child(3){animation-delay:.24s}
  .entree>*:nth-child(4){animation-delay:.30s}.entree>*:nth-child(5){animation-delay:.36s}.entree>*:nth-child(6){animation-delay:.42s}.entree>*:nth-child(n+7){animation-delay:.48s}
  .decor svg{animation:nait 1.2s ease-out both}
  .decor .amas{animation:derive var(--d) ease-in-out infinite alternate}
  .decor .amas-1{--dx:16px;--dy:12px;--d:19s}.decor .amas-2{--dx:-14px;--dy:14px;--d:23s}.decor .amas-3{--dx:12px;--dy:-14px;--d:21s}.decor .amas-4{--dx:-12px;--dy:-10px;--d:17s}
  .decor .onde{animation:onde 6.5s ease-out infinite;transform-box:fill-box;transform-origin:center}
  .decor .onde-2{animation-delay:2.2s}.decor .onde-3{animation-delay:4.1s}
}

/* ---------- Téléphone ---------- */
@media (max-width:520px){
  body.page-connexion main.connexion{align-content:center;padding:var(--e4)}
  .entree{padding:var(--e6) var(--e5) var(--e5);border-radius:18px}
  .decor .noeud{stroke-opacity:.34}
}

/* =====================================================================
   Deux volets sur ordinateur : formulaire à gauche, scène animée à droite (sans texte).
   Sur téléphone et tablette étroite : le réseau de personnes en fond et le cadre seul.
   ===================================================================== */
.scene{display:none}
body.page-connexion:has(.bandeau-demo) main.connexion{min-height:calc(100vh - 2.25rem)}
@media (min-width:960px){
  body.page-connexion{background:var(--surface)}
  body.page-connexion main.connexion{grid-template-columns:minmax(440px,42%) minmax(0,1fr);place-items:stretch;padding:0}
  .decor{display:none}
  .entree{align-self:center;justify-self:center;width:min(400px,calc(100% - 64px));padding:var(--e8) 0;border:0;border-radius:0;background:transparent;box-shadow:none}
  .scene{display:block;position:relative;margin:16px 16px 16px 0;min-height:calc(100vh - 32px);border-radius:28px;overflow:hidden;container-type:size;isolation:isolate;
    --sc-fond:color-mix(in srgb,var(--marque-encre) 84%,#000);--sk:color-mix(in srgb,var(--marque-encre) 15%,#fff);background:var(--sc-fond)}
  body:has(.bandeau-demo) .scene{min-height:calc(100vh - 2.25rem - 32px)}
}

/* ---------- Fond de scène ---------- */
.scene-fond{position:absolute;inset:0;z-index:-2;
  background:radial-gradient(75% 55% at 18% 10%,color-mix(in srgb,var(--marque) 30%,transparent),transparent 70%),radial-gradient(65% 55% at 92% 98%,color-mix(in srgb,var(--marque) 24%,transparent),transparent 70%),var(--sc-fond)}
.scene-fond::after{content:"";position:absolute;inset:0;background-image:radial-gradient(circle,rgba(255,255,255,.2) 1.2px,transparent 1.7px);background-size:26px 26px;-webkit-mask-image:radial-gradient(ellipse at 50% 50%,#000 20%,transparent 78%);mask-image:radial-gradient(ellipse at 50% 50%,#000 20%,transparent 78%)}
.scene-liens{position:absolute;inset:0;z-index:-1;width:100%;height:100%}
.s-anneau{fill:none;stroke:#fff;stroke-opacity:.12;stroke-width:1.6}
.s-lien{fill:none;stroke:var(--marque);stroke-opacity:.55;stroke-width:2;stroke-dasharray:3 11;stroke-linecap:round}

/* ---------- Plans et cartes ---------- */
.plan{position:absolute;--prof:1;transform:translate3d(calc(var(--px,0) * var(--prof) * 1.6cqw),calc(var(--py,0) * var(--prof) * 1.2cqw),0);transition:transform .35s cubic-bezier(.2,.7,.2,1)}
.plan-1{left:7cqw;top:6%;width:41cqw;--prof:1.2}
.plan-2{right:7cqw;top:5%;width:16cqw;--prof:.7}
.plan-3{right:6cqw;top:24%;width:35cqw;--prof:1.5}
.plan-4{left:6cqw;top:36%;width:43cqw;--prof:.9}
.plan-5{left:18cqw;bottom:6%;width:54cqw;--prof:1.1}
.plan-6{left:58cqw;top:60%;--prof:1.8}
.plan-7{left:7cqw;bottom:21%;--prof:1.9}
.plan-8{right:10cqw;bottom:9%;--prof:.8}
.carte{position:relative;padding:2.2cqw;border-radius:2.4cqw;background:#fff;box-shadow:0 2.4cqw 5cqw -2.2cqw rgba(0,0,0,.5),0 .2cqw .5cqw rgba(0,0,0,.12)}
.sk{display:block;height:1.2cqw;border-radius:1cqw;background:var(--sk)}
.w40{width:40%}.w45{width:45%}.w55{width:55%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}

/* Fiche */
.f-tete{display:flex;align-items:center;gap:1.6cqw;padding-bottom:1.8cqw;border-bottom:.2cqw solid var(--sk)}
.avatar-s,.rond{display:grid;place-items:center;flex:none;border-radius:50%;background:var(--marque);color:var(--marque-encre)}
.avatar-s{width:6.4cqw;height:6.4cqw}
.avatar-s svg,.rond svg{width:58%;height:58%;fill:currentColor}
.f-lignes{display:grid;gap:1cqw;flex:1}
.pastille{width:4.6cqw;height:2cqw;border-radius:1cqw;background:var(--marque-moyen)}
.f-corps{display:grid;gap:1.5cqw;padding-top:1.8cqw}
.f-ligne{display:flex;align-items:center;gap:1.4cqw}
.f-ligne .sk{flex:1}
.pt{width:1.8cqw;height:1.8cqw;border-radius:50%;background:var(--marque-moyen);flex:none}
.f-ligne.ok svg{width:2.6cqw;height:2.6cqw;flex:none;fill:none;stroke:var(--marque-encre);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}

/* Anneau */
.c-anneau{display:grid;place-items:center;aspect-ratio:1;padding:1.2cqw;border-radius:50%}
.c-anneau>svg{width:100%;height:100%;transform:rotate(-90deg)}
.r-fond{fill:none;stroke:var(--sk);stroke-width:9}
.r-val{fill:none;stroke:var(--marque);stroke-width:9;stroke-linecap:round;stroke-dasharray:100;stroke-dashoffset:34}
.a-centre{position:absolute;display:grid;place-items:center;color:var(--marque-encre)}
.a-centre svg{width:6cqw;height:6cqw;fill:currentColor;stroke:none}

/* Document */
.c-doc{display:grid;gap:1.5cqw}
.d-tete{display:flex;align-items:center;gap:1.4cqw;margin-bottom:.6cqw}
.d-tete .sk{flex:1}
.d-logo{width:4.2cqw;height:4.2cqw;border-radius:1.2cqw;background:var(--marque)}
.d-montant{margin-top:.8cqw;padding:1.6cqw;border-radius:1.4cqw;background:color-mix(in srgb,var(--marque) 28%,#fff)}
.d-montant i{display:block;width:55%;height:2.4cqw;border-radius:1.2cqw;background:var(--marque-encre);opacity:.85}
.d-pied{position:relative;display:flex;align-items:flex-end;justify-content:space-between;margin-top:.6cqw;min-height:7cqw}
.d-signature{width:19cqw;height:6.2cqw;fill:none;stroke:var(--marque-encre);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:0}
.d-tampon{display:grid;place-items:center;width:7cqw;height:7cqw;border-radius:50%;background:var(--marque)}
.d-tampon svg{width:62%;height:62%;fill:none;stroke:var(--marque-encre);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}

/* Graphique */
.c-graph{height:21cqw;padding:2.6cqw 2.6cqw 2.2cqw}
.g-barres{position:absolute;inset:2.6cqw 2.6cqw 2.2cqw;display:flex;align-items:flex-end;gap:1.8cqw}
.b{flex:1;height:var(--h);border-radius:1.2cqw 1.2cqw .5cqw .5cqw;background:var(--sk);transform-origin:50% 100%}
.b.vif{background:var(--marque)}
.b1{--h:38%}.b2{--h:52%}.b3{--h:44%}.b4{--h:92%}.b5{--h:60%}.b6{--h:48%}.b7{--h:70%}
.g-plafond{position:absolute;left:2.2cqw;right:2.2cqw;top:25%;border-top:.25cqw dashed color-mix(in srgb,var(--marque-encre) 55%,#fff);z-index:2}
.g-plafond i{position:absolute;right:-.4cqw;top:-1.1cqw;width:2cqw;height:2cqw;background:var(--marque-encre);clip-path:polygon(0 0,100% 50%,0 100%)}

/* Calendrier */
.c-cal{padding:2cqw 2.4cqw}
.k-grille{display:grid;grid-template-columns:repeat(7,1fr);gap:1.2cqw}
.k-grille i{display:block;aspect-ratio:1.5;border-radius:1cqw;background:var(--sk)}
.k-grille i.on{background:var(--marque)}
.k-curseur{position:absolute;left:2.4cqw;top:2cqw;width:calc((100% - 4.8cqw - 7.2cqw) / 7);aspect-ratio:1.5;border-radius:1cqw;box-shadow:0 0 0 .4cqw var(--marque-encre)}

/* Pastilles de personnes */
.rond{box-shadow:0 1.6cqw 3.2cqw -1.2cqw rgba(0,0,0,.5);border:.5cqw solid rgba(255,255,255,.85)}
.r-a{width:9cqw;height:9cqw;background:var(--marque-moyen)}
.r-b{width:6.6cqw;height:6.6cqw;background:#fff;color:var(--marque-encre)}
.r-c{width:7.6cqw;height:7.6cqw}

/* ---------- Mouvement de la scène ---------- */
@keyframes flotte{from{transform:translateY(0)}to{transform:translateY(var(--fy,-1.2cqw))}}
@keyframes pousse{0%,6%{transform:scaleY(.04)}34%,86%{transform:scaleY(1)}100%{transform:scaleY(.04)}}
@keyframes remplit{0%,100%{stroke-dashoffset:78}50%{stroke-dashoffset:18}}
@keyframes ecrit{0%,10%{stroke-dashoffset:1}55%,100%{stroke-dashoffset:0}}
@keyframes tamponne{0%,52%{transform:scale(0);opacity:0}64%{transform:scale(1.18);opacity:1}72%,92%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}
@keyframes pas{0%,8%{transform:translateX(0)}16%,24%{transform:translateX(calc(100% + 1.2cqw))}32%,40%{transform:translateX(calc(200% + 2.4cqw))}48%,56%{transform:translateX(calc(300% + 3.6cqw))}64%,72%{transform:translateX(calc(400% + 4.8cqw))}80%,88%{transform:translateX(calc(500% + 6cqw))}100%{transform:translateX(calc(600% + 7.2cqw))}}
@keyframes coule{to{stroke-dashoffset:-56}}
@keyframes entre{from{opacity:0;transform:translateY(3cqw) scale(.96)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
  .carte,.rond{animation:flotte var(--d,7s) ease-in-out infinite alternate}
  .c-fiche{--d:8s;--fy:-1.4cqw}.c-anneau{--d:6s;--fy:1.2cqw}.c-doc{--d:9s;--fy:-1.6cqw}.c-graph{--d:7s;--fy:1.4cqw}.c-cal{--d:8.5s;--fy:-1cqw}
  .r-a{--d:5.5s;--fy:-1.8cqw}.r-b{--d:6.5s;--fy:1.6cqw}.r-c{--d:7.5s;--fy:-1.4cqw}
  .plan{animation:entre .8s cubic-bezier(.2,.7,.2,1) both}
  .plan-2{animation-delay:.1s}.plan-3{animation-delay:.2s}.plan-4{animation-delay:.3s}.plan-5{animation-delay:.4s}.plan-6{animation-delay:.5s}.plan-7{animation-delay:.6s}.plan-8{animation-delay:.7s}
  .b{animation:pousse 7s cubic-bezier(.2,.7,.2,1) infinite}
  .b2{animation-delay:.12s}.b3{animation-delay:.24s}.b4{animation-delay:.36s}.b5{animation-delay:.48s}.b6{animation-delay:.6s}.b7{animation-delay:.72s}
  .r-val{animation:remplit 8s ease-in-out infinite}
  .d-signature{animation:ecrit 7s ease-in-out infinite}
  .d-tampon{animation:tamponne 7s ease-out infinite}
  .k-curseur{animation:pas 8s steps(1,end) infinite}
  .s-lien{animation:coule 3.2s linear infinite}.s-lien-2{animation-duration:4.4s;animation-direction:reverse}
}
