:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #f3f4f6;
  --card-bg: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --drop-hover-bg: #eff6ff;
  --error: #dc2626;
  --success: #16a34a;
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent: #3b82f6;
  --accent-text: #ffffff;
  --drop-hover-bg: #1e3a5f;
  --error: #f87171;
  --success: #4ade80;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

main {
  max-width: 28rem;
  width: 100%;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

.subtitle {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

code {
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  font-size: 0.85em;
}

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

#version-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#version-select {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

#drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  padding: 2rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#drop-zone:hover,
#drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--drop-hover-bg);
}

#drop-zone .icon {
  width: 1.75rem;
  height: 1.75rem;
}

#drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

button[type="submit"] {
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

button[type="submit"]:hover:not(:disabled) {
  opacity: 0.9;
}

button[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input[type="password"] {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

input[type="password"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

#logout-btn {
  position: fixed;
  top: 1rem;
  right: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

#status {
  margin: 1rem 0 0;
  min-height: 1.25rem;
  font-size: 0.9rem;
}

#status.error {
  color: var(--error);
}

#status.success {
  color: var(--success);
}

#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

#theme-toggle .icon {
  width: 1.2rem;
  height: 1.2rem;
}

#theme-toggle .icon-moon {
  display: none;
}

html[data-theme="dark"] #theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] #theme-toggle .icon-moon {
  display: block;
}
