:root {
  --bg: #1a1d23;
  --card-bg: #22262d;
  --text: #e4e6ea;
  --text-muted: #8b929a;
  --accent: #4ecdc4;
  --accent-hover: #3dbdb5;
  --success: #27ae60;
  --danger: #e74c3c;
  --border: #353a42;
  --input-bg: #2a2e36;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

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

.upload-container {
  max-width: 480px;
  width: 100%;
  padding: 2rem 1.5rem;
}

.upload-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.upload-logo img {
  height: 48px;
  margin-bottom: 0.75rem;
}

.upload-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.upload-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.step-indicator {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  justify-content: center;
  align-items: center;
}

.step-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s;
}

.step-dot.active { background: var(--accent); box-shadow: 0 0 8px rgba(78, 205, 196, 0.4); }
.step-dot.done { background: var(--success); }

.step-line {
  width: 32px; height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.step-line.done { background: var(--success); }

.step-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  display: none;
  box-shadow: var(--shadow);
}

.step-panel.active { display: block; }

.step-panel h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.step-panel .step-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

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

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #1a1d23;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: #2f3540;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #3a414d; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 1rem;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(78, 205, 196, 0.04);
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

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

.file-list {
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.file-list li:last-child { border-bottom: none; }

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.file-size { color: var(--text-muted); white-space: nowrap; margin-left: 0.5rem; }

/* ─── Progress panel ─────────────────────────────── */

.progress-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.progress-icon {
  width: 56px; height: 56px;
  background: rgba(78, 205, 196, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-size: 1.5rem;
  color: var(--accent);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.2); }
  50% { box-shadow: 0 0 0 12px rgba(78, 205, 196, 0); }
}

.progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-item {
  background: var(--input-bg);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

.progress-bar-container {
  background: var(--input-bg);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  margin: 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #2ecc71);
  border-radius: 6px;
  transition: width 0.3s;
  width: 0%;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-bar-label {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
}

.progress-files-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.25rem 0 0.5rem;
}

.progress-file-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  padding: 0;
}

.pf-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(53, 58, 66, 0.5);
  font-size: 0.82rem;
}

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

.pf-info {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.pf-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-size {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.75rem;
  margin-left: 0.4rem;
}

.pf-status {
  flex-shrink: 0;
  margin-left: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.progress-phase {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

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

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* ─── File list enhancements ─────────────────────── */

.file-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.7rem;
  transition: color 0.2s, background 0.2s;
}

.file-remove:hover {
  color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
}

.file-total {
  font-weight: 600;
  color: var(--accent) !important;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem !important;
  margin-top: 0.25rem;
}

/* ─── Cloud import UI ─────────────────────────── */
.import-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.import-row input {
  flex: 1;
  min-width: 0;
}

.import-row .btn {
  width: auto;
  white-space: nowrap;
  padding: 0.7rem 1rem;
}

.import-help {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-muted);
  opacity: 0.9;
  font-size: 0.78rem;
  line-height: 1.35;
}

.cloud-import-list {
  list-style: none;
  margin: 0.7rem 0 0.2rem;
  max-height: 170px;
  overflow-y: auto;
}

.cloud-import-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.45rem;
}

.cloud-import-main {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.cloud-import-name,
.cloud-import-meta {
  font-size: 0.8rem;
}

.cloud-import-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-import-meta {
  color: var(--text-muted);
  white-space: nowrap;
}

.cloud-import-url {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Success state ──────────────────────────────── */

.success-state {
  text-align: center;
  padding: 1rem 0;
}

.success-icon {
  width: 64px; height: 64px;
  background: rgba(39, 174, 96, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
  color: var(--success);
}

.confirmation-email-notice {
  background: rgba(78, 205, 196, 0.08);
  border: 1px solid rgba(78, 205, 196, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 1.25rem;
  line-height: 1.5;
}

.error-msg {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  color: var(--danger);
  font-size: 0.82rem;
  margin-top: 0.75rem;
  display: none;
}

.code-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.code-inputs input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'JetBrains Mono', monospace;
}

.code-inputs input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.powered-by {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.5;
}

@media (max-width: 520px) {
  .upload-container { padding: 1.25rem 1rem; }
  .step-panel { padding: 1.25rem; }
  .code-inputs input { width: 42px; height: 48px; font-size: 1.25rem; }
  .import-row { flex-direction: column; align-items: stretch; }
  .import-row .btn { width: 100%; }
  .cloud-import-main { flex-direction: column; align-items: flex-start; }
}
