/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f172a;
  --surface:   #1e293b;
  --surface2:  #2a3a52;
  --border:    #334155;
  --accent:    #4f46e5;
  --accent-h:  #6366f1;
  --green:     #3ddc84;
  --red:       #ff5c5c;
  --yellow:    #f0c040;
  --text:      #e0e4f0;
  --muted:     #7a82a0;
  --radius:    10px;
  --mono:      'Consolas', 'Courier New', monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
}
.header-inner { max-width: 820px; margin: 0 auto; }
header h1 { font-size: 1.7rem; color: var(--accent); letter-spacing: 0.04em; }
header .subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
header .subtitle a { color: var(--accent-h); text-decoration: none; }
header .subtitle a:hover { text-decoration: underline; }

main {
  flex: 1;
  max-width: 820px;
  width: 100%;
  margin: 32px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}
footer a { color: var(--accent); text-decoration: none; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.card h2 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Drop zone ────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone.over, .drop-zone:hover {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.07);
}
.drop-icon {
  font-size: 3.4rem;
  color: var(--accent);
  margin-bottom: 14px;
  opacity: 0.8;
  line-height: 1;
}
.drop-title { font-size: 1.05rem; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.drop-sub   { font-size: 0.88rem; color: var(--muted); margin-bottom: 16px; }
.drop-or    { font-size: 0.82rem; color: var(--muted); margin: 12px 0; }
.drop-zone .btn-primary { padding: 11px 32px; font-size: 1rem; margin-top: 0; }
.drop-hint  { font-size: 0.8rem; color: var(--muted); margin-top: 18px; line-height: 1.5; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Validation result ────────────────────────────────────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 6px 16px;
  align-items: start;
}
.result-label { color: var(--muted); font-size: 0.88rem; }
.result-val   { font-family: var(--mono); font-size: 0.9rem; }
.status-ok    { color: var(--green); font-weight: 600; }
.status-fail  { color: var(--red); font-weight: 600; }
.status-warn  { color: var(--yellow); }
.warn-list    { margin-top: 10px; padding-left: 18px; }
.warn-list li { color: var(--yellow); font-size: 0.85rem; margin-bottom: 4px; }
.error-box    { color: var(--red); font-size: 0.93rem; padding: 10px; background: rgba(255,92,92,0.08); border-radius: 6px; border: 1px solid rgba(255,92,92,0.25); }

/* ── Output format selection ─────────────────────────────────────────────── */
.output-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.output-opt { display: none; }
.output-lbl {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 0.9rem;
}
.output-opt:checked + .output-lbl {
  border-color: var(--accent);
  background: rgba(79, 142, 247, 0.1);
  color: var(--accent);
}
.output-lbl:hover { border-color: var(--accent-h); }
.output-ext {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface2);
  border-radius: 4px;
  padding: 1px 6px;
}
.output-opt:checked + .output-lbl .output-ext { color: var(--accent); }

/* ── Conversion result ────────────────────────────────────────────────────── */
.progress-bar-wrap {
  height: 4px; background: var(--surface2); border-radius: 2px; margin: 12px 0;
}
.progress-bar {
  height: 100%; background: var(--accent); border-radius: 2px;
  animation: indeterminate 1.2s linear infinite;
  width: 40%;
}
@keyframes indeterminate {
  0%   { margin-left: 0; width: 40%; }
  50%  { margin-left: 30%; width: 50%; }
  100% { margin-left: 100%; width: 0; }
}

.success-box {
  display: flex; flex-direction: column; gap: 8px;
  color: var(--green); font-size: 0.95rem;
}
.success-box .stats { color: var(--muted); font-size: 0.88rem; font-family: var(--mono); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  main { padding: 0 10px; }
  .card { padding: 18px 14px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-label { margin-top: 8px; }
}
