:root {
  --bg-dark: #0f0f11;
  --bg-mid: #1a1b20;
  --bg-light: #25262c;
  --accent: #7c5cfc;
  --accent-light: #9a7cfd;
  --text-primary: #f5f5f7;
  --text-muted: #a0a1aa;
  --border: rgba(255, 255, 255, 0.08);
  --panel-bg: rgba(22, 22, 26, 0.75);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 32px;
  --radius-lg: 18px;
  --radius-sm: 12px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(124, 92, 252, 0.22), transparent 55%),
    radial-gradient(circle at 80% 15%, rgba(194, 125, 255, 0.18), transparent 65%),
    radial-gradient(circle at 50% 100%, rgba(47, 50, 65, 0.45), transparent 70%),
    linear-gradient(145deg, #0b0b0c, #17171b 45%, #101017 80%);
  color: var(--text-primary);
  padding: 40px 20px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.4;
  z-index: 0;
}

body::before {
  top: -160px;
  left: -140px;
  background: rgba(124, 92, 252, 0.6);
}

body::after {
  bottom: -180px;
  right: -120px;
  background: rgba(130, 212, 255, 0.32);
}

.app-shell {
  position: relative;
  width: min(960px, 92vw);
  padding: 48px 64px 64px;
  border-radius: var(--radius-xl);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
  isolation: isolate;
}

.panel {
  margin-top: 24px;
  display: grid;
  gap: 32px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}

.logo-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  position: relative;
}

.logo-ring::after {
  content: "";
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  box-shadow: 0 0 24px rgba(124, 92, 252, 0.45);
}

.headline h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

.qr-form {
  display: grid;
  gap: 16px;
  margin-inline: auto;
  width: min(480px, 100%);
}

.field-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.field-group {
  display: grid;
  gap: 12px;
}

.field-input {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 9, 12, 0.65);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field-input:focus {
  outline: none;
  border-color: rgba(124, 92, 252, 0.6);
  box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.18);
}

.primary-action {
  justify-self: center;
  padding: 14px 34px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #0e0f11;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(124, 92, 252, 0.25);
}

.helper-text {
  min-height: 20px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.qr-preview {
  display: grid;
  gap: 20px;
  justify-items: center;
  padding: 32px;
  background: rgba(12, 12, 16, 0.55);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qr-canva {
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent 65%),
    rgba(14, 14, 18, 0.8);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 12px 24px rgba(0, 0, 0, 0.35);
}

.qr-canva canvas,
.qr-canva img {
  width: 200px !important;
  height: 200px !important;
  image-rendering: pixelated;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.download:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.download:not(:disabled):hover {
  border-color: rgba(124, 92, 252, 0.7);
  color: var(--accent-light);
  background: rgba(124, 92, 252, 0.12);
}

@media (max-width: 768px) {
  .app-shell {
    padding: 48px 32px 56px;
  }

  @media (max-width: 520px) {
  body {
    padding: 24px 12px;
  }

  .app-shell {
    width: 100%;
    padding: 56px 24px 48px;
  }

  .qr-preview {
    padding: 24px;
  }

  .download {
    width: 100%;
    justify-content: center;
  }
}

.helper-text.success {
  color: #7fda9b;
}

.helper-text.error {
  color: #ff8a7a;
}
