/* ═══════════════════════════════════════════════════════════════════
   STAGE 1 — OPENING / AUTHENTICATION
   Custom background → branding → authenticating. Unchanged in feel from
   the original prop; every value is still driven by configuration.
   ═══════════════════════════════════════════════════════════════════ */
#stage1{background:var(--primary);z-index:1}

#authBg{
  position:absolute;inset:0;background-position:50% 50%;background-size:cover;
  background-repeat:no-repeat;transform:scale(1.05);will-change:transform
}
#stage1.run #authBg{animation:bgDrift var(--introdur,16s) linear forwards}
@keyframes bgDrift{from{transform:scale(1.05)}to{transform:scale(1)}}

#authScrim{
  position:absolute;inset:0;opacity:.72;
  background:linear-gradient(to bottom,var(--auth-scrim) 0%,rgba(0,0,0,0) 24%,
    rgba(0,0,0,0) 46%,var(--auth-scrim) 100%)
}

.auth-brand{
  position:absolute;left:0;right:0;top:38%;transform:translateY(-50%);
  display:flex;flex-direction:column;align-items:center;gap:16px;opacity:0
}
#stage1.pos-centre .auth-brand{top:50%}
#stage1.pos-lower .auth-brand{top:62%}
#stage1.run .auth-brand{animation:brandIn 1100ms var(--ease) 200ms forwards}
@keyframes brandIn{
  from{opacity:0;transform:translateY(calc(-50% + 12px))}
  to{opacity:1;transform:translateY(-50%)}
}
#authBrandSlot{display:flex;align-items:center;justify-content:center;min-height:52px;color:var(--auth-fg)}
#authBrandSlot:empty{display:none;min-height:0}
#authBrandSlot img{max-height:66px;max-width:210px;width:auto;height:auto;object-fit:contain}
#stage1.run #authBrandSlot{animation:breathe 7s ease-in-out 1.4s infinite}
@keyframes breathe{0%,100%{opacity:1}50%{opacity:.88}}

.wordmark{
  font-family:var(--f-display);font-size:15px;font-weight:600;
  letter-spacing:var(--ls-word);text-indent:var(--ls-word);
  color:var(--auth-fg);text-transform:uppercase
}
.brand-rule{width:34px;height:1px;background:var(--auth-accent);opacity:.9}
.est{font-size:9px;letter-spacing:.28em;text-indent:.28em;color:var(--auth-accent);font-weight:600}

/* protection indicator */
.fscs{
  position:absolute;left:50%;top:72%;transform:translate(-50%,-50%);
  bottom:auto;
  display:inline-flex;align-items:center;gap:7px;padding:7px 13px 7px 11px;border-radius:999px;
  background:rgba(255,255,255,.10);border:.5px solid rgba(255,255,255,.20);
  -webkit-backdrop-filter:blur(14px) saturate(1.3);backdrop-filter:blur(14px) saturate(1.3);
  color:var(--auth-fg);font-size:11px;font-weight:500;letter-spacing:.015em;opacity:0
}
#stage1.run .fscs{animation:fadeUpC 900ms var(--ease) var(--fscs-delay,1100ms) forwards}
@keyframes fadeUpC{from{opacity:0;transform:translate(-50%,calc(-50% + 7px))}to{opacity:.92;transform:translate(-50%,-50%)}}
.fscs.plain{background:none;border:0;-webkit-backdrop-filter:none;backdrop-filter:none;padding:0}
.fscs.light{background:rgba(255,255,255,.93);border-color:rgba(0,0,0,.07);color:#14181A;
  box-shadow:0 4px 14px -8px rgba(0,0,0,.4)}
.fscs.dark{background:rgba(9,12,14,.62);border-color:rgba(255,255,255,.14);color:#fff}
.fscs.off{display:none}
.fscs img{height:var(--prot-ico,13px);width:auto;max-width:64px;object-fit:contain;flex:none}
.fscs svg{height:var(--prot-ico,13px);width:calc(var(--prot-ico,13px) * .875);flex:none}
.fscs .fscs-copy{font-size:var(--prot-txt,11px)}
.fscs.mode-icon{padding:0;border:0;background:none;backdrop-filter:none;-webkit-backdrop-filter:none;gap:0}
.fscs.mode-icon .fscs-copy{display:none}
.fscs.mode-icon .fscs-icon{display:grid;place-items:center}
.fscs.mode-icon img{height:var(--prot-ico,13px);width:auto;max-width:none}
.fscs.mode-icon svg{height:var(--prot-ico,13px);width:var(--prot-ico,13px)}
.fscs.mode-text .fscs-icon{display:none}
.fscs.mode-text{gap:0}


/* authenticator */
.authenticator{
  position:absolute;left:50%;top:84%;right:auto;bottom:auto;
  transform:translate(-50%,-50%);
  display:flex;flex-direction:column;align-items:center;gap:10px;opacity:0
}
#stage1.run .authenticator{animation:fadeUp 800ms var(--ease) var(--auth-delay,700ms) forwards}
@keyframes fadeUp{from{opacity:0;transform:translate(-50%,calc(-50% + 6px))}to{opacity:1;transform:translate(-50%,-50%)}}

#loaderSlot{display:grid;place-items:center;min-height:34px;color:var(--auth-fg)}
.ring-wrap{position:relative;width:34px;height:34px;display:grid;place-items:center}
.ring{position:absolute;inset:0;width:34px;height:34px;animation:spin 1.15s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.ring-track{fill:none;stroke:rgba(255,255,255,.24);stroke-width:2}
.ring-arc{fill:none;stroke:var(--auth-fg);stroke-width:2;stroke-linecap:round;stroke-dasharray:30 92.5}
.pulse-wrap{position:relative;width:44px;height:44px;display:grid;place-items:center}
.pulse-wrap i{position:absolute;inset:0;border-radius:50%;border:1px solid var(--auth-fg);
  opacity:0;animation:pulseOut 2.6s var(--ease) infinite}
.pulse-wrap i:nth-child(2){animation-delay:1.3s}
@keyframes pulseOut{0%{transform:scale(.42);opacity:.55}70%{opacity:0}100%{transform:scale(1);opacity:0}}
.dots{display:flex;gap:7px;align-items:center;height:34px}
.dots i{width:6px;height:6px;border-radius:50%;background:var(--auth-fg);opacity:.35;
  animation:dotP 1.35s ease-in-out infinite}
.dots i:nth-child(2){animation-delay:.18s}
.dots i:nth-child(3){animation-delay:.36s}
@keyframes dotP{0%,100%{opacity:.3;transform:scale(.82)}45%{opacity:1;transform:scale(1)}}
.lbar{width:96px;height:2px;border-radius:2px;background:rgba(255,255,255,.22);overflow:hidden;position:relative}
.lbar i{position:absolute;top:0;bottom:0;width:38%;border-radius:2px;background:var(--auth-fg);
  animation:lbarSlide 1.5s var(--ease) infinite}
@keyframes lbarSlide{0%{left:-40%}100%{left:100%}}
.lockglyph{opacity:.95}

.auth-text{
  font-family:var(--f-body);font-size:11.5px;font-weight:500;letter-spacing:.012em;
  color:var(--auth-fg);opacity:.9;display:flex;align-items:center;gap:6px
}
.auth-sub{
  font-size:10.5px;color:var(--auth-fg);opacity:0;height:13px;letter-spacing:.01em;
  transition:opacity 520ms ease;text-align:center
}
.auth-sub.show{opacity:.55}
.auth-prog{width:118px;height:1px;background:rgba(255,255,255,.18);overflow:hidden;
  margin-top:3px;border-radius:1px}
.auth-prog i{display:block;height:100%;width:0;background:var(--auth-fg);opacity:.55;border-radius:1px}
#stage1.run .auth-prog i{animation:progFill var(--introdur,16s) linear forwards}
@keyframes progFill{from{width:0}to{width:100%}}
.auth-prog.off{display:none}

#skipZone{position:absolute;left:0;top:0;width:56px;height:56px;z-index:9}

@media (prefers-reduced-motion:reduce){
  #stage1.run #authBg,#stage1.run #authBrandSlot{animation:none}
}

/* MyBandz v19 — upload media previews */
[data-media-preview], .media-preview, .upload-preview, .asset-preview, .file-preview,
.image-preview, .preview {
  overflow: hidden;
}
[data-media-preview] img, [data-media-preview] video, [data-media-preview] audio,
.media-preview img, .media-preview video, .media-preview audio,
.upload-preview img, .upload-preview video, .upload-preview audio,
.asset-preview img, .asset-preview video, .asset-preview audio,
.file-preview img, .file-preview video, .file-preview audio {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
