:root {
  --bg: #0f172a;
  --card: #1e293b;
  --fg: #e2e8f0;
  --muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #f87171;
  --ok: #34d399;
  --border: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.card {
  position: relative;
  width: 100%;
  max-width: 48rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2.25rem 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Keep the login form compact even though the card is wide. */
#auth-form {
  max-width: 24rem;
}

@media (max-width: 540px) {
  .card {
    padding: 1.5rem;
  }
}

.lang {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  overflow: hidden;
}

.lang button {
  margin: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0;
  cursor: pointer;
}

.lang button.active {
  background: var(--accent);
  color: #fff;
}

.lang button:hover:not(.active) {
  background: var(--border);
  color: var(--fg);
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--fg);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}

button {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.message {
  margin: 1rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  font-size: 0.9rem;
}

.session {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ok);
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.files .file {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #0b1220;
}

.files .folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.files .folder-name::before {
  content: "\1F4C1\00A0\00A0";
}

.files .folder:first-child {
  margin-top: 0;
}

.files .folder-all {
  flex: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}

.files .folder-all:hover:not(:disabled) {
  background: var(--border);
}

.files .file.nested {
  margin-left: 0.9rem;
}

.files .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.files .name {
  font-weight: 600;
  word-break: break-all;
}

.files .size {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.files button {
  margin: 0;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.checksum {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
}

.hint {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

a {
  color: var(--accent);
}
