:root {
  --bg: #0f1115;
  --fg: #e6e8eb;
  --muted: #9aa0a8;
  --accent: #4f8cff;
  --card: #1a1d23;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

main { width: 100%; max-width: 32rem; padding: clamp(1rem, 4vw, 2rem); }

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

.brand img { border-radius: 14px; }

h1 { margin-bottom: 0.25rem; letter-spacing: 0.02em; font-size: clamp(1.75rem, 6vw, 2.5rem); }
.tagline { color: var(--muted); margin-top: 0; }

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

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

input[type="text"] {
  padding: 0.75rem;
  border: 1px solid #333a44;
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  font-size: 16px; /* prevents iOS zoom-on-focus */
}
input[type="text"]:focus { outline: 2px solid var(--accent); border-color: transparent; }

button, a[href$=".svg"] {
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
button[type="submit"] { align-self: stretch; }

@media (min-width: 480px) {
  button[type="submit"] { align-self: flex-start; }
}

.qr-card {
  margin-top: 1.5rem;
  background: var(--card);
  border-radius: 12px;
  padding: clamp(1rem, 4vw, 1.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.qr-image svg { display: block; width: min(256px, 80vw); height: auto; aspect-ratio: 1; background: #fff; border-radius: 8px; }

.qr-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.qr-actions button, .qr-actions a {
  background: transparent;
  border: 1px solid #333a44;
  color: var(--fg);
  flex: 1 1 auto;
  min-height: 44px; /* touch target */
}

.error { color: #ff7373; background: var(--card); padding: 0.75rem 1rem; border-radius: 8px; }

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

.dropdown { position: relative; display: flex; flex: 1 1 auto; }
.dropdown [data-action="download"] { flex: 1; border-radius: 8px 0 0 8px; min-height: 44px; }
.dropdown .chevron {
  border-radius: 0 8px 8px 0;
  border: 1px solid #333a44;
  background: transparent;
  color: var(--fg);
  font-size: 0.7rem;
  padding: 0.75rem 0.2rem;
  cursor: pointer;
}
.dropdown .menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  margin: 4px 0 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--card);
  border: 1px solid #333a44;
  border-radius: 8px;
}
.dropdown .menu button {
  width: 100%;
  background: none;
  border: none;
  color: var(--fg);
  text-align: left;
  min-height: 44px;
}
.dropdown .menu button:hover { background: #262b33; border-radius: 6px; }
