/* tool/animaties.css — animaties (build 179), samen met tool/animaties.js.
   Terugdraaien: de <link> naar dit bestand in index.html en '/tool/animaties.js' in tool/router.js weghalen.
   Bewegen gebeurt alleen als 'minder beweging' in het systeem uit staat; de vinkjes hebben wel altijd de nieuwe vorm. */

:root{
  --t-fast:150ms; --t:200ms; --t-slow:250ms;
  --ease:cubic-bezier(.2,.8,.2,1); --ease-in:cubic-bezier(.4,0,1,1);
}

/* ---------- vinkjes: eigen vakje in de hoofdkleur (gekleurde vinkjes met style="accent-color" blijven van de browser) ---------- */
:where(input[type=checkbox]){width:16px;height:16px}
input[type=checkbox]:not([style*="accent-color"]){
  -webkit-appearance:none;appearance:none;display:inline-grid;place-content:center;flex:none;
  border:1.5px solid var(--line-strong);border-radius:var(--r-xs);background:var(--white);cursor:pointer;vertical-align:-3px;
  --chk:var(--orange);--chk-tick:#fff
}
input[type=checkbox]:not([style*="accent-color"])::before{
  content:"";width:10px;height:10px;background:var(--chk-tick);clip-path:inset(0 100% 0 0);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.6 5.2 4 7.5 8.6 2.6' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.6 5.2 4 7.5 8.6 2.6' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat
}
input[type=checkbox]:not([style*="accent-color"]):checked{background:var(--chk);border-color:var(--chk)}
input[type=checkbox]:not([style*="accent-color"]):checked::before{clip-path:inset(0)}
input[type=checkbox]:not([style*="accent-color"]):indeterminate{background:var(--chk);border-color:var(--chk)}
input[type=checkbox]:not([style*="accent-color"]):indeterminate::before{clip-path:inset(0);-webkit-mask:none;mask:none;height:2px;border-radius:1px}
input[type=checkbox]:not([style*="accent-color"]):hover:not(:checked):not(:disabled){border-color:var(--chk)}
input[type=checkbox]:not([style*="accent-color"]):focus-visible{outline:2px solid var(--orange);outline-offset:2px}
input[type=checkbox]:not([style*="accent-color"]):disabled{opacity:.5;cursor:default}
.pc-group-title input[type=checkbox]{--chk:var(--ink);--chk-tick:var(--white)}
input[type=checkbox][hidden]{display:none!important}

@media (prefers-reduced-motion:no-preference){
  input[type=checkbox]:not([style*="accent-color"]){transition:background-color 120ms ease,border-color 120ms ease}
  input[type=checkbox]:not([style*="accent-color"])::before{transition:clip-path 80ms ease}
  input[type=checkbox]:not([style*="accent-color"]):checked::before{transition:clip-path var(--t) var(--ease) 60ms}

  /* ---------- vensters: zacht in beeld (dicht gaan: tool/animaties.js) ---------- */
  /* geen schalen: geschaalde tekst wordt aan het eind opnieuw scherp getekend en dat geeft een schokje */
  .overlay.open{animation:tbFadeIn 180ms cubic-bezier(.3,0,.3,1)}
  .overlay.open>.modal{animation:tbModalIn 220ms cubic-bezier(.25,.6,.3,1)}
  .overlay.tb-ghost{will-change:opacity}
  .overlay.tb-ghost>.modal{will-change:opacity,transform}
  .overlay.tb-ghost.tb-out{animation:tbFadeOut 160ms linear forwards}
  .overlay.tb-ghost.tb-out>.modal{animation:tbModalOut 160ms cubic-bezier(.3,0,.5,1) forwards}

  /* ---------- uitklapmenu's en lijstjes: kort openvouwen vanaf de knop ---------- */
  .cdd-list,.usermenu-pop.open,.cal-search-results:not(:empty){animation:tbMenuIn 160ms cubic-bezier(.25,.6,.3,1);transform-origin:top center}

  /* ---------- meldingen rechtsonder: van rechts in beeld; weg = naar rechts (opschuiven: tool/animaties.js) ---------- */
  .toast{animation:tbToastIn var(--t) var(--ease)}
  .toast.out{transform:translateX(16px)}

  /* ---------- agenda: blok licht één keer op na verplaatsen of opslaan ---------- */
  .event.tb-flash{animation:tbFlash 900ms ease-out}

  /* ---------- opslaan-knop ---------- */
  .tb-saved{transition:background-color var(--t) ease,border-color var(--t) ease}
  .tb-saved:not(.tb-static) .tb-tick path{stroke-dasharray:22;stroke-dashoffset:22;animation:tbDraw var(--t-slow) var(--ease) forwards}

  /* ---------- licht/donker: kleuren lopen in elkaar over ---------- */
  html.tb-theme-fade,html.tb-theme-fade *,html.tb-theme-fade *::before,html.tb-theme-fade *::after{
    transition:background-color var(--t-slow) ease,color var(--t-slow) ease,border-color var(--t-slow) ease,fill var(--t-slow) ease,stroke var(--t-slow) ease!important}
}

.overlay.tb-ghost{display:flex;z-index:99;pointer-events:none} /* kopie van een gesloten venster (tool/animaties.js); 'open' is eraf, dus geen open-animatie */
.tb-saved{background:var(--ok)!important;border-color:var(--ok)!important;color:#fff!important}
.tb-saved,.tb-busy{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.tb-tick{width:14px;height:14px;flex:none}
.tb-spin{width:13px;height:13px;flex:none;border:2px solid color-mix(in srgb,currentColor 35%,transparent);border-top-color:currentColor;border-radius:50%;animation:tbSpin .7s linear infinite}

@keyframes tbFadeIn{from{opacity:0}to{opacity:1}}
@keyframes tbFadeOut{from{opacity:1}to{opacity:0}}
@keyframes tbModalIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes tbModalOut{from{opacity:1;transform:none}to{opacity:0;transform:translateY(6px)}}
@keyframes tbMenuIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@keyframes tbToastIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
@keyframes tbFlash{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--pc,var(--orange)) 55%,transparent)}35%{box-shadow:0 0 0 6px color-mix(in srgb,var(--pc,var(--orange)) 22%,transparent)}100%{box-shadow:0 0 0 0 transparent}}
@keyframes tbDraw{to{stroke-dashoffset:0}}
@keyframes tbSpin{to{transform:rotate(360deg)}}
