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

:root {
  --bg: #f0f2f8;
  --card: #ffffff;
  --primary: #1a3ef5;
  --primary-hover: #0f2dd4;
  --primary-light: #e8ecfe;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
  --success: #059669;
  --danger: #dc2626;
  --shadow: 0 2px 8px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  line-height: 1.5;
}

.container { width: 100%; max-width: 580px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 44px;
  border: 1px solid var(--border);
}

.logo {
  height: 48px;
  width: auto;
  margin-bottom: 16px;
  display: block;
}

h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }

/* Steps indicator */
.steps {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.step {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
}
.step.active { color: var(--primary); }
.step.done { color: var(--success); }
.step-circle {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  transition: all 0.2s;
}
.step.active .step-circle { background: var(--primary); color: white; border-color: var(--primary); }
.step.done .step-circle { background: var(--success); color: white; border-color: var(--success); }
.step-line { flex: 1; height: 2px; background: var(--border); transition: background 0.3s; }
.step-line.active { background: var(--primary); }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  margin-bottom: 16px;
  background: #fafbfc;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* File list */
.file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.file-item:hover { background: #f3f4f6; }
.file-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .size { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.file-item .remove {
  background: none; border: none; color: var(--danger);
  cursor: pointer; padding: 4px 6px; font-size: 1.1rem; line-height: 1;
  border-radius: 4px; transition: background 0.15s;
}
.file-item .remove:hover { background: #fef2f2; }

/* Form fields */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 0.875rem; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.field input, .field select {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 0.95rem;
  background: var(--card); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,62,245,.1);
}
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; display: block; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  font-size: 0.95rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--primary); color: white;
  width: 100%; justify-content: center;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,62,245,.25); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary {
  background: transparent; color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #f9fafb; color: var(--text); border-color: #d1d5db; }
.btn-row { display: flex; gap: 12px; margin-top: 8px; }
.btn-row .btn-primary { flex: 1; }

.btn.loading { pointer-events: none; opacity: 0.7; }

/* Success */
.success-icon { color: var(--success); margin-bottom: 16px; }
#successStep { text-align: center; padding: 20px 0; }
.ref-id {
  margin-top: 16px; padding: 10px 16px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 10px; font-size: 0.85rem;
  color: var(--success); font-family: monospace;
}

.hidden { display: none !important; }

.footer-note {
  text-align: center; margin-top: 16px;
  font-size: 0.8rem; color: var(--text-muted);
}

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@media (max-width: 480px) {
  .card { padding: 28px 20px; }
  .field-row { flex-direction: column; gap: 0; }
}
