/* ══════════════════════════════════════════════════════════════
   PDFForge Wizard — Multi-step builder UI
   Vibe: Dark, editorial, professional — warm off-white text on
   near-black bg. Syne display font, DM Sans body. Orange accent.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0b10;
  --card: #13131a;
  --card-hover: #1a1a24;
  --fg: #f0ede8;
  --fg-muted: #9a9aaa;
  --accent: #f97316;
  --accent-dim: rgba(249, 115, 22, 0.12);
  --border: rgba(255,255,255,0.07);
  --error: #ef4444;
  --success: #22c55e;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── NAV ── */
.wizard-nav {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.wizard-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.wizard-nav-tag {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 32px 0;
}
.progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 20%;
}
.step-labels {
  display: flex;
  justify-content: space-between;
}
.step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.step-label.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── WIZARD MAIN ── */
.wizard-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 32px 80px;
}

.step-panel {
  display: none;
}
.step-panel.active {
  display: block;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── STEP CARD ── */
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
}
.step-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.step-card h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.2;
}
.step-desc {
  color: var(--fg-muted);
  font-size: 14px;
  margin-bottom: 32px;
  font-weight: 300;
}

/* ── FORM ── */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.label-opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-muted);
  font-size: 11px;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input::placeholder { color: var(--fg-muted); opacity: 0.6; }
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}
.btn-primary:hover {
  background: #ea6c0e;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  background: rgba(249, 115, 22, 0.3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-copy {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-copy:hover { background: #ea6c0e; }
.step-note {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 12px;
}

/* ── LOADER ── */
.loader-wrap {
  text-align: center;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.loader-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-wrap p { color: var(--fg-muted); font-size: 14px; }

/* ── OUTLINE EDITOR ── */
.hidden { display: none !important; }
.outline-editor {}
.title-input {
  font-family: 'Syne', sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  margin-bottom: 24px;
  padding: 14px 18px !important;
}
.section-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.section-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.section-item input {
  background: transparent;
  border: none;
  box-shadow: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
  padding: 0;
  flex: 1;
  width: auto;
}
.section-item input:focus {
  border: none;
  box-shadow: none;
  outline: none;
}
.section-num-badge {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
}
.section-delete {
  background: none;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.section-delete:hover { color: var(--error); }
.outline-actions { margin-bottom: 24px; }
.outline-actions .btn-secondary {
  font-size: 13px;
  padding: 8px 14px;
}

/* ── CONTENT GENERATION PROGRESS ── */
.progress-section-wrap {
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.ps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.ps-header span:first-child {
  font-weight: 600;
  font-size: 14px;
}
#sectionCount {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  color: var(--fg-muted);
}
.ps-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.ps-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ffb366);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}
.content-done {
  text-align: center;
  padding: 32px 0;
}
.done-icon {
  width: 56px;
  height: 56px;
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--success);
  margin: 0 auto 20px;
}
.content-done h3 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  margin-bottom: 8px;
}
.content-done p { color: var(--fg-muted); font-size: 14px; }

/* ── CUSTOMIZE GRID ── */
.customize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 600px) { .customize-grid { grid-template-columns: 1fr; } }
.tone-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tone-btn {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.tone-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.tone-btn:hover:not(.active) { border-color: rgba(255,255,255,0.2); }
.tone-icon { font-size: 16px; }
.color-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.color-btn:hover { transform: scale(1.1); }
.color-btn.active { border-color: white; transform: scale(1.15); }

/* ── PDF PREVIEW ── */
.pdf-preview-area {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.pdf-generation-status { text-align: center; }

/* ── PUBLISH ── */
.publish-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 4px;
}
.publish-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}
.publish-tab.active {
  background: var(--accent);
  color: white;
}
.publish-panel { display: none; }
.publish-panel.active { display: block; }
.publish-hint {
  color: var(--fg-muted);
  font-size: 13px;
  margin-bottom: 20px;
}
.price-input-wrap { margin-bottom: 20px; }
.price-input-wrap label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.price-input-group {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
}
.currency-symbol {
  padding: 12px 14px;
  font-weight: 600;
  color: var(--fg-muted);
  background: rgba(255,255,255,0.04);
  border-right: 1px solid var(--border);
}
.price-input-group input {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 16px;
}
.price-input-group input:focus {
  box-shadow: none;
}
.earnings-preview {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.earning-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--fg-muted);
  padding: 4px 0;
}
.earning-row.total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 700;
  color: var(--fg);
  font-size: 16px;
}
.fee-color { color: var(--error); }
.link-result {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.link-result p { font-size: 13px; color: var(--fg-muted); margin-bottom: 12px; }
.link-copy-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.link-copy-wrap input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg-muted);
  font-size: 13px;
  font-family: 'DM Sans', monospace;
}
.link-actions { display: flex; gap: 8px; }

/* ── PDF ACTIONS ── */
.pdf-actions-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.pdf-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.pdf-action-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
.pdf-action-icon { font-size: 16px; }

/* ── MOBILE ── */
@media (max-width: 640px) {
  .progress-wrap { padding: 20px 20px 0; }
  .wizard-main { padding: 20px 20px 60px; }
  .step-card { padding: 24px; }
  .step-labels { font-size: 9px; }
  .wizard-nav { padding: 14px 20px; }
}