/* ── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1114;
  --surface:   #181b1f;
  --surface2:  #21252b;
  --border:    #2e333b;
  --text:      #e8eaed;
  --text-dim:  #8b929e;
  --accent:    #00c4a7;
  --accent2:   #0088ff;
  --warn:      #f59e0b;
  --error:     #ef4444;
  --success:   #22c55e;
  --mono:      'IBM Plex Mono', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
  --radius:    6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

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

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: baseline; gap: 10px; }

.logo-mark {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.logo-sub {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s;
}
.status-dot.ok  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.err { background: var(--error); }

/* ── Main ────────────────────────────────────────────────────────────────── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  flex: 1;
  width: 100%;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { margin-bottom: 40px; }

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.hero h1 strong { font-weight: 600; color: var(--accent); }

.hero-sub {
  color: var(--text-dim);
  max-width: 560px;
  font-size: 0.95rem;
}

/* ── Standards bar ───────────────────────────────────────────────────────── */
.standards-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.standard {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
}

.std-code {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent);
}

.std-name {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── Upload zone ─────────────────────────────────────────────────────────── */
.upload-zone { margin-bottom: 32px; }

.drop-target {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 64px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface);
}

.drop-target:hover,
.drop-target.dragover {
  border-color: var(--accent);
  background: rgba(0, 196, 167, 0.04);
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.drop-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.drop-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.file-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.drop-formats {
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ── Process panel ───────────────────────────────────────────────────────── */
.process-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 32px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.file-icon { font-size: 1.8rem; }

.file-meta { flex: 1; }

.file-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-all;
}

.file-size {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.btn-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
.btn-clear:hover { color: var(--error); border-color: var(--error); }

.checklist { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }

.check-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
  transition: border-color 0.3s;
}

.check-item.done  { border-color: var(--success); }
.check-item.active { border-color: var(--accent); }

.check-icon {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text-dim);
  width: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  transition: color 0.3s;
}

.check-item.done  .check-icon { color: var(--success); }
.check-item.active .check-icon { color: var(--accent); }

.check-item strong { font-size: 0.9rem; display: block; margin-bottom: 3px; }
.check-item p { font-size: 0.8rem; color: var(--text-dim); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-process {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-process:hover { opacity: 0.85; }
.btn-process:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-download, .btn-report {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-download { background: var(--accent); color: #000; }
.btn-report   { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-download:hover, .btn-report:hover { opacity: 0.8; }

.btn-reset {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 11px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-reset:hover { color: var(--text); border-color: var(--text-dim); }

/* ── Progress panel ──────────────────────────────────────────────────────── */
.progress-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px 32px;
  text-align: center;
  margin-bottom: 32px;
}

.progress-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 20px;
  min-height: 1.2em;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  border-radius: 2px;
  transition: width 0.4s ease;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0%   { opacity: 1; }
  50%  { opacity: 0.6; }
  100% { opacity: 1; }
}

.progress-note {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Results panel ───────────────────────────────────────────────────────── */
.results-panel {
  background: var(--surface);
  border: 1px solid var(--success);
  border-radius: 10px;
  padding: 32px;
  margin-bottom: 32px;
}

.results-panel h2 {
  color: var(--success);
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
  display: block;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.manual-review {
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.manual-review h3 {
  font-size: 0.82rem;
  color: var(--warn);
  font-family: var(--mono);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.manual-review ul {
  padding-left: 18px;
}

.manual-review li {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 5px;
}

/* ── Error panel ─────────────────────────────────────────────────────────── */
.error-panel {
  background: var(--surface);
  border: 1px solid var(--error);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  margin-bottom: 32px;
}

.error-icon { font-size: 2rem; margin-bottom: 14px; color: var(--error); }
.error-panel h2 { color: var(--error); margin-bottom: 10px; }
.error-panel p { color: var(--text-dim); margin-bottom: 0; font-family: var(--mono); font-size: 0.85rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

footer p + p { margin-top: 4px; }

[hidden] { display: none !important; }
