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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #ffffff;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 5vh;
}

.step {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  max-width: 700px;
  width: 100%;
}

.step.active {
  display: flex;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #222;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #222;
}

p {
  color: #666;
  margin-bottom: 1rem;
  text-align: center;
}

/* Drop Zone */
#drop-zone {
  position: relative;
  width: 100%;
  max-width: 500px;
  border: 2px dashed #ccc;
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 1rem;
}

#drop-zone:hover,
#drop-zone.dragover {
  border-color: #6c63ff;
  background: rgba(108, 99, 255, 0.05);
}

#drop-zone svg {
  color: #bbb;
  margin-bottom: 1rem;
}

#drop-zone p {
  color: #666;
}

#drop-zone .formats {
  font-size: 0.8rem;
  color: #999;
}

#file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #999;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot.loading {
  background: #f0ad4e;
  animation: pulse 1.5s infinite;
}

.dot.ready {
  background: #5cb85c;
  animation: none;
}

.dot.error {
  background: #d9534f;
  animation: none;
}

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

/* Background removal spinner */
.bg-removal-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Progress */
.progress-section {
  width: 100%;
  max-width: 400px;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: #6c63ff;
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
}

#bg-progress-text {
  font-size: 0.85rem;
  color: #666;
}

/* Crop */
#crop-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#crop-container {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
  margin-bottom: 1rem;
}

#crop-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#crop-canvas:active {
  cursor: grabbing;
}

.crop-controls {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.crop-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
}

.crop-controls input[type="range"] {
  flex: 1;
  accent-color: #6c63ff;
  height: 4px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 12px 32px;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #5a52d5;
}

.btn-primary.btn-disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-primary.btn-disabled:hover {
  background: #ccc;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 24px;
  background: transparent;
  color: #666;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: #999;
  color: #333;
}

/* Spinner */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #e0e0e0;
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}

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

.hint {
  font-size: 0.85rem;
  color: #999;
}

/* Generating progress bar */
.generating-progress-section {
  width: 100%;
  max-width: 400px;
  margin-top: 1.5rem;
}

/* Result */
#result-container {
  max-width: 500px;
  width: 100%;
  margin-bottom: 1.5rem;
  text-align: center;
}

#result-preview {
  width: 400px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Email form */
.email-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.email-form input[type="email"] {
  padding: 12px 16px;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  width: 300px;
  outline: none;
  transition: border-color 0.2s;
}

.email-form input[type="email"]:focus {
  border-color: #6c63ff;
}

.error-text {
  color: #d9534f;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.confirmation-text {
  color: #5cb85c;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.step-description {
  color: #666;
  font-size: 1rem;
  margin-bottom: 1rem;
}
