/* ═══════════════════════════════════════════════════════════════════════════
   SnajuOS — first-boot Setup Wizard + premium auth screens.
   Full-screen ambient wallpaper, dark scrim, glass card, animated logo mark.
   Depends on app.css for base tokens/components; this layers the immersive shell.
   ═══════════════════════════════════════════════════════════════════════════ */

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
}

/* Ambient wallpaper + dark gradient scrim. */
.stage::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background-image: url("/assets/wallpaper.jpg");
  background-size: cover; background-position: center;
  transform: scale(1.06);
  animation: driftBg 40s ease-in-out infinite alternate;
}
.stage::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(90% 80% at 50% 0%, rgba(10,14,20,.35), rgba(10,14,20,.82) 70%),
    linear-gradient(180deg, rgba(10,14,20,.55), rgba(10,14,20,.9));
}
@keyframes driftBg {
  0%   { transform: scale(1.06) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.5%, -1.5%); }
}

/* Floating, glowing brand mark. */
.mark-halo { position: relative; display: inline-flex; }
.mark-halo::after {
  content: ""; position: absolute; inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.45), transparent 62%);
  filter: blur(10px);
  animation: haloPulse 3.6s ease-in-out infinite;
  z-index: -1;
}
.mark-halo img, .mark-halo .logo {
  border-radius: 22px;
  animation: floatMark 6s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(34,211,238,.25), 0 18px 48px rgba(0,0,0,.6);
}
@keyframes floatMark { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes haloPulse { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: .95; transform: scale(1.08); } }

/* The glass card. */
.wizard {
  position: relative; z-index: 2;
  width: 100%; max-width: 560px;
  background: rgba(17, 23, 33, 0.62);
  border: 1px solid var(--border-2);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  overflow: hidden;
}
.wizard.narrow { max-width: 440px; }

.wiz-head {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 28px 0;
}
.wiz-head .mark-halo img, .wiz-head .mark-halo .logo { width: 46px; height: 46px; border-radius: 13px; }
.wiz-head .wm { display: flex; flex-direction: column; line-height: 1.05; }
.wiz-head .wm .name {
  font-weight: 700; font-size: 20px; letter-spacing: .2px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.wiz-head .wm .sub { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; margin-top: 3px; }

/* Step progress indicator (segments). */
.steps {
  display: flex; gap: 8px; padding: 22px 28px 4px;
  list-style: none; margin: 0;
}
.steps li {
  flex: 1; display: flex; flex-direction: column; gap: 7px;
  font-size: 10.5px; letter-spacing: .5px; color: var(--muted-2);
  text-transform: uppercase; font-weight: 600;
  transition: color .3s;
}
.steps li .seg { height: 4px; border-radius: 3px; background: rgba(255,255,255,.1); transition: background .4s, box-shadow .4s; }
.steps li.done .seg { background: linear-gradient(90deg, rgba(34,211,238,.6), rgba(52,211,153,.6)); }
.steps li.current { color: var(--accent); }
.steps li.current .seg { background: var(--grad); box-shadow: 0 0 12px rgba(34,211,238,.6); }
.steps li .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Step panels with fade/slide transitions. */
.wiz-body { padding: 20px 28px 28px; position: relative; }
.step { display: none; animation: stepIn .45s cubic-bezier(.22,1,.36,1); }
.step.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.step h2 { margin: 6px 0 8px; font-size: 24px; letter-spacing: -.4px; }
.step h2.big { font-size: 34px; }
.step .lead { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.step .gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* Welcome hero mark. */
.welcome-mark { display: flex; justify-content: center; margin: 6px 0 22px; }
.welcome-mark .mark-halo img, .welcome-mark .mark-halo .logo { width: 96px; height: 96px; border-radius: 26px; }

.wiz-actions { display: flex; gap: 12px; margin-top: 26px; }
.wiz-actions .btn { flex: 1; justify-content: center; }
.wiz-actions .btn.ghost { flex: 0 0 auto; }

.detected {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 16px;
  padding: 16px 18px; border-radius: 13px;
  background: rgba(0,0,0,.28); border: 1px solid var(--border);
  font-size: 14px; margin-bottom: 6px;
}
.detected dt { color: var(--muted); }
.detected dd { margin: 0; }
.detected dd.mono { font-family: var(--mono); }

/* Password strength meter. */
.strength { margin-top: -8px; margin-bottom: 16px; }
.strength .track { height: 5px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.strength .track > span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .3s, background .3s; background: var(--red); }
.strength.s1 .track > span { width: 25%; background: #f87171; }
.strength.s2 .track > span { width: 50%; background: #fbbf24; }
.strength.s3 .track > span { width: 75%; background: #2dd4bf; }
.strength.s4 .track > span { width: 100%; background: var(--accent-3); }
.strength .label { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Provisioning / boot animation. */
.provision { text-align: center; padding: 12px 0 6px; }
.provision .mark-halo { margin: 6px auto 26px; }
.provision .mark-halo img, .provision .mark-halo .logo { width: 84px; height: 84px; border-radius: 22px; }
.provision .p-status { font-size: 17px; font-weight: 600; min-height: 24px; color: var(--text); transition: opacity .3s; }
.provision .p-sub { color: var(--muted); font-size: 13px; margin-top: 6px; min-height: 18px; }

.progress {
  height: 6px; border-radius: 4px; background: rgba(255,255,255,.08);
  overflow: hidden; margin: 26px auto 0; max-width: 420px;
}
.progress > span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--grad); box-shadow: 0 0 14px rgba(34,211,238,.55); transition: width .5s ease; }

/* Indeterminate shimmer bar (used on boot splash + provisioning fallback). */
.indeterminate { position: relative; height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.indeterminate::before {
  content: ""; position: absolute; top: 0; left: -40%; height: 100%; width: 40%;
  background: var(--grad); border-radius: 4px; box-shadow: 0 0 14px rgba(34,211,238,.6);
  animation: sweep 1.5s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes sweep { 0% { left: -45%; } 100% { left: 105%; } }

/* Success checkmark. */
.success-mark {
  width: 84px; height: 84px; margin: 4px auto 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(52,211,153,.22), rgba(52,211,153,.05));
  box-shadow: inset 0 0 0 2px rgba(52,211,153,.5), 0 0 30px rgba(52,211,153,.35);
}
.success-mark svg { width: 42px; height: 42px; }
.success-mark svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .7s .15s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.url-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 13px;
  background: rgba(0,0,0,.28); border: 1px solid var(--border);
  margin-bottom: 12px; text-align: left;
}
.url-card .u-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(34,211,238,.18), rgba(52,211,153,.1)); color: var(--accent); }
.url-card .u-ico svg { width: 20px; height: 20px; }
.url-card .u-body { min-width: 0; }
.url-card .u-body small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; }
.url-card .u-body .u-val { font-family: var(--mono); font-size: 14px; word-break: break-all; }

/* Auth (login) uses .wizard.narrow with its own compact body. */
.wiz-foot-note { color: var(--muted-2); font-size: 12px; margin-top: 16px; text-align: center; }

/* JS-disabled fallback: reveal all steps stacked, hide chrome. */
.no-js .step { display: block; border-top: 1px solid var(--border); padding-top: 20px; margin-top: 8px; }
.no-js .steps, .no-js .wiz-actions { display: none; }
.no-js .step.provision-step { display: none; }
.no-js .nojs-submit { display: flex; }
.nojs-submit { display: none; margin-top: 24px; }

@media (max-width: 560px) {
  .wizard { border-radius: 20px; }
  .steps li .lbl { display: none; }
  .step h2.big { font-size: 28px; }
  .wiz-actions { flex-direction: column-reverse; }
}
