/* ── Reset & tokens ─────────────────────────────────────────── */
:root {
  --accent:       #e85d04;
  --accent-hover: #c94e00;
  --bg:           #f4f4f5;
  --card:         #ffffff;
  --text:         #18181b;
  --muted:        #71717a;
  --border:       #e4e4e7;
  --success:      #16a34a;
  --success-bg:   #f0fdf4;
  --error:        #dc2626;
  --error-bg:     #fef2f2;
  --radius:       14px;
  --shadow:       0 2px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
}

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

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

/* ── Header ─────────────────────────────────────────────────── */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  color: var(--text);
  user-select: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.logo strong { font-weight: 700; }

/* ── Main layout ────────────────────────────────────────────── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  margin-bottom: 3rem;
}

/* ── Steps ──────────────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2.5rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  transition: color 0.25s;
}

.step.active  { color: var(--accent); }
.step.complete { color: var(--success); }

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.25s, color 0.25s;
  flex-shrink: 0;
}

.step.active  .step-num { background: var(--accent);  color: #fff; }
.step.complete .step-num { background: var(--success); color: #fff; }

.step-label {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.step-line {
  flex: 1 1 48px;
  max-width: 64px;
  height: 2px;
  background: var(--border);
  margin: 0 0.5rem;
}

/* ── Drop zones ─────────────────────────────────────────────── */
.drop-row {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.drop-zone {
  flex: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: #fff8f5;
}

.drop-zone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-bg);
  cursor: default;
}

/* idle state */
.dz-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.5rem;
  text-align: center;
  pointer-events: none; /* zone itself handles clicks */
}

.dz-idle .choose-btn { pointer-events: all; }

.dz-icon {
  width: 44px;
  height: 44px;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.dz-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.dz-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.choose-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s;
  margin-top: 0.2rem;
}

.choose-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* filled state */
.dz-filled {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  width: 100%;
}

.dz-filled.hidden { display: none; }
.dz-idle.hidden   { display: none; }

.dz-filled-icon {
  width: 36px;
  height: 36px;
  color: var(--success);
  flex-shrink: 0;
}

.dz-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dz-file-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.dz-file-size {
  font-size: 0.78rem;
  color: var(--muted);
}

.remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.remove-btn svg { width: 16px; height: 16px; }

.remove-btn:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* plus separator */
.plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
  color: var(--muted);
}

.plus svg { width: 22px; height: 22px; }

/* ── Error banner ───────────────────────────────────────────── */
.error-banner {
  background: var(--error-bg);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: var(--error);
  font-size: 0.875rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1.25rem;
}

.hidden { display: none !important; }

/* ── Convert button ─────────────────────────────────────────── */
.convert-btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  letter-spacing: 0.01em;
}

.convert-btn:hover:not(:disabled) { background: var(--accent-hover); }
.convert-btn:active:not(:disabled) { transform: scale(0.99); }
.convert-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Progress / Download phases ─────────────────────────────── */
.phase {
  text-align: center;
  padding: 2.5rem 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1.5rem;
}

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

.phase-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.phase-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.phase-sub code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* check circle */
.check-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.check-circle svg { width: 26px; height: 26px; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.8rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin: 1.25rem auto 0.75rem;
}

.download-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.download-btn:hover { background: #15803d; }

.restart-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: block;
  margin: 0 auto;
}

.restart-btn:hover { color: var(--text); }

/* ── Features row ───────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: #fff7f3;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
}

.feature-icon svg { width: 20px; height: 20px; }

.feature h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.feature p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.feature code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  background: var(--bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .card { padding: 1.5rem; }

  .drop-row {
    flex-direction: column;
  }

  .plus {
    width: auto;
    height: 24px;
  }

  .plus svg { transform: rotate(90deg); }

  .features {
    grid-template-columns: 1fr;
  }

  .steps { gap: 0; }
  .step-label { display: none; }
  .step-line { max-width: 40px; }
}
