:root {
  --bg: #0b1020;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-d: #1d4ed8;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(2, 6, 23, .25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, #1e3a8a 0%, transparent 55%),
    radial-gradient(1000px 500px at 110% 10%, #0ea5e9 0%, transparent 45%),
    linear-gradient(180deg, #0b1020 0%, #0b1020 100%);
  z-index: -1;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.footnote { color: var(--muted); font-size: 12.5px; margin-top: 18px; }

/* ---- Password screen ---- */
.gate { text-align: center; }
.brand { display: block; height: 44px; width: auto; max-width: 100%; margin: 4px auto 20px; }
.brand.small { height: 32px; margin: 0; }

.gate-form { display: flex; gap: 10px; margin-top: 22px; }
.gate-form input {
  flex: 1; padding: 13px 14px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; outline: none;
}
.gate-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }

button {
  cursor: pointer; font-size: 15px; font-weight: 600;
  padding: 13px 22px; border: 0; border-radius: 10px;
  color: #fff; background: var(--brand);
  transition: background .15s ease;
}
button:hover { background: var(--brand-d); }
button:disabled { opacity: .6; cursor: default; }

.error { color: var(--err); font-size: 13.5px; margin: 14px 0 0; }

/* ---- Upload screen ---- */
.app-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 22px; }

.drop {
  display: block; border: 2px dashed var(--line); border-radius: 14px;
  padding: 38px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop:focus, .drop.dragover {
  border-color: var(--brand); background: #f8fafc; outline: none;
}
.drop-icon { font-size: 34px; }
.drop-title { font-weight: 600; margin: 10px 0 2px; }
.link { color: var(--brand); text-decoration: underline; }

/* ---- File list ---- */
.file-list { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
}
.row-icon { font-size: 22px; }
.row-main { flex: 1; min-width: 0; }
.row-top, .row-bottom { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.row-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-size { font-size: 12.5px; flex-shrink: 0; }
.row-status { font-size: 13px; font-weight: 600; }
.row-meta { font-size: 12px; }

.bar { height: 7px; background: #eef2f7; border-radius: 99px; overflow: hidden; margin: 9px 0; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #0ea5e9); border-radius: 99px; transition: width .25s ease; }

.row[data-state="done"]    .bar-fill { background: var(--ok); }
.row[data-state="done"]    .row-status { color: var(--ok); }
.row[data-state="error"]   .bar-fill { background: var(--err); }
.row[data-state="error"]   .row-status { color: var(--err); }
.row[data-state="queued"]  .row-status { color: var(--muted); }
.row[data-state="uploading"] .row-status,
.row[data-state="preparing"] .row-status,
.row[data-state="committing"] .row-status { color: var(--brand); }

.row-actions { display: flex; gap: 4px; }
.btn-ghost {
  background: transparent; color: var(--muted); padding: 6px 9px; font-size: 14px;
}
.btn-ghost:hover { background: #f1f5f9; color: var(--ink); }

.page-foot { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 18px; }

@media (max-width: 560px) {
  .card { padding: 26px; }
  .gate-form { flex-direction: column; }
}
