/* =============================================================================
   SkyWalk Setup Wizard
   Mirrors the tutorial overlay structure; wizard-prefixed so no collisions.
   ============================================================================= */

/* ── Backdrop ───────────────────────────────────────────────────────────────── */
#wiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 34, 0.86);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 99998;               /* one below tutorial (99999) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.32s ease;
}
#wiz-overlay.wiz-visible { opacity: 1; }

/* ── Modal card ─────────────────────────────────────────────────────────────── */
#wiz-modal {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.48);
  width: min(760px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
#wiz-modal * { box-sizing: border-box; }

/* ── Progress bar ───────────────────────────────────────────────────────────── */
#wiz-progress-bar {
  height: 4px;
  background: #e4eaf0;
  flex-shrink: 0;
}
#wiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #006280, #00b4d8);
  transition: width 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 3px 3px 0;
}

/* ── Step dots ──────────────────────────────────────────────────────────────── */
#wiz-step-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 12px 12px 0;
  flex-shrink: 0;
}
.wiz-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d0d8e4;
  cursor: pointer;
  transition: background 0.22s, transform 0.18s;
}
.wiz-dot.active  { background: #006280; transform: scale(1.35); }
.wiz-dot.done    { background: #7dc9d8; }
.wiz-dot:hover:not(.active) { background: #5ab8cc; transform: scale(1.15); }

/* ── Slide area ─────────────────────────────────────────────────────────────── */
#wiz-slide-area {
  flex: 1;
  overflow-y: auto;
  padding: 18px 30px 10px;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
#wiz-slide-area.wiz-slide-out { opacity: 0; transform: translateX(18px); }
#wiz-slide-area.wiz-slide-in  { opacity: 0; transform: translateX(-18px); }

.wiz-slide-icon {
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 6px;
}
.wiz-slide-title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0d2a40;
  margin: 0 0 6px;
}
.wiz-slide-sub {
  text-align: center;
  color: #4a6070;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 18px;
}

/* ── Field group ────────────────────────────────────────────────────────────── */
.wiz-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}
.wiz-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.wiz-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2a4050;
  letter-spacing: 0.3px;
}
.wiz-input,
.wiz-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ccd8e0;
  border-radius: 9px;
  font-size: 0.93rem;
  color: #1a2e3a;
  background: #f7fafc;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
  appearance: auto;
}
.wiz-input:focus,
.wiz-select:focus {
  border-color: #006280;
  background: #f0fafd;
  box-shadow: 0 0 0 3px rgba(0, 98, 128, 0.12);
}
.wiz-input[type="number"] { text-align: left; }
.wiz-multi {
  min-height: 160px;
  border-radius: 9px;
}
.wiz-note {
  font-size: 0.76rem;
  color: #7a9aaa;
  margin: 2px 0 0;
  line-height: 1.4;
}

/* ── Review grid ────────────────────────────────────────────────────────────── */
.wiz-review-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 540px;
  margin: 0 auto;
  max-height: 340px;
  overflow-y: auto;
  border: 1.5px solid #e0eaf0;
  border-radius: 10px;
  padding: 10px 14px;
  background: #f8fbfc;
}
.wiz-review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #eaf0f4;
  font-size: 0.84rem;
}
.wiz-review-row:last-child { border-bottom: none; }
.wiz-review-label {
  color: #4a6070;
  flex: 0 0 48%;
  font-weight: 500;
}
.wiz-review-val {
  flex: 1;
  text-align: right;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 52%;
}
.wiz-ok    { color: #1a6e40; }
.wiz-empty { color: #b0bec5; font-weight: 400; font-style: italic; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
#wiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid #e8eef4;
  background: #f7fafc;
  flex-shrink: 0;
  flex-wrap: wrap;
}
#wiz-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
#wiz-counter {
  font-size: 0.82rem;
  color: #8da8b8;
  min-width: 42px;
  text-align: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.wiz-btn {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.90rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, opacity 0.18s;
  border: none;
  outline: none;
  white-space: nowrap;
}
.wiz-btn:disabled { opacity: 0.32; cursor: default; pointer-events: none; }

.wiz-btn-ghost {
  background: transparent;
  color: #8da8b8;
  border: 1.5px solid #ccd8e0;
}
.wiz-btn-ghost:hover { background: #f0f4f8; color: #4a6070; }

.wiz-btn-outline {
  background: #fff;
  color: #006280;
  border: 1.5px solid #006280;
}
.wiz-btn-outline:hover { background: #e8f6fa; }

.wiz-btn-primary {
  background: linear-gradient(135deg, #006280, #00a8c8);
  color: #fff;
  border: none;
}
.wiz-btn-primary:hover { background: linear-gradient(135deg, #004e66, #0090aa); }

.wiz-btn-finish {
  background: linear-gradient(135deg, #1a7a44, #20c060) !important;
  color: #fff !important;
}
.wiz-btn-finish:hover { background: linear-gradient(135deg, #155e34, #18a050) !important; }

/* ── Finish spinner overlay (inside modal) ──────────────────────────────────── */
#wiz-finish-spinner {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  z-index: 10;
}
.wiz-spinner-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #006280;
  font-size: 0.95rem;
  font-weight: 600;
}
.wiz-spinner-ring {
  width: 52px;
  height: 52px;
  border: 5px solid #c8e8f0;
  border-top-color: #006280;
  border-radius: 50%;
  animation: wiz-spin 0.9s linear infinite;
}
@keyframes wiz-spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #wiz-modal { width: 100vw; max-height: 100dvh; border-radius: 0; }
  #wiz-overlay { align-items: flex-end; padding: 0; }
  #wiz-slide-area { padding: 14px 16px 8px; }
  .wiz-slide-title { font-size: 1.1rem; }
  .wiz-slide-sub   { font-size: 0.83rem; }
  .wiz-fields { gap: 10px; }
  .wiz-btn { padding: 9px 14px; font-size: 0.84rem; }
  #wiz-footer { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
  #wiz-nav { justify-content: space-between; width: 100%; }
  #wiz-cancel-btn { width: 100%; text-align: center; }
  .wiz-review-grid { max-height: 220px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  #wiz-slide-area { padding: 8px 20px; }
  .wiz-slide-icon { font-size: 1.5rem; margin-bottom: 2px; }
  .wiz-slide-title { font-size: 1rem; margin-bottom: 4px; }
  .wiz-multi { min-height: 90px; }
  .wiz-review-grid { max-height: 140px; }
}
