*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --accent: #6c8fff;
  --accent-dim: #3d4fa8;
  --text: #e4e6f0;
  --muted: #7b7f96;
  --success: #3ddc84;
  --error: #ff5c5c;
  --radius: 10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

header p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Current version card */
.version-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.version-badge {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.version-meta {
  font-size: 13px;
  color: var(--muted);
}

.version-detail {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.no-version {
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}

/* Form */
.field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--accent-dim);
}

.file-input-wrapper {
  width: 100%;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}

.file-input-wrapper:hover,
.file-input-wrapper.has-file {
  border-color: var(--accent-dim);
}

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

.file-label {
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
}

.file-label strong {
  color: var(--accent);
}

/* Progress */
.progress-wrap {
  margin-top: 16px;
  display: none;
}

.progress-bar-bg {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.1s linear;
}

.progress-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

/* Button */
button[type="submit"] {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s;
}

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

/* Alerts */
.alert {
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 14px;
  display: none;
}

.alert.success { background: #1a2e22; color: var(--success); border: 1px solid #2a4a32; }
.alert.error   { background: #2e1a1a; color: var(--error);   border: 1px solid #4a2a2a; }
.alert.show    { display: block; }

/* History table */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 0 8px 10px 0;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.history-table tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  background: var(--accent-dim);
  color: #c8d4ff;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
}
