:root {
  color-scheme: dark;
  --bg-1: #081220;
  --bg-2: #10233d;
  --panel: rgba(9, 20, 35, 0.88);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #14b8a6;
  --accent-dark: #0f766e;
  --danger: #f87171;
  --success: #34d399;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 88%);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 640px);
  padding: 32px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #67e8f9;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.lead {
  margin: 16px 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.form {
  display: grid;
  gap: 10px;
}

label {
  font-size: 14px;
  font-weight: 600;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input,
button {
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
}

input {
  width: 100%;
  padding: 0 16px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.22);
  outline: none;
}

input:focus {
  border-color: rgba(34, 211, 238, 0.8);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

input[type="file"] {
  padding: 10px 12px;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  color: #06231f;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  cursor: pointer;
}

button {
  padding: 0 18px;
  font-weight: 700;
  color: #06231f;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 12px 28px rgba(20, 184, 166, 0.22);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(20, 184, 166, 0.24);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.form-message {
  min-height: 24px;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--success);
}

.result {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: grid;
  justify-items: center;
  gap: 16px;
}

.preview-wrap {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

#qr-preview {
  width: min(100%, 280px);
  height: auto;
  display: block;
  background: white;
  padding: 14px;
  border-radius: 8px;
}

.download-btn {
  min-width: 180px;
}

.link-box {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.58);
}

.link-label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #67e8f9;
}

.file-link {
  display: block;
  overflow-wrap: anywhere;
  color: #7dd3fc;
  text-decoration: none;
}

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

.saved-name {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 640px) {
  .card {
    padding: 24px;
  }

  h1 {
    font-size: 32px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}
