/**
 * Quiz Editor splash — fullscreen / no-card, indigo→sky→coral palette.
 * Developer Boot Timeline styles live under .qm-boot--timeline (debug only).
 */

/* ─── Production: fullscreen app splash ───── */

#qm-initial-loading.qm-load {
  --qm-load-primary: #3F5EFB;
  --qm-load-secondary: #38bdf8;
  --qm-load-accent: #FF7A45;
  --qm-load-bg: #f7f9fc;
  --qm-load-bg-glow: rgba(63, 94, 251, 0.18);
  --qm-load-brand: #1e293b;
  --qm-load-msg: #64748b;
  font-family: 'Manrope', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

#qm-initial-loading.qm-load--dark {
  --qm-load-bg: #0b1020;
  --qm-load-bg-glow: rgba(63, 94, 251, 0.28);
  --qm-load-brand: #e2e8f0;
  --qm-load-msg: #94a3b8;
}

#qm-initial-loading .qm-load__inner {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#qm-initial-loading .qm-load__badge {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 80px;
  height: 80px;
}

#qm-initial-loading .qm-load__brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: none;
  line-height: 1.15;
  color: var(--qm-load-brand);
}

#qm-initial-loading .qm-load__tagline {
  margin: -4px 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

#qm-initial-loading .qm-load__msg {
  min-height: 1.35em;
  font-weight: 700;
  transition: opacity 0.28s ease;
}

#qm-initial-loading .qm-load__msg.is-fade {
  animation: qeLoadMsgIn 0.32s ease both;
}

@keyframes qeLoadMsgIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

#qm-initial-loading .qm-load__powered {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  margin: 0;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #94a3b8;
  opacity: 0.85;
}

html[data-theme='dark'] #qm-initial-loading .qm-load__powered {
  color: rgba(148, 163, 184, 0.8);
}

/* Thin progress under message (calm, app-level — not a framework bar) */
#qm-initial-loading .qm-load__bar {
  width: min(100%, 200px);
  height: 3px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(120, 113, 108, 0.14);
  overflow: hidden;
}

#qm-initial-loading .qm-load__bar-fill {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--qm-load-primary), var(--qm-load-secondary) 55%, var(--qm-load-accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--qm-load-primary) 35%, transparent);
  transition: width 0.4s ease;
}

html[data-theme='dark'] #qm-initial-loading .qm-load__bar {
  background: rgba(255, 255, 255, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  #qm-initial-loading .qm-load__msg.is-fade {
    animation: none !important;
  }
  #qm-initial-loading .qm-load__bar-fill {
    transition: none;
  }
}

/* ─── Developer Boot Timeline (debug / diagnostics only) ─ */

.qm-boot {
  --qm-boot-bg: #090e1c;
  --qm-boot-muted: rgba(168, 180, 204, 0.55);
  --qm-boot-muted-strong: rgba(196, 208, 232, 0.72);
  --qm-boot-glow: rgba(99, 140, 255, 0.45);
  --qm-boot-accent: #7da6ff;
  --qm-boot-font: 'Inter', -apple-system, system-ui, sans-serif;
  --qm-boot-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.qm-boot--boot.qm-boot--timeline {
  background-color: var(--qm-boot-bg);
  background-image: none;
  isolation: isolate;
  overflow: hidden;
  font-family: var(--qm-boot-font);
  color: #e8eefc;
}

.qm-boot--timeline .qm-boot__center {
  position: relative;
  z-index: 2;
  width: min(100%, 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qm-boot__fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.qm-boot__glow {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(72vw, 640px);
  height: min(52vw, 460px);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(99, 140, 255, 0.22) 0%, transparent 68%);
  filter: blur(28px);
}

.qm-boot__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.qm-boot__orb--a {
  width: min(42vw, 520px);
  height: min(42vw, 520px);
  left: -8%;
  top: 12%;
  background: radial-gradient(circle, rgba(91, 108, 255, 0.35), transparent 70%);
}

.qm-boot__orb--b {
  width: min(36vw, 440px);
  height: min(36vw, 440px);
  right: -6%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 70%);
}

.qm-boot__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 214, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 214, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  opacity: 0.55;
}

.qm-boot--timeline .qm-boot__mark-wrap {
  position: relative;
  margin-bottom: 14px;
}

.qm-boot--timeline .qm-boot__mark {
  font-size: clamp(4rem, 10vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, #e8eeff, #7da6ff 55%, #5b6cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #a8c0ff;
}

.qm-boot--timeline .qm-boot__sub {
  margin: 0 0 28px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(196, 208, 232, 0.55);
}

.qm-boot__capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 24px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 214, 255, 0.1);
}

.qm-boot--timeline .qm-boot__status {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(196, 208, 232, 0.85);
}

.qm-boot--timeline .qm-boot__timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: min(100%, 240px);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.qm-boot--timeline .qm-boot__tl-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(176, 190, 214, 0.45);
  opacity: 0.85;
  transition: color 0.35s ease, opacity 0.35s ease;
}

.qm-boot--timeline .qm-boot__tl-check {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: transparent;
  border-radius: 50%;
  border: 1px solid rgba(201, 214, 255, 0.18);
}

.qm-boot--timeline .qm-boot__tl-item.is-active {
  color: #f0f4ff !important;
  opacity: 1 !important;
}

.qm-boot--timeline .qm-boot__tl-item.is-active .qm-boot__tl-check {
  border-color: rgba(125, 166, 255, 0.65);
  background: rgba(125, 166, 255, 0.16);
}

.qm-boot--timeline .qm-boot__tl-item.is-done {
  color: rgba(210, 222, 245, 0.78) !important;
  opacity: 1 !important;
}

.qm-boot--timeline .qm-boot__tl-item.is-done .qm-boot__tl-check {
  color: #9ec0ff;
  border-color: transparent;
}

.qm-boot--timeline .qm-boot__progress {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.qm-boot--timeline .qm-boot__hint {
  margin: 24px 0 0;
  font-size: 0.6875rem;
  color: rgba(168, 180, 204, 0.4);
}

.qm-boot--timeline .qm-boot__footer {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-family: var(--qm-boot-mono);
  font-size: 0.6875rem;
  color: rgba(140, 152, 176, 0.4);
}

.qm-boot--timeline .qm-boot__time {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.qm-boot--timeline .qm-boot__time.is-visible,
.qm-boot--timeline .qm-boot__time[data-ready] {
  opacity: 1;
}

.qm-boot--timeline.qm-boot--out {
  animation: qmBootOut 0.42s ease-out forwards;
  pointer-events: none;
}
