:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #22222f;
  --border: #2e2e40;
  --purple: #6B21A8;
  --purple-light: #9333ea;
  --orange: #F97316;
  --orange-light: #fb923c;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #55556a;
  --success: #22c55e;
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* HEADER */
.header {
  background: linear-gradient(135deg, #1a0a2e 0%, #1a1a24 100%);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.logo-pixel { color: var(--purple-light); }
.logo-bloom { color: var(--orange); }
.tagline { color: var(--text-muted); font-size: 0.875rem; }

/* WIZARD CONTAINER */
.wizard-container {
  max-width: 860px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

/* PROGRESS */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--orange));
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 20%;
}

.step-indicators {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}
.step-indicators::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: default;
  z-index: 1;
}
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.step-label { font-size: 0.7rem; color: var(--text-dim); }
.step-dot.active .step-num {
  background: linear-gradient(135deg, var(--purple), var(--orange));
  border-color: transparent;
  color: white;
}
.step-dot.active .step-label { color: var(--text); }
.step-dot.done .step-num {
  background: var(--purple);
  border-color: transparent;
  color: white;
}

/* STEPS */
.step { display: none; }
.step.active { display: block; }

.step-header { margin-bottom: 1.75rem; }
.step-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}
.step-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.4rem; }
.step-header p { color: var(--text-muted); font-size: 0.9rem; }

/* FORM */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field.full { grid-column: 1 / -1; }

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}
.req { color: var(--orange); }

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple-light);
}
select option { background: var(--surface); }
::placeholder { color: var(--text-dim); }

/* CERTIFICATIONS */
.certif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.certif-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.certif-card:hover { border-color: var(--purple-light); }
.certif-card input[type="checkbox"] { margin-top: 3px; accent-color: var(--purple); }
.certif-card:has(input:checked) {
  border-color: var(--purple);
  background: rgba(107, 33, 168, 0.1);
}
.certif-name { font-weight: 700; font-size: 0.9rem; }
.certif-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

/* SPIN BLOCKS */
.spin-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  border-left: 4px solid;
}
.spin-s { border-left-color: #3b82f6; }
.spin-p { border-left-color: #f59e0b; }
.spin-i { border-left-color: #ef4444; }
.spin-n { border-left-color: #22c55e; }

.spin-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.spin-letter {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
}
.spin-s .spin-letter { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.spin-p .spin-letter { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.spin-i .spin-letter { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.spin-n .spin-letter { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.spin-label strong { display: block; font-size: 0.9rem; }
.spin-label span { font-size: 0.8rem; color: var(--text-muted); }

.spin-block textarea {
  width: 100%;
  background: var(--surface2);
  border-color: var(--border);
}

/* GENERATE SECTION */
.generate-section {
  margin-top: 2rem;
  text-align: center;
}
.btn-generate {
  background: linear-gradient(135deg, var(--purple), var(--orange));
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(107, 33, 168, 0.4);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(107, 33, 168, 0.5); }
.btn-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-icon { font-size: 1.1rem; }
.generate-hint { margin-top: 0.75rem; color: var(--text-muted); font-size: 0.85rem; }

/* NAVIGATION */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.btn-next {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  transition: opacity 0.2s;
}
.btn-next:hover { opacity: 0.85; }
.btn-prev {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn-prev:hover { border-color: var(--text-muted); color: var(--text); }

/* RESULT */
.result-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
  white-space: pre-wrap;
  max-height: 60vh;
  overflow-y: auto;
}
.result-content h1, .result-content h2, .result-content h3 {
  color: var(--orange-light);
  margin: 1rem 0 0.5rem;
}
.result-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.btn-pdf {
  background: linear-gradient(135deg, var(--purple), var(--orange));
  color: white;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}
.btn-pdf:hover { transform: translateY(-2px); }
.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  border-radius: 50px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

/* LOADING */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 19, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.loading-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 3rem;
  text-align: center;
  max-width: 380px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--purple-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.4rem; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: 1; }
  .certif-grid { grid-template-columns: 1fr; }
  .step-label { display: none; }
  .header { flex-direction: column; gap: 0.4rem; text-align: center; }
}
