/* FileTrader — brutal editorial, Unbounded as display */
:root {
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-2: #1C1C1C;
  --line: #2A2A2A;
  --text: #FFFBF0;
  --muted: #9A9A9A;
  --blue: #2B5CFF;
  --blue-2: #1A46E0;
  --blue-ghost: rgba(43,92,255,.12);
  --red: #FF3B30;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.screen { min-height: 100vh; display: flex; flex-direction: column; }

/* Login */
#login-screen {
  align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 20% -10%, rgba(43,92,255,.10), transparent 60%),
    radial-gradient(600px 600px at 90% 100%, rgba(43,92,255,.05), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 36px 28px 28px;
  /* intentional sharp + one cut corner instead of 16px everywhere */
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.login-card h1 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-transform: uppercase;
}
.login-card h1::after {
  content: '  PRIVATE';
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--blue);
  vertical-align: super;
  margin-left: 8px;
}
.subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 28px;
  line-height: 1.6;
}
.login-card input {
  width: 100%;
  padding: 13px 14px;
  background: #0A0A0A;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  outline: none;
  margin-bottom: 10px;
}
.login-card input:focus { border-color: var(--blue); }
.login-card input::placeholder { color: #5A5A5A; }
.login-card button {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--blue);
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.login-card button:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.login-card button:active { background: var(--blue-2); border-color: var(--blue-2); transform: translateY(1px); }
.error {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--red);
  margin-top: 12px;
  border-left: 2px solid var(--red);
  padding-left: 10px;
}

/* App */
#app-screen { background: var(--bg); }
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
header h2 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
header h2 span { font-weight: 400; color: var(--blue); }
.btn-small {
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-small:hover { border-color: var(--text); color: var(--text); }

.upload-section { padding: 28px 24px 0; max-width: 900px; width: 100%; margin: 0 auto; }
.dropzone {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .12s, background .12s;
}
.dropzone::before {
  content: '';
  position: absolute; inset: 6px;
  border: 1px dashed #2E2E2E;
  pointer-events: none;
}
.dropzone.drag { border-color: var(--blue); background: rgba(43,92,255,.08); }
.dropzone.drag::before { border-color: var(--blue); opacity: .5; }
.dz-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  position: relative;
}
.dz-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
  position: relative;
}
.progress-bar { height: 4px; background: #1E1E1E; margin-top: 14px; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: var(--blue); transition: width .2s; }
#progress-text { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); margin-top: 6px; display: inline-block; }
#upload-progress { margin-top: 12px; }

.stats-section { max-width: 900px; width: 100%; margin: 18px auto 0; padding: 0 24px; }
.stats-top { display: flex; justify-content: space-between; align-items: baseline; }
.stats-label { font-family: 'Unbounded', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stats-values { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text); }
.stats-bar { height: 6px; background: #1E1E1E; border: 1px solid var(--line); margin-top: 8px; overflow: hidden; }
#stats-fill { height: 100%; width: 0%; background: var(--blue); transition: width .3s; }
.stats-meta { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--muted); margin-top: 6px; }

.files-section { padding: 18px 24px 40px; max-width: 900px; width: 100%; margin: 0 auto; }
.files-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.files-header h3 {
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.files-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); }
.file-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.file-card:last-child { border-bottom: none; }
.file-card:hover { background: var(--surface-2); }
.file-info { min-width: 0; }
.file-name {
  font-family: 'Unbounded', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
}
.file-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
}
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-primary {
  padding: 9px 14px;
  background: transparent;
  color: var(--text);
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--blue);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-2); border-color: var(--blue-2); }
.btn-danger {
  padding: 9px 14px;
  background: transparent;
  border: 1px solid #3A1A1A;
  color: #FF6B6B;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: middle;
  border: 1px solid;
}
.badge-wait { color: var(--blue); border-color: rgba(43,92,255,.35); background: var(--blue-ghost); }
.badge-done { color: #FFB84D; border-color: rgba(255,184,77,.35); background: rgba(255,184,77,.08); }
.hint { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); text-align: center; margin-top: 24px; }

/* Mobile */
@media (max-width: 640px) {
  #login-screen { padding: 16px; }
  .login-card { padding: 28px 20px 22px; max-width: 100%; }
  .login-card h1 { font-size: 26px; }
  .login-card input, .login-card button { font-size: 16px; } /* prevent iOS zoom */
  header { padding: 14px 16px; }
  header h2 { font-size: 15px; }
  .btn-small { padding: 8px 10px; min-height: 36px; }
  .upload-section, .stats-section, .files-section { padding-left: 16px; padding-right: 16px; }
  .upload-section { padding-top: 16px; }
  .dropzone { padding: 28px 16px; }
  .dz-title { font-size: 13px; line-height: 1.3; }
  .file-card { flex-direction: column; align-items: stretch; padding: 14px; }
  .file-name { max-width: 100%; font-size: 13px; white-space: normal; word-break: break-all; }
  .file-actions { width: 100%; }
  .btn-primary, .btn-danger { flex: 1; text-align: center; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
  .stats-top { flex-direction: column; gap: 4px; }
}
@media (max-width: 380px) {
  .login-card h1 { font-size: 22px; }
  .dz-title { font-size: 12px; }
}
