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

/* ── Tokens ── */
:root {
  --bg0: #080f1a;
  --bg1: #0d1825;
  --bg2: #142236;
  --border: rgba(77, 166, 255, 0.12);
  --border-hover: rgba(77, 166, 255, 0.3);
  --blue: #4da6ff;
  --blue-dim: rgba(77, 166, 255, 0.15);
  --blue-hover: rgba(77, 166, 255, 0.25);
  --text: #c8deff;
  --text-muted: #4a6a8a;
  --text-dim: #2a4a6a;
  --red: #ff6b6b;
  --red-dim: rgba(255, 107, 107, 0.12);
  --red-hover: rgba(255, 107, 107, 0.22);
  --green: #4dffaa;
  --green-dim: rgba(77, 255, 170, 0.1);
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
}

html, body {
  min-height: 100vh;
  background: var(--bg0);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
}

.logo {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #4da6ff, #80c0ff, #3d94f6);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s linear infinite;
  text-decoration: none;
}

@keyframes gradient-shift {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.site-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Cards ── */
.card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-primary {
  background: var(--blue);
  color: #000;
  border-color: var(--blue);
}
.btn-primary:hover:not(:disabled) { background: #6ab8ff; }

.btn-secondary {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: var(--border-hover);
}
.btn-secondary:hover:not(:disabled) { background: var(--blue-hover); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255,107,107,0.2);
}
.btn-danger:hover:not(:disabled) { background: var(--red-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-hover); }

.btn-sm  { padding: 0.3rem 0.75rem; font-size: 0.78rem; }
.btn-full { width: 100%; }

/* ── Alerts ── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}
.alert-ok    { background: var(--green-dim); color: var(--green); border: 1px solid rgba(77,255,170,0.2); }
.alert-error { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(255,107,107,0.2); }

.results-list { display: flex; flex-direction: column; gap: 0.4rem; }

/* ── Upload zone ── */
.drop-zone {
  border: 2px dashed var(--text-dim);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1rem;
  position: relative;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.drop-icon   { font-size: 2.2rem; color: var(--blue); line-height: 1; }
.drop-label  { font-size: 0.95rem; color: var(--text); font-weight: 500; }
.drop-sub    { font-size: 0.82rem; color: var(--text-muted); }

.drop-zone-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--blue);
  font-size: 0.9rem;
}

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--blue-dim);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upload-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.upload-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── File list ── */
.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background 0.15s;
}
.file-item:hover { border-color: var(--border-hover); background: rgba(20, 34, 54, 0.9); }

.file-icon {
  flex-shrink: 0;
  width: 2.6rem; height: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-dim);
  border-radius: 0.45rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--blue);
}

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

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-name:hover { color: var(--blue); }

.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-delete-form { flex-shrink: 0; }

.empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

/* ── Login ── */
.login-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.login-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { border-color: var(--blue); }

/* ── Utilities ── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Responsive ── */
@media (max-width: 540px) {
  .site-header { padding: 1rem; }
  .site-main   { padding: 1rem 0.75rem 3rem; }
  .card        { padding: 1.1rem; }
  .drop-zone   { padding: 1.75rem 1rem; }
  .file-item   { gap: 0.6rem; }
  .upload-actions { flex-direction: column; }
}
