/* ── Onboarding Wizard ── */

/* Hide generator when wizard is active */
body.wizard-active .main-layout,
body.wizard-active .topbar { display: none !important; }
body.wizard-active { overflow: hidden; }

.wiz-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); overflow-y: auto;
  display: flex; flex-direction: column;
}

/* ── Progress ── */
.wiz-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--border-light); z-index: 202;
}
.wiz-progress-bar {
  height: 100%; width: 25%; background: var(--accent);
  transition: width 0.35s ease;
}

/* ── Dots ── */
.wiz-dots {
  display: flex; justify-content: center; gap: 8px;
  padding: 24px 0 0;
}
.wiz-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: background 0.25s ease;
  cursor: pointer;
}
.wiz-dot.active { background: var(--accent); }

/* ── Steps ── */
.wiz-step {
  display: none; flex: 1;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 20px 100px;
  animation: wizFadeIn 0.3s ease;
}
.wiz-step.active { display: flex; }

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

.wiz-step-content {
  max-width: 600px; width: 100%; text-align: center;
}
.wiz-step-content h2 {
  font-size: 22px; font-weight: 700; color: var(--text);
  margin: 0 0 8px; line-height: 1.3;
}
.wiz-step-content p {
  font-size: 15px; color: var(--text-secondary);
  margin: 0 0 28px; line-height: 1.5;
}

/* ── Cards (2-col grid) ── */
.wiz-cards {
  display: grid; gap: 12px;
}
.wiz-cards-2col { grid-template-columns: 1fr 1fr; }

.wiz-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 12px; border: 2px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  background: var(--bg); transition: all 0.2s ease;
  text-align: center; gap: 10px;
  -webkit-tap-highlight-color: transparent;
}
.wiz-card:active { transform: scale(0.97); }
.wiz-card:hover { border-color: var(--accent-border); }
.wiz-card.selected {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 1px var(--accent);
}

.wiz-card-preview {
  width: 100%; aspect-ratio: 4/3; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
}
.wiz-card-preview img {
  width: 100%; height: 100%; object-fit: cover;
}

.wiz-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-subtle); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wiz-card-icon svg { width: 22px; height: 22px; }

.wiz-card-label {
  font-size: 15px; font-weight: 600; color: var(--text);
  line-height: 1.3;
}
.wiz-card-desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.4; margin-top: 2px;
}

/* ── Preset Grid (auto-fill) ── */
.wiz-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; text-align: left;
}
.wiz-preset-card {
  border: 2px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; background: var(--bg);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.wiz-preset-card:active { transform: scale(0.97); }
.wiz-preset-card:hover { border-color: var(--accent-border); }
.wiz-preset-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.wiz-preset-card-img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  display: block; background: var(--bg-alt);
}
.wiz-preset-card-name {
  padding: 8px 10px; font-size: 13px; font-weight: 500;
  color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── Upload Zone ── */
.wiz-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 48px 24px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; transition: border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.wiz-upload-zone:hover,
.wiz-upload-zone.drag-over {
  border-color: var(--accent); background: var(--accent-subtle);
}
.wiz-upload-zone-icon {
  width: 48px; height: 48px; color: var(--text-muted);
}
.wiz-upload-zone-label {
  font-size: 15px; font-weight: 500; color: var(--text);
}
.wiz-upload-zone-hint {
  font-size: 13px; color: var(--text-muted);
}

.wiz-upload-preview {
  margin-top: 16px; position: relative;
  display: inline-block;
}
.wiz-upload-preview img {
  max-height: 200px; max-width: 100%;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.wiz-upload-preview-remove {
  position: absolute; top: -8px; right: -8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--text); color: #fff; border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; line-height: 1;
}

/* ── Navigation Bar ── */
.wiz-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  padding: 16px 20px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; z-index: 201;
}
.wiz-nav-back {
  padding: 12px 16px; border-radius: var(--radius);
  background: none; border: 1.5px solid var(--border);
  font-size: 15px; font-weight: 500; color: var(--text);
  cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.wiz-nav-back:hover { border-color: var(--text-secondary); }

.wiz-nav-next {
  flex: 1; padding: 14px; border-radius: var(--radius);
  background: var(--accent); color: #fff; border: none;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.wiz-nav-next:hover { background: var(--accent-hover); }
.wiz-nav-next:disabled { opacity: 0.5; cursor: default; }


/* ── Desktop ── */
@media (min-width: 769px) {
  .wiz-step-content { max-width: 700px; }
  .wiz-step-content h2 { font-size: 28px; }
  .wiz-step-content p { font-size: 16px; }
  .wiz-preset-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .wiz-card { padding: 24px 16px; }
  .wiz-nav {
    position: static; max-width: 700px; width: 100%;
    margin: 0 auto; border-top: none; padding: 20px 0 32px;
  }
}

/* ── Small phones ── */
@media (max-width: 380px) {
  .wiz-cards-2col.wiz-cards-furniture { grid-template-columns: 1fr; }
  .wiz-preset-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
