:root {
  --bg: #f5f5f7;
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --accent: #0066ff;
  --accent-hover: #0052cc;
  --accent-soft: rgba(0, 102, 255, 0.08);
  --error-bg: #fff0f0;
  --error-fg: #8b0000;
  --error-border: #ffd0d0;
  --card: #ffffff;
  --field-bg: #ffffff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --fg: #f5f5f7;
    --muted: #98989d;
    --border: #38383a;
    --accent: #4d9aff;
    --accent-hover: #6cadff;
    --accent-soft: rgba(77, 154, 255, 0.12);
    --error-bg: #2a1010;
    --error-fg: #ff8a8a;
    --error-border: #5a1010;
    --card: #1c1c1e;
    --field-bg: #2c2c2e;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

main {
  width: 100%;
  max-width: 30rem;
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background: var(--bg);
  border-radius: 4px;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.flash--error {
  background: var(--error-bg);
  color: var(--error-fg);
  border-color: var(--error-border);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -0.5rem 0 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.topbar .user { font-weight: 500; }

.logout-form { margin: 0; }

button.link {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

button.link:hover { color: var(--accent); }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2.5rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 1.5rem;
  text-align: center;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--accent);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dz-text {
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.dz-text strong { color: var(--fg); font-weight: 500; }

.dz-file {
  margin-top: 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
  pointer-events: none;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.field input {
  font: inherit;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--fg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

button[type="submit"] {
  width: 100%;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  margin-top: 0.25rem;
}

button[type="submit"]:hover { background: var(--accent-hover); }
button[type="submit"]:active { transform: translateY(1px); }

.card-form { margin: 0; }
