/* BloomOS — animations fluides (noms uniques : l'ancien conflit « pop » faisait sauter les fenêtres) */
:root{interpolate-size:allow-keywords;--out:cubic-bezier(.22,1,.36,1);--soft:cubic-bezier(.25,1.25,.5,1)}

/* Fenêtres (mini pages) */
.sheet{animation:sheetIn .55s var(--out) both;transform-origin:50% 40%;will-change:transform,opacity}
.sheet.swap{animation:sheetSwap .45s var(--out) both}
.sheet.closing{animation:sheetOut .24s cubic-bezier(.4,0,1,1) both;pointer-events:none}
@keyframes sheetIn{from{opacity:0;transform:translate(-50%,-47%) scale(.94);filter:blur(8px)}to{opacity:1;transform:translate(-50%,-50%) scale(1);filter:blur(0)}}
@keyframes sheetSwap{from{opacity:.4;transform:translate(-50%,-50%) scale(.985);filter:blur(3px)}to{opacity:1;transform:translate(-50%,-50%) scale(1);filter:blur(0)}}
@keyframes sheetOut{to{opacity:0;transform:translate(-50%,-49%) scale(.96);filter:blur(6px)}}
.sheet>*{animation:fadeUp .5s var(--out) both}
.sheet>*:nth-child(2){animation-delay:.05s}.sheet>*:nth-child(3){animation-delay:.09s}.sheet>*:nth-child(n+4){animation-delay:.12s}
.sheet.closing>*{animation:none}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}}
.scrim{animation:scrimIn .35s ease both;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.scrim.closing{animation:scrimOut .24s ease both}
@keyframes scrimIn{from{opacity:0;-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0)}}
@keyframes scrimOut{to{opacity:0}}

/* Conversation Cervex */
.chat{animation:chatIn .42s var(--out) both;transform-origin:50% 100%}
.chat.closing{animation:chatOut .22s ease-in both}
@keyframes chatIn{from{opacity:0;transform:translateY(18px) scale(.97);filter:blur(4px)}}
@keyframes chatOut{to{opacity:0;transform:translateY(14px) scale(.97)}}
.chat-body>.msg{animation:none}
.chat-body>.msg:nth-last-child(-n+2){animation:msgIn .45s var(--out) both}
@keyframes msgIn{from{opacity:0;transform:translateY(10px) scale(.98)}}

/* Toast */
.toast{animation:toastIn .5s var(--soft) both}
.toast.out{animation:toastOut .26s ease-in both}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,16px) scale(.94)}}
@keyframes toastOut{to{opacity:0;transform:translate(-50%,10px) scale(.96)}}

/* Boutons : appui net, relâchement élastique, survol léger */
.btn,.icon-btn,.send,.nav,.seg button,.card,.saas{-webkit-tap-highlight-color:transparent}
.btn{transition:transform .45s var(--soft),background .25s,box-shadow .3s,filter .2s}
.btn:hover{transform:translateY(-1px)}
.btn:active{transform:scale(.95);transition-duration:.08s}
.btn.primary:hover{box-shadow:0 10px 24px var(--accent-glow)}
.icon-btn{transition:transform .4s var(--soft),background .2s,color .2s}
.icon-btn:active{transform:scale(.86);transition-duration:.08s}
.seg button{transition:background .3s var(--out),color .3s,box-shadow .3s,transform .4s var(--soft)}
.seg button:active{transform:scale(.95)}
.seg button.on{animation:segOn .35s var(--out)}
@keyframes segOn{from{transform:scale(.94)}}
.switch::after{transition:transform .45s var(--soft),width .2s}
.switch:active::after{width:24px}
.check input{transition:transform .3s var(--soft)}
.check input:active{transform:scale(.85)}
.check input:checked{animation:checkPop .45s var(--soft)}
@keyframes checkPop{40%{transform:scale(1.25)}}
.ripple{animation-duration:.55s;opacity:.14}

/* Sections dépliables (détails des failles, points halal, financement) */
details::details-content{height:0;overflow:clip;transition:height .4s var(--out),content-visibility .4s allow-discrete}
details[open]::details-content{height:auto}
details summary{transition:color .2s}
details summary::after{content:"";display:inline-block;vertical-align:.15em;width:8px;height:8px;border-right:2px solid var(--text-3);border-bottom:2px solid var(--text-3);transform:rotate(45deg);transition:transform .35s var(--soft);margin-left:6px;flex:none}
summary{list-style:none}summary::-webkit-details-marker{display:none}
details[open] summary::after{transform:rotate(225deg)}

/* Champs */
.field{transition:border-color .25s,box-shadow .35s var(--out),background .25s}

/* Pipeline : Cervex passe par chaque agent */
.pipe{display:flex;align-items:center;gap:4px;margin:10px 0 2px;flex-wrap:wrap}
.pipe-step{display:flex;flex-direction:column;align-items:center;gap:2px;padding:4px 6px;border-radius:12px;opacity:.45;transition:opacity .4s,background .4s,transform .5s var(--soft)}
.pipe-step em{font-style:normal;font-size:11px;font-weight:600}
.pipe-step .av.mini{width:20px;height:38px}
.pipe-step.done{opacity:.8}.pipe-step.done em::after{content:" ✓";color:var(--good)}
.pipe-step.now{opacity:1;background:var(--accent-soft);transform:translateY(-2px);animation:pipeGlow 2s ease-in-out infinite}
@keyframes pipeGlow{50%{box-shadow:0 0 0 4px var(--accent-soft)}}
.pipe-link{width:18px;height:2px;border-radius:2px;background:linear-gradient(90deg,var(--accent),transparent);background-size:200% 100%;animation:flow 1.4s linear infinite;opacity:.6}
@keyframes flow{from{background-position:100% 0}to{background-position:-100% 0}}

@media (prefers-reduced-motion:reduce){.sheet,.sheet>*,.chat,.toast,.scrim{animation:none!important}}
