:root {
  --bg: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-hover: #252525;
  --text: #f0f0f0;
  --text-muted: #888;
  --accent: #4ecdc4;
  --accent-hover: #45b7d1;
  --danger: #ff6b6b;
  --success: #2ecc71;
  --border: #333;
  --radius: 12px;
}

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

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 30px 0 20px;
}
header h1 { font-size: 1.8rem; margin-bottom: 8px; }
header p { color: var(--text-muted); font-size: 1rem; }

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

/* Upload */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg-card);
}
.upload-box:hover, .upload-box.drag-over {
  border-color: var(--accent);
  background: rgba(78, 205, 196, 0.05);
}
.upload-icon { font-size: 3rem; margin-bottom: 16px; }
.upload-sub { color: var(--text-muted); margin: 12px 0; }
.upload-hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 16px; }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); }

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 0;
}
.btn-link:hover { color: var(--text); }

.btn-large { padding: 16px 32px; font-size: 1.1rem; }

.btn-subject {
  background: var(--bg-hover);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  margin: 4px;
}
.btn-subject:hover {
  border-color: var(--accent);
  background: rgba(78, 205, 196, 0.1);
}

.upload-btn { cursor: pointer; display: inline-block; }

/* Loading */
.loading-container {
  text-align: center;
  padding: 80px 0;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Subject Selection */
.select-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
}
.original-preview {
  position: relative;
  text-align: center;
  margin-bottom: 20px;
}
.original-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
}
#bbox-canvas {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.select-info { text-align: center; }
.select-info h2 { margin-bottom: 12px; color: var(--accent); }
#description-text {
  background: var(--bg);
  padding: 16px;
  border-radius: 8px;
  margin: 12px 0;
  line-height: 1.6;
  text-align: left;
}
.select-prompt {
  margin: 16px 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
}
#subject-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* Preview */
.preview-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
}
.image-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.image-wrapper {
  text-align: center;
}
.image-wrapper h3 {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.image-wrapper img {
  max-width: 100%;
  max-height: 350px;
  border-radius: 8px;
}
.checkerboard {
  background: repeating-conic-gradient(#222 0% 25%, #333 0% 50%) 50% / 20px 20px;
  border-radius: 8px;
  padding: 8px;
}

.controls { text-align: center; }

.size-selector {
  margin-bottom: 16px;
}
.size-selector label {
  font-weight: 600;
  margin-right: 8px;
}
.size-selector select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 1rem;
}

.dimensions-display, .price-display {
  margin: 8px 0;
  font-size: 1.1rem;
}
.dim-label, .price-label { color: var(--text-muted); }
.dim-value { font-weight: 600; }
.price-value {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--success);
}

.approval-buttons {
  margin: 24px 0 12px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.review-msg {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}
.review-msg p { margin-bottom: 12px; }

/* Mobile */
@media (max-width: 600px) {
  .image-comparison { grid-template-columns: 1fr; }
  header h1 { font-size: 1.4rem; }
  .upload-box { padding: 40px 20px; }
  .approval-buttons { flex-direction: column; align-items: center; }
}
