/* Simple, readable UI — no frameworks */

:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e8eef5;
  --muted: #8b9cb3;
  --accent: #3d9cf5;
  --accent-hover: #5eb0ff;
  --danger: #f07178;
  --radius: 12px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.card {
  margin-top: 1.75rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

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

.file-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
}

.file-label-text {
  font-weight: 600;
  font-size: 0.9rem;
}

input[type='file'] {
  font-size: 0.85rem;
  color: var(--muted);
}

input[type='file']::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

input[type='file']::file-selector-button:hover {
  border-color: var(--accent);
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-wrap.hidden {
  display: none;
}

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

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #6ec8ff);
  border-radius: 999px;
  transition: width 0.15s ease-out;
}

.progress-pct {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 2.5rem;
  text-align: right;
}

.btn {
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #0a0f14;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  flex-shrink: 0;
}

.btn.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  margin-top: 0.5rem;
  width: 100%;
}

.btn.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.message.error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
  border-radius: 8px;
  color: #ffb4b8;
  font-size: 0.9rem;
}

.message.hidden {
  display: none;
}

.result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.result.hidden {
  display: none;
}

.result h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.qr-box {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.qr-box img {
  display: block;
  max-width: 100%;
  height: auto;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.download-link {
  flex: 1;
  min-width: 0;
  word-break: break-all;
  color: var(--accent-hover);
  font-size: 0.9rem;
}

.download-link:hover {
  text-decoration: underline;
}

.meta {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.footer {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
