/* NDI motion helpers (2026-11-12). Small, calm, self-hosted. Pairs with ndi-motion.js.
   Rules: nothing longer than ~600 ms, only working indicators loop, and everything
   is switched off by prefers-reduced-motion (or data-nm-reduce="1" on <html>, used
   by the preview page). Colours and radii follow app.css and the sign-up code screen. */
:root{--nm-green:#1f8a53;--nm-green-bg:#edf8f1;--nm-green-ink:#17663e;--nm-red:#c0392b;--nm-ease:cubic-bezier(.2,.7,.2,1)}

.nm-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}

/* ---- working button ---- */
.nm-spinner{width:1.15em;height:1.15em;flex:0 0 auto;display:inline-block;animation:nm-rot .8s linear infinite}
.nm-spinner circle{fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round}
.nm-spinner .nm-track{opacity:.25}
.nm-spinner .nm-arc{stroke-dasharray:16 41}
@keyframes nm-rot{to{transform:rotate(360deg)}}
.nm-is-busy{display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:progress!important}
.nm-is-busy[disabled]{opacity:.92!important}
.nm-is-done{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--nm-green)!important;border-color:var(--nm-green)!important;color:#fff!important;opacity:1!important;cursor:default!important}
.nm-is-done[disabled]{opacity:1!important}
.nm-btn-check{width:1.15em;height:1.15em;flex:0 0 auto}

/* ---- inline message with icon (status under a form) ---- */
.nm-msg{display:flex;align-items:flex-start;gap:8px}
.nm-msg svg{width:16px;height:16px;flex:0 0 16px;margin-top:3px}
.nm-msg-ok{color:var(--nm-green-ink)}
.nm-msg-err{color:var(--nm-red)}

/* ---- confirmed check (drawn once) ---- */
.nm-badge{width:54px;height:54px;border-radius:50%;border:2px solid var(--nm-green);color:var(--nm-green);display:flex;align-items:center;justify-content:center;margin:0 auto 14px}
.nm-badge svg,.nm-check svg{width:26px;height:26px}
.nm-check path,.nm-badge path,.nm-btn-check path{stroke-dasharray:24;stroke-dashoffset:0}
.nm-draw.nm-badge,.nm-draw.nm-check{animation:nm-pop .32s var(--nm-ease) both}
.nm-draw path,.nm-btn-check.nm-draw path{animation:nm-draw .42s var(--nm-ease) .08s both}
@keyframes nm-draw{from{stroke-dashoffset:24}to{stroke-dashoffset:0}}
@keyframes nm-pop{from{transform:scale(.88);opacity:.35}to{transform:none;opacity:1}}

/* ---- indeterminate progress (fetch gives no percentage) ---- */
.nm-progress{position:relative;height:6px;border-radius:999px;background:#e7ecf2;overflow:hidden;margin-top:12px}
.nm-progress>i{position:absolute;top:0;bottom:0;left:0;width:38%;border-radius:999px;background:var(--gold,#E6B450);animation:nm-slide 1.1s ease-in-out infinite}
@keyframes nm-slide{0%{left:-40%}100%{left:100%}}
.nm-progress.is-done>i{animation:none;left:0;width:100%;background:var(--nm-green);transition:width .3s var(--nm-ease)}
.nm-progress.is-error>i{animation:none;left:0;width:100%;background:var(--nm-red)}

/* ---- six code boxes: one real input under a transparent overlay (paste, autofill, keyboard stay native) ---- */
.nm-code{position:relative;display:block;margin-top:8px;isolation:isolate}
.nm-code .nm-code-native{letter-spacing:.35em;text-align:center;font-size:20px}
.nm-code.nm-ready .nm-code-native{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;width:100%;height:100%;margin:0;padding:0;border:0;border-radius:0;background:transparent;color:transparent;caret-color:transparent;box-shadow:none;letter-spacing:normal;-webkit-text-fill-color:transparent;outline:none}
.nm-code.nm-ready .nm-code-native::selection{background:transparent;color:transparent}
.nm-boxes{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:clamp(6px,2vw,12px);pointer-events:none;padding:5px 0}
.nm-box{display:flex;align-items:center;justify-content:center;height:54px;min-width:0;border:1.5px solid #C9D8E6;border-radius:12px;background:#fff;color:#0E1F38;font-size:24px;font-weight:600;line-height:1;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background .18s ease;transform-origin:center}
.nm-box:empty::before{content:"";width:5px;height:5px;border-radius:50%;background:#C9D8E6}
.nm-box.is-filled{background:#f8fafc;border-color:#9cacc0}
.nm-box.is-active{transform:scale(1.06);border-color:#1B4A75;box-shadow:0 0 0 3px rgba(27,74,117,.12);background:#fff}
.nm-code.is-complete .nm-box{border-color:#c69b45;background:#fffbf2}
.nm-code.is-invalid .nm-box{border-color:#c94b43}
.nm-code.is-verified .nm-box{border-color:var(--nm-green);background:var(--nm-green-bg);color:var(--nm-green-ink);box-shadow:none;transform:none}
.nm-code.is-verified.nm-wave .nm-box{animation:nm-wave .4s ease-out both;animation-delay:var(--nm-delay)}
@keyframes nm-wave{0%,100%{transform:scale(1)}45%{transform:translateY(-4px) scale(1.07)}}
@media(max-width:380px){.nm-box{height:48px;font-size:22px;border-radius:10px}}

/* ---- reduced motion: no movement, no artificial delay (JS reads the same switch) ---- */
@media (prefers-reduced-motion:reduce){
  .nm-spinner{animation:none}
  .nm-draw.nm-badge,.nm-draw.nm-check,.nm-draw path{animation:none}
  .nm-progress>i{animation:none;width:100%;opacity:.5}
  .nm-progress.is-done>i,.nm-progress.is-error>i{opacity:1;transition:none}
  .nm-box{transition:none}.nm-box.is-active{transform:none}
  .nm-code.is-verified.nm-wave .nm-box{animation:none}
}
:root[data-nm-reduce="1"] .nm-spinner{animation:none}
:root[data-nm-reduce="1"] .nm-draw.nm-badge,:root[data-nm-reduce="1"] .nm-draw.nm-check,:root[data-nm-reduce="1"] .nm-draw path{animation:none}
:root[data-nm-reduce="1"] .nm-progress>i{animation:none;width:100%;opacity:.5}
:root[data-nm-reduce="1"] .nm-progress.is-done>i,:root[data-nm-reduce="1"] .nm-progress.is-error>i{opacity:1;transition:none}
:root[data-nm-reduce="1"] .nm-box{transition:none}
:root[data-nm-reduce="1"] .nm-box.is-active{transform:none}
:root[data-nm-reduce="1"] .nm-code.is-verified.nm-wave .nm-box{animation:none}
