/* ===========================================================================
   BFT dialogs: alert / confirm / prompt / processing in the middle of the
   screen (instead of the browser's own boxes). Motion comes from
   animation/css/animations.css (zoom-in-down in, zoom-out-right out).
   ======================================================================== */
/* Layout of the shell itself, so the dialog is centred on screen even when
   animation/css/animations.css is missing or fails to load (then it simply has no motion). */
.bd-shell{position:fixed;inset:0;display:grid;place-items:center;font-family:'Kalpurush',system-ui,sans-serif;z-index:100500;padding:18px}
.bd-shell[hidden]{display:none}
.bd-shell .anim-modal-backdrop{position:absolute;inset:0;background:rgba(5,10,24,.62);backdrop-filter:blur(6px) saturate(1.1)}
.bd-shell .anim-modal-panel{position:relative;z-index:1;max-height:calc(100dvh - 36px);overflow-y:auto}
.bd-shell .anim-modal-panel:focus{outline:none}
.bd-shell.bd-noanim .anim-modal-backdrop{animation:bdFadeIn .22s ease both}
.bd-shell.bd-noanim .bd-panel{animation:bdPopIn .45s cubic-bezier(.16,1.2,.3,1) both}
@keyframes bdFadeIn{from{opacity:0}}
@keyframes bdPopIn{from{opacity:0;transform:translateY(24px) scale(.94)}}
.bd-panel{--c:#6366f1;--c2:#a855f7;width:min(420px,100%);padding:26px 24px 20px;border-radius:24px;text-align:center;color:var(--text-color,#e5e7eb);
  background:var(--card-bg,#1f2330);border:1px solid color-mix(in srgb,var(--text-color,#fff) 12%,transparent);
  box-shadow:0 40px 80px -30px rgba(0,0,0,.75),0 0 0 1px color-mix(in srgb,var(--c) 18%,transparent)}
.bd-panel::before{content:'';position:absolute;left:0;right:0;top:0;height:5px;border-radius:24px 24px 0 0;background:linear-gradient(90deg,var(--c),var(--c2))}
.bd-panel.t-success{--c:#16a34a;--c2:#14b8a6}.bd-panel.t-error{--c:#ef4444;--c2:#f97316}.bd-panel.t-warning{--c:#f59e0b;--c2:#ef4444}
.bd-panel.t-danger{--c:#ef4444;--c2:#e11d48}.bd-panel.t-question{--c:#6366f1;--c2:#a855f7}.bd-panel.t-info{--c:#0ea5e9;--c2:#6366f1}

/* icon */
.bd-ic{position:relative;width:76px;height:76px;margin:2px auto 14px;border-radius:50%;display:grid;place-items:center;color:var(--c);
  background:color-mix(in srgb,var(--c) 14%,transparent);box-shadow:0 0 0 8px color-mix(in srgb,var(--c) 7%,transparent)}
.bd-ic::after{content:'';position:absolute;inset:-8px;border-radius:50%;border:2px solid color-mix(in srgb,var(--c) 40%,transparent);opacity:0;animation:bdRipple 1.6s ease-out .25s 2}
.bd-ic svg{width:42px;height:42px;fill:none;stroke:currentColor;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
.bd-ic svg .draw{stroke-dasharray:60;stroke-dashoffset:60;animation:bdDraw .55s cubic-bezier(.65,0,.35,1) .35s forwards}
.bd-panel.t-error .bd-ic,.bd-panel.t-danger .bd-ic{animation:bdShake .55s .3s}
.bd-panel.t-warning .bd-ic svg,.bd-panel.t-question .bd-ic svg{animation:bdBob 1.8s ease-in-out .6s 2}
@keyframes bdDraw{to{stroke-dashoffset:0}}
@keyframes bdRipple{0%{opacity:.9;transform:scale(.85)}100%{opacity:0;transform:scale(1.35)}}
@keyframes bdShake{10%,90%{transform:translateX(-2px)}20%,80%{transform:translateX(4px)}30%,50%,70%{transform:translateX(-7px)}40%,60%{transform:translateX(7px)}}
@keyframes bdBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}

/* processing: spinning ring, then the ring turns into a check or cross */
.bd-spin{position:absolute;inset:0;border-radius:50%;border:4px solid color-mix(in srgb,var(--c) 18%,transparent);border-top-color:var(--c);border-right-color:var(--c2);animation:bdSpin .8s linear infinite}
.bd-ic .dots{display:flex;gap:5px}
.bd-ic .dots i{width:8px;height:8px;border-radius:50%;background:var(--c);animation:bdDots 1s ease-in-out infinite}
.bd-ic .dots i:nth-child(2){animation-delay:.15s}.bd-ic .dots i:nth-child(3){animation-delay:.3s}
@keyframes bdSpin{to{transform:rotate(360deg)}}
@keyframes bdDots{0%,80%,100%{transform:scale(.55);opacity:.45}40%{transform:scale(1);opacity:1}}
.bd-panel.is-done .bd-spin{animation:bdSpinDone .45s ease-out forwards}
@keyframes bdSpinDone{to{transform:rotate(360deg) scale(1.15);opacity:0}}
.bd-bar{height:4px;border-radius:9px;margin:14px auto 0;max-width:220px;overflow:hidden;background:color-mix(in srgb,var(--c) 15%,transparent)}
.bd-bar i{display:block;height:100%;width:40%;border-radius:9px;background:linear-gradient(90deg,var(--c),var(--c2));animation:bdBar 1.2s ease-in-out infinite}
@keyframes bdBar{0%{transform:translateX(-110%)}100%{transform:translateX(260%)}}

/* text */
.bd-title{margin:0 0 6px;font-size:1.18rem;font-weight:800;color:var(--heading-color,inherit)}
.bd-msg{margin:0;font-size:.98rem;line-height:1.65;color:color-mix(in srgb,var(--text-color,#e5e7eb) 82%,transparent);white-space:pre-line;word-break:break-word}
.bd-msg b{color:var(--text-color,#fff)}
.bd-field{margin-top:14px;display:flex;gap:8px}
.bd-field input{flex:1;min-width:0;min-height:46px;padding:10px 14px;border-radius:13px;border:1.5px solid color-mix(in srgb,var(--text-color,#fff) 15%,transparent);
  background:color-mix(in srgb,var(--card-bg,#1f2330) 80%,#000);color:var(--text-color,#fff);font:inherit;outline:none;transition:border-color .2s,box-shadow .2s}
.bd-field input:focus{border-color:var(--c);box-shadow:0 0 0 4px color-mix(in srgb,var(--c) 22%,transparent)}

/* buttons */
.bd-acts{display:flex;gap:10px;margin-top:20px}
.bd-acts button{position:relative;overflow:hidden;flex:1;min-height:48px;padding:10px 16px;border-radius:14px;font:inherit;font-weight:800;font-size:.97rem;cursor:pointer;
  border:1px solid color-mix(in srgb,var(--text-color,#fff) 14%,transparent);background:transparent;color:var(--text-color,#fff);transition:transform .2s cubic-bezier(.22,1,.36,1),filter .2s,background .2s}
.bd-acts button:hover{transform:translateY(-2px)}
.bd-acts button:active{transform:scale(.96)}
.bd-acts button:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--c) 40%,transparent)}
.bd-acts .bd-ok{border:0;color:#fff;background:linear-gradient(135deg,var(--c),var(--c2));box-shadow:0 12px 22px -12px var(--c)}
.bd-acts .bd-ok:hover{filter:brightness(1.08)}
.bd-acts .bd-cancel:hover{background:color-mix(in srgb,var(--text-color,#fff) 7%,transparent)}
.bd-x{position:absolute;right:12px;top:14px;width:34px;height:34px;border-radius:11px;border:0;background:transparent;color:color-mix(in srgb,var(--text-color,#fff) 55%,transparent);cursor:pointer;font-size:1.1rem;transition:transform .25s,background .2s}
.bd-x:hover{transform:rotate(90deg);background:color-mix(in srgb,var(--text-color,#fff) 8%,transparent)}
.bd-auto{height:3px;border-radius:9px;margin-top:16px;background:color-mix(in srgb,var(--c) 15%,transparent);overflow:hidden}
.bd-auto i{display:block;height:100%;background:linear-gradient(90deg,var(--c),var(--c2));transform-origin:left;animation:bdAuto linear forwards}
@keyframes bdAuto{from{transform:scaleX(1)}to{transform:scaleX(0)}}

@media(max-width:480px){.bd-panel{padding:22px 18px 16px;border-radius:22px}.bd-acts{flex-direction:column-reverse}.bd-ic{width:66px;height:66px}}
@media(prefers-reduced-motion:reduce){.bd-shell *{animation:none!important}.bd-ic svg .draw{stroke-dashoffset:0}}
