/* Cases à cocher animées (voir cases.js) : la case native reste dans la page, invisible mais utilisable au clavier,
   et une case dessinée prend sa place : coche tracée, liseré qui court, et petite gerbe au moment où l'on coche. */
.gfg-cb-input{position:absolute!important;opacity:0!important;width:1px!important;height:1px!important;margin:0!important;padding:0!important;pointer-events:none}
.gfg-cb{--cb:#5b91ce;--cb-dark:#3f74af;--cb-light:#a9d2ff;--cb-size:22px;position:relative;display:inline-block;flex:0 0 auto;width:var(--cb-size);height:var(--cb-size);margin-top:1px;vertical-align:-5px;cursor:pointer}
.gfg-cb__box{position:absolute;inset:0;border-radius:5px;border:2px solid color-mix(in srgb,var(--cb-dark) 85%,transparent);background:#0b1016cc;transition:border-color .4s,background .4s}
.gfg-cb__box svg{position:absolute;inset:2px;width:calc(100% - 4px);height:calc(100% - 4px);fill:none;stroke:var(--cb-light);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:40;stroke-dashoffset:40;transform-origin:center;transition:stroke-dashoffset .4s cubic-bezier(.16,1,.3,1),transform .4s cubic-bezier(.16,1,.3,1)}
.gfg-cb__glow{position:absolute;inset:-2px;border-radius:7px;background:var(--cb);filter:blur(7px);opacity:0;transition:opacity .4s;pointer-events:none}
.gfg-cb__borders{position:absolute;inset:-2px;border-radius:5px;overflow:hidden;pointer-events:none}
.gfg-cb__borders i{position:absolute;background:var(--cb-light);opacity:0;transition:opacity .4s}
.gfg-cb__borders i:nth-child(1){top:0;left:-100%;width:60%;height:1px;animation:gfg-cb-f1 2s linear infinite}
.gfg-cb__borders i:nth-child(2){top:-100%;right:0;width:1px;height:60%;animation:gfg-cb-f2 2s linear infinite}
.gfg-cb__borders i:nth-child(3){bottom:0;right:-100%;width:60%;height:1px;animation:gfg-cb-f3 2s linear infinite}
.gfg-cb__borders i:nth-child(4){bottom:-100%;left:0;width:1px;height:60%;animation:gfg-cb-f4 2s linear infinite}
@keyframes gfg-cb-f1{to{transform:translateX(370%)}}@keyframes gfg-cb-f2{to{transform:translateY(370%)}}@keyframes gfg-cb-f3{to{transform:translateX(-370%)}}@keyframes gfg-cb-f4{to{transform:translateY(-370%)}}
.gfg-cb__fx{position:absolute;inset:0;pointer-events:none}
.gfg-cb__fx i{position:absolute;top:50%;left:50%;width:3px;height:3px;border-radius:50%;background:var(--cb-light);box-shadow:0 0 6px var(--cb);opacity:0}
.gfg-cb__fx b{position:absolute;inset:-12px;border-radius:50%;border:1px solid var(--cb);opacity:0;transform:scale(0)}
.gfg-cb__fx s{position:absolute;top:50%;left:50%;width:14px;height:1px;background:linear-gradient(90deg,var(--cb-light),transparent);opacity:0;transform-origin:left center}
/* Cochée */
:checked+.gfg-cb .gfg-cb__box{border-color:var(--cb);background:color-mix(in srgb,var(--cb) 16%,#0b1016)}
:checked+.gfg-cb .gfg-cb__box svg{stroke-dashoffset:0;transform:scale(1.1)}
:checked+.gfg-cb .gfg-cb__glow{opacity:.22}
:checked+.gfg-cb .gfg-cb__borders i{opacity:1}
/* La gerbe, seulement au moment où l'on coche */
.gfg-cb.pop .gfg-cb__fx i{animation:gfg-cb-burst .6s ease-out forwards}
.gfg-cb.pop .gfg-cb__fx b{animation:gfg-cb-ring .6s ease-out forwards}
.gfg-cb.pop .gfg-cb__fx b:nth-child(14){animation-delay:.1s}.gfg-cb.pop .gfg-cb__fx b:nth-child(15){animation-delay:.2s}
.gfg-cb.pop .gfg-cb__fx s{animation:gfg-cb-spark .6s ease-out forwards}
@keyframes gfg-cb-burst{0%{transform:translate(-50%,-50%) scale(1);opacity:0}20%{opacity:1}100%{transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) scale(0);opacity:0}}
@keyframes gfg-cb-ring{0%{transform:scale(0);opacity:1}100%{transform:scale(1.6);opacity:0}}
@keyframes gfg-cb-spark{0%{transform:rotate(var(--r)) translateX(0) scale(1);opacity:1}100%{transform:rotate(var(--r)) translateX(22px) scale(0);opacity:0}}
:focus-visible+.gfg-cb .gfg-cb__box{outline:2px solid var(--cb-light);outline-offset:3px}
:disabled+.gfg-cb{opacity:.5;cursor:not-allowed}
.gfg-cb:hover .gfg-cb__box{border-color:var(--cb)}
/* Variantes : le « danger » de l'éditeur en rouge */
.pe-check .gfg-cb{--cb:#ff5a5f;--cb-dark:#c2393d;--cb-light:#ffb0b2;--cb-size:18px}
@media (prefers-reduced-motion:reduce){.gfg-cb *{animation:none!important;transition:none!important}.gfg-cb__borders{display:none}}
/* Thème clair */
html[data-theme="light"] .gfg-cb{--cb:#3f74af;--cb-dark:#3f74af;--cb-light:#295e99}
html[data-theme="light"] .gfg-cb__box{background:#fff;border-color:#3f74af99}
html[data-theme="light"] :checked+.gfg-cb .gfg-cb__box{background:#3f74af1a;border-color:#3f74af}
html[data-theme="light"] .pe-check .gfg-cb{--cb:#d73a41;--cb-dark:#d73a41;--cb-light:#b8262e}
