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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1c1c1c;
  --border: #262626;
  --border-subtle: #1e1e1e;
  --text: #ececec;
  --text-muted: #737373;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --accent-hover: #60a5fa;
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.08);
  --green-border: rgba(34, 197, 94, 0.2);
  --yellow: #eab308;
  --yellow-bg: rgba(234, 179, 8, 0.08);
  --yellow-border: rgba(234, 179, 8, 0.2);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.08);
  --red-border: rgba(239, 68, 68, 0.2);
  --radius: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", monospace;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* Header */
header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  margin-top: 1rem;
}
.privacy::before { content: "\2713"; }

.disclaimer {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow-border);
  color: var(--yellow);
  font-size: 0.75rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* Steps */
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step:hover { border-color: #333; }
.step.disabled { opacity: 0.35; pointer-events: none; }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Upload */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.drop-zone input { display: none; }
.drop-zone p { color: var(--text-muted); font-size: 0.9rem; }
.drop-zone p:first-child { color: var(--text); font-weight: 500; }

/* Previews */
.preview-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.preview-row { display: flex; gap: 0.5rem; justify-content: center; }
.preview-cell {
  text-align: center;
  flex: 0 0 auto;
}
.preview-cell img {
  width: 80px;
  height: 100px;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.15s, border-color 0.15s;
}
.preview-cell img:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}
.preview-cell .label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-weight: 500;
}
.flat-preview img {
  width: 160px;
  height: 80px;
}
.flat-preview.thumbs img {
  width: 120px;
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-grid .full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
label .req { color: var(--red); }

input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: #444; }
textarea { resize: vertical; min-height: 60px; }

.height-group {
  display: flex;
  gap: 0.5rem;
  align-items: end;
}
.height-group > div { flex: 1; }
.height-group span {
  padding-bottom: 0.55rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: var(--surface-hover); border-color: #444; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.btn-primary:active { transform: scale(0.97); }

.btn-loading {
  opacity: 0.7;
  cursor: wait !important;
}
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Checkbox toggle */
input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Size indicator */
.size-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}
.size-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease, background 0.3s;
}
.size-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-family: var(--mono);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status {
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  font-weight: 500;
}
.status.error {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}
.status.success {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
}

.hidden { display: none !important; }

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
footer .support {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: inline-block;
}
footer .support a { font-weight: 500; }

@media (max-width: 600px) {
  body { padding: 1.5rem 1rem; }
  h1 { font-size: 1.4rem; }
  .form-grid { grid-template-columns: 1fr; }
  .preview-cell img { width: 55px; height: 70px; }
  .flat-preview img { width: 110px; height: 60px; }
  .step { padding: 1.25rem; }
  .drop-zone { padding: 2rem 1rem; }
}
