/* ── NestBuilder Wizard ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1e293b;
  background: #fafbff;
  background-image:
    radial-gradient(ellipse 600px 400px at 15% 5%, rgba(99,102,241,.12) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 85% 15%, rgba(236,72,153,.08) 0%, transparent 70%),
    radial-gradient(ellipse 600px 400px at 60% 90%, rgba(56,189,248,.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 10% 80%, rgba(168,85,247,.06) 0%, transparent 70%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* ── Wizard header bar ───────────────────────────────────────────────────── */
.wizard-header {
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.wizard-header__inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wizard-header__logo {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.02em;
}
.wizard-header__logo span { color: #6366f1; }
.wizard-header__badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.1));
  color: #6366f1;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Wizard container ───────────────────────────────────────────────────── */
.wizard {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.wizard__panel--active {
  display: block;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 8px 40px rgba(0,0,0,.04), 0 0 0 1px rgba(0,0,0,.02);
}

/* ── Progress ────────────────────────────────────────────────────────────── */
.wizard__progress {
  height: 3px;
  background: rgba(0,0,0,.04);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}
.wizard__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width .4s ease;
}
.wizard__steps {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
}
.wizard__step {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  transition: all .2s;
}
.wizard__step--active {
  color: #6366f1;
  background: rgba(99,102,241,.1);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(99,102,241,.1);
}
.wizard__step--done {
  color: #22c55e;
}

/* ── Panels ──────────────────────────────────────────────────────────────── */
.wizard__panel {
  display: none;
  animation: wizard-fade .4s ease;
}
.wizard__panel--active { display: block; }
@keyframes wizard-fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── Header ──────────────────────────────────────────────────────────────── */
.wizard__header { margin-bottom: 36px; }
.wizard__title {
  font-size: 36px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 12px; font-style: normal;
  background: linear-gradient(135deg, #0f172a 0%, #6366f1 50%, #8b5cf6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wizard__subtitle { font-size: 16px; color: #64748b; max-width: 600px; line-height: 1.7; font-style: normal; }

/* ── Form ────────────────────────────────────────────────────────────────── */
.wizard__form { display: flex; flex-direction: column; gap: 20px; }
.wizard__field { display: flex; flex-direction: column; gap: 6px; }
.wizard__field label { font-size: 14px; font-weight: 600; color: #334155; }
.wizard__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

textarea, input[type="text"], select {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.7);
  color: #0f172a;
  font-family: 'Inter', inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: #fff;
}
textarea::placeholder, input::placeholder { color: #64748b; font-style: normal; }
.wizard__field label { font-size: 13px; font-weight: 600; color: #334155; letter-spacing: .01em; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
/* ── Style grid ──────────────────────────────────────────────────────────── */
.wizard__style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wizard__style-card {
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 14px;
  cursor: pointer;
  transition: all .25s;
  text-align: center;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
}
.wizard__style-card:hover { border-color: rgba(99,102,241,.3); background: rgba(255,255,255,.9); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.wizard__style-card--selected { border-color: #6366f1; background: rgba(255,255,255,.95); box-shadow: 0 0 0 3px rgba(99,102,241,.12), 0 4px 16px rgba(99,102,241,.08); }
.wizard__style-name { display: block; font-size: 14px; font-weight: 600; color: #0f172a; margin-bottom: 2px; }
.wizard__style-desc { display: block; font-size: 11px; color: #64748b; }
@media (max-width: 640px) { .wizard__style-grid { grid-template-columns: repeat(2, 1fr); } }

.wizard__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}
.wizard__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all .25s;
  text-decoration: none;
}
.wizard__btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.wizard__btn:active { transform: translateY(0); }
.wizard__btn--primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.25);
}
.wizard__btn--primary:hover { box-shadow: 0 6px 28px rgba(99,102,241,.4); }
.wizard__btn--secondary {
  background: #fff;
  color: #334155;
  border: 1.5px solid #e2e8f0;
}
.wizard__btn--secondary:hover { background: #f8fafc; border-color: #cbd5e1; }
.wizard__btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Section list ────────────────────────────────────────────────────────── */
.wizard__customize { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.wizard__customize h3 { font-size: 15px; margin-bottom: 12px; color: #334155; }
.wizard__section-list { display: flex; flex-direction: column; gap: 6px; min-height: 200px; }

.wizard__section-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.wizard__section-item:hover { border-color: #6366f1; background: rgba(99,102,241,.04); }
.wizard__section-item--selected { background: rgba(99,102,241,.06); border-color: #6366f1; }
.wizard__section-item__name { flex: 1; font-weight: 500; color: #1e293b; }
.wizard__section-item__toggle {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 2px solid #d1d5db;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}
.wizard__section-item--selected .wizard__section-item__toggle {
  background: #6366f1;
  border-color: #6366f1;
}
.wizard__section-item__cat { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }

/* ── Colors ───────────────────────────────────────────────────────────────── */
.wizard__colors { margin-bottom: 24px; }
.wizard__colors h3 { font-size: 15px; margin-bottom: 12px; color: #334155; }
.wizard__color-row { display: flex; gap: 12px; flex-wrap: wrap; }
.wizard__color-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.wizard__color-picker-wrap { cursor: pointer; position: relative; display: block; }
.wizard__color-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.wizard__color-dot {
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,.08);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  transition: transform .15s, box-shadow .15s;
}
.wizard__color-picker-wrap:hover .wizard__color-dot { transform: scale(1.1); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.wizard__color-label { font-size: 11px; color: #64748b; }

/* ── Preview ─────────────────────────────────────────────────────────────── */
.wizard__preview {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  min-height: 400px;
  box-shadow: 0 4px 24px rgba(0,0,0,.04);
}
.wizard__preview-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 80px 24px;
  color: #64748b;
}
.wizard__preview-section {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.wizard__preview-section:last-child { border-bottom: none; }
.wizard__preview-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wizard__preview-section__name { font-size: 14px; font-weight: 600; color: #6366f1; }
.wizard__preview-section__edit {
  font-size: 12px; color: #64748b; cursor: pointer;
  padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 6px;
  background: none; transition: all .15s;
}
.wizard__preview-section__edit:hover { border-color: #6366f1; color: #6366f1; }
.wizard__preview-section__content { font-size: 14px; color: #475569; line-height: 1.6; }
.wizard__preview-section__content h3 { font-size: 16px; margin-bottom: 4px; color: #0f172a; }
.wizard__preview-section__content p { margin-bottom: 8px; }

/* ── Launch ───────────────────────────────────────────────────────────────── */
.wizard__success-icon { margin-bottom: 16px; }
.wizard__launch-actions { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.wizard__tips { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; }
.wizard__tips h3 { font-size: 16px; margin-bottom: 12px; color: #0f172a; }
.wizard__tips ul { margin-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.wizard__tips li { font-size: 14px; color: #475569; list-style: disc; }

/* ── Loading overlay ─────────────────────────────────────────────────────── */
.wizard__loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(255,255,255,.5);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: none;
  align-items: center; justify-content: center;
}
.wizard__loading-overlay--visible { display: flex; }
.wizard__loading-card {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.wizard__loading-card h3 { font-size: 18px; margin: 16px 0 8px; color: #0f172a; }
.wizard__loading-card p { font-size: 14px; color: #64748b; margin-bottom: 24px; }

.wizard__spinner {
  width: 40px; height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: wizard-spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes wizard-spin { to { transform: rotate(360deg); } }

.wizard__loading-steps { text-align: left; }
.wizard__loading-step {
  font-size: 13px;
  color: #94a3b8;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wizard__loading-step::before {
  content: '';
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}
.wizard__loading-step--active { color: #6366f1; font-weight: 600; }
.wizard__loading-step--active::before { border-color: #6366f1; border-top-color: transparent; animation: wizard-spin .7s linear infinite; }
.wizard__loading-step--done { color: #22c55e; }
.wizard__loading-step--done::before { background: #22c55e; border-color: #22c55e; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .wizard { padding: 24px 16px 60px; }
  .wizard__title { font-size: 22px; }
  .wizard__row { grid-template-columns: 1fr; }
  .wizard__customize { grid-template-columns: 1fr; }
  .wizard__steps { overflow-x: auto; flex-wrap: nowrap; }
  .wizard__actions { flex-direction: column; }
  .wizard__btn { width: 100%; justify-content: center; }
}
