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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --border: #2a2a2a;
  --text: #e5e5e5;
  --text-muted: #888;
  --primary: #7c3aed;
  --primary-hover: #8b5cf6;
  --success: #22c55e;
  --error: #ef4444;
}

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

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text);
}

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.hero p {
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature {
  text-align: center;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.feature p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Form */
.form-container {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 2rem;
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Chip buttons */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-group-small {
  gap: 0.4rem;
}

.chip {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--text);
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.chip-sub {
  opacity: 0.6;
  font-size: 0.75em;
  margin-left: 0.25em;
}

.chip.selected .chip-sub {
  opacity: 0.8;
}

.chip-group-small .chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.form-actions {
  margin-top: 2rem;
  text-align: center;
}

/* Status Panel */
.status-panel {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.status-panel h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.status-panel.hidden {
  display: none;
}

.job-id {
  font-family: monospace;
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.step-list {
  list-style: none;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.step-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.step-status.completed {
  background: var(--success);
}

.step-status.running {
  background: var(--primary);
  animation: pulse 1s infinite;
}

.step-status.failed {
  background: var(--error);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.download-links {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.download-links {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.download-links h3 {
  color: var(--success);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.download-links .file-link {
  display: block;
  color: var(--primary);
  padding: 0.5rem 0;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.download-links .file-link:last-child {
  border-bottom: none;
}

.download-links .file-link:hover {
  color: var(--primary-hover);
}

.success {
  color: var(--success);
}

.error {
  color: var(--error);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* Legal Pages */
.legal-page header {
  margin-bottom: 2rem;
}

.legal-page header h1 {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  color: var(--text);
}

.legal-content {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 2rem;
}

.legal-content .last-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.legal-content section {
  margin-bottom: 2rem;
}

.legal-content section:last-child {
  margin-bottom: 0;
}

.legal-content h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.legal-content h3 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.legal-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.legal-content ul,
.legal-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.legal-content a {
  color: var(--primary);
  text-decoration: none;
}

.legal-content a:hover {
  text-decoration: underline;
}

.legal-content .contact-list {
  list-style: none;
  margin-left: 0;
}

.warning-banner {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  color: #fbbf24;
}

/* Subtitle */
.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.25rem;
}

.section-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Pricing Cards */
.pricing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pricing-card {
  position: relative;
  padding: 1.5rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.pricing-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.pricing-card:hover {
  border-color: var(--primary);
}

.pricing-card.selected {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
}

.pricing-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.pricing-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pricing-details {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.pricing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pricing-features span {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.price-summary {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.price-summary span {
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
}

/* Checkout Page */
.checkout-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.order-summary {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.order-summary h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.order-details {
  margin-bottom: 1rem;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.order-item:last-child {
  border-bottom: none;
}

.order-label {
  color: var(--text-muted);
}

.order-value {
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
}

.total-price {
  color: var(--primary);
  font-size: 1.5rem;
}

.checkout-form {
  background: var(--surface);
}

/* Stripe Element */
.stripe-element {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.card-errors {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  min-height: 1.25rem;
}

/* Checkbox for terms agreement */
.checkbox-group {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label a {
  color: var(--primary);
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

.checkout-notice {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.checkout-notice p {
  margin-bottom: 0.5rem;
}

.checkout-notice p:last-child {
  margin-bottom: 0;
}

.secure-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
}

.secure-notice svg {
  flex-shrink: 0;
}

/* Progress Tracker */
.progress-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: 8px;
}

.progress-step.completed {
  opacity: 0.6;
}

.progress-step.running {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid var(--primary);
}

.step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.step-icon.done {
  background: var(--success);
  color: white;
}

.step-icon.running {
  background: var(--primary);
  animation: pulse 1s infinite;
}

.step-icon.pending {
  background: var(--border);
}

.step-name {
  font-size: 0.9rem;
}

.job-id-small {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Download Buttons */
.download-all-btn {
  width: 100%;
  margin-bottom: 1rem;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
}

.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.download-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.download-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.download-icon {
  font-size: 1.5rem;
}

/* Success/Error Banners */
.success-banner {
  text-align: center;
  padding: 2rem;
}

.success-banner .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.success-banner h3 {
  color: var(--success);
  margin-bottom: 0.5rem;
}

.error-banner {
  text-align: center;
  padding: 2rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.error-banner h3 {
  color: var(--error);
  margin-bottom: 0.5rem;
}

.post-download {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-download p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

/* Processing Spinner */
.processing-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Book Preview */
.book-preview {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.cover-preview {
  flex-shrink: 0;
}

.cover-preview img {
  max-width: 160px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.book-details {
  flex: 1;
  min-width: 0;
}

.book-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.book-tagline {
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.book-synopsis {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  max-height: 120px;
  overflow: hidden;
}

/* KDP Section */
.kdp-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.kdp-section h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text);
}

.kdp-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.kdp-field {
  margin-bottom: 1.25rem;
}

.kdp-field:last-child {
  margin-bottom: 0;
}

.kdp-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.kdp-value {
  color: var(--text);
  font-size: 0.95rem;
}

.kdp-sub-value {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.kdp-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.kdp-keyword {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 16px;
  font-size: 0.85rem;
  color: var(--text);
}

.kdp-synopsis {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.copy-btn.copied {
  background: var(--success, #22c55e);
  border-color: var(--success, #22c55e);
}

/* Order Summary Mini (shown during progress) */
.order-summary-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.order-summary-mini .summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.order-summary-mini .summary-row:last-child {
  border-bottom: none;
}

.order-summary-mini .summary-row span:first-child {
  color: var(--text-muted);
}

.order-summary-mini .summary-row span:last-child {
  color: var(--text);
  text-align: right;
  max-width: 60%;
}

.order-summary-mini .concept-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 2rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .pricing-cards {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    padding: 1.25rem;
  }

  .pricing-price {
    font-size: 2rem;
  }

  .order-value {
    max-width: 50%;
  }

  .book-preview {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cover-preview img {
    max-width: 140px;
  }

  .book-synopsis {
    max-height: 100px;
  }

  .deliverables-list li {
    padding: 0.75rem;
  }

  .deliverable-icon {
    font-size: 1.25rem;
  }
}

/* Deliverables Section */
.deliverables {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.deliverables h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.deliverables-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.deliverables-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.deliverables-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.deliverables-list li:first-child {
  padding-top: 0;
}

.deliverable-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.deliverables-list strong {
  display: block;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.deliverables-list span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.deliverable-note {
  display: block;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(234, 179, 8, 0.1);
  border-left: 3px solid rgba(234, 179, 8, 0.5);
  border-radius: 0 4px 4px 0;
  font-size: 0.8rem;
  color: #fbbf24;
}

/* Homepage Deliverables */
.deliverables-home {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 2rem;
  margin-top: 3rem;
}

.deliverables-home h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.deliverables-home .deliverables-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.deliverables-home .deliverables-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.deliverables-home .deliverables-list li:first-child,
.deliverables-home .deliverables-list li:last-child {
  padding: 1.25rem;
}

.deliverables-home .deliverable-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.deliverables-home .deliverables-list strong {
  font-size: 1rem;
}

.deliverables-home .deliverables-list > li > div {
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .deliverables-home .deliverables-list {
    grid-template-columns: 1fr;
  }
}
