:root {
  --bg: #eef3fa;
  --bg-accent: #dbe6f4;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-border: rgba(18, 34, 61, 0.1);
  --text: #0f1728;
  --muted: #5b6478;
  --primary: #23365d;
  --primary-strong: #182744;
  --accent: #8ea5c7;
  --shadow: 0 24px 70px rgba(18, 34, 61, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06101e;
    --bg-accent: #0f1f38;
    --panel: rgba(9, 19, 35, 0.78);
    --panel-border: rgba(166, 188, 224, 0.12);
    --text: #edf4ff;
    --muted: #b6c2d7;
    --primary: #d9e7ff;
    --primary-strong: #edf4ff;
    --accent: #7e9cca;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(35, 54, 93, 0.18), transparent 34%),
    radial-gradient(circle at right center, rgba(142, 165, 199, 0.26), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, var(--bg) 48%, var(--bg-accent) 100%);
}

.brand-header {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 16px 0;
}

.brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 18px;
  filter: drop-shadow(0 14px 28px rgba(18, 34, 61, 0.18));
}

.brand-name {
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.shell {
  flex: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(100vh - 96px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: center;
  padding: 12px 0 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.copy-panel {
  padding: 30px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2rem, 3vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.lede {
  margin: 14px 0 0;
  max-width: 34rem;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--muted);
}

.controls {
  margin-top: 22px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.preview-header p {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 18px;
  padding: 14px 18px;
  font: inherit;
  font-size: 0.96rem;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at top left, rgba(74, 109, 171, 0.24), transparent 30%),
      radial-gradient(circle at 85% 18%, rgba(120, 150, 199, 0.16), transparent 24%),
      radial-gradient(circle at 50% 100%, rgba(26, 48, 84, 0.42), transparent 38%),
      linear-gradient(160deg, #040a14 0%, var(--bg) 42%, var(--bg-accent) 100%);
  }

  .field input {
    border-color: rgba(166, 188, 224, 0.16);
    background: rgba(8, 16, 29, 0.9);
    color: var(--text);
  }

  .field input::placeholder {
    color: rgba(182, 194, 215, 0.72);
  }
}

.field input:focus {
  outline: none;
  border-color: rgba(35, 54, 93, 0.5);
  box-shadow: 0 0 0 5px rgba(35, 54, 93, 0.12);
  transform: translateY(-1px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #3e5f98 100%);
  box-shadow: 0 14px 30px rgba(35, 54, 93, 0.24);
}

.button.ghost {
  color: var(--text);
  background: rgba(23, 23, 23, 0.06);
}

@media (prefers-color-scheme: dark) {
  .button.primary {
    color: #f7fbff;
    background: linear-gradient(135deg, #365382 0%, #5f82bc 100%);
    box-shadow: 0 14px 30px rgba(5, 10, 20, 0.34);
  }

  .button.ghost {
    color: #edf4ff;
    background: rgba(233, 241, 255, 0.08);
    border: 1px solid rgba(166, 188, 224, 0.14);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }

  .button.primary:hover,
  .button.ghost:hover,
  .footer-button:hover {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  }
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.preview-panel {
  padding: 18px;
}

.preview-card {
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 245, 252, 0.96));
  border: 1px solid rgba(23, 23, 23, 0.06);
  padding: 16px;
}

@media (prefers-color-scheme: dark) {
  .preview-card {
    background:
      linear-gradient(180deg, rgba(15, 27, 47, 0.96), rgba(8, 16, 29, 0.98));
    border-color: rgba(166, 188, 224, 0.12);
  }
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.preview-header p,
.preview-header span {
  margin: 0;
}

.preview-header span {
  font-size: 0.85rem;
  color: var(--muted);
}

.preview-frame {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at center, rgba(35, 54, 93, 0.08), transparent 48%),
    linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
}

@media (prefers-color-scheme: dark) {
  .preview-frame {
    background:
      radial-gradient(circle at center, rgba(126, 156, 202, 0.16), transparent 44%),
      radial-gradient(circle at 50% 24%, rgba(217, 231, 255, 0.05), transparent 18%),
      linear-gradient(180deg, #10203a 0%, #08111f 100%);
  }
}

.qr-preview {
  width: min(100%, 320px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.qr-preview canvas,
.qr-preview svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(23, 23, 23, 0.14));
}

.shell-404 {
  grid-template-columns: 1fr;
  max-width: 760px;
}

.not-found-panel {
  text-align: center;
}

.not-found-panel h1,
.not-found-panel .lede {
  margin-left: auto;
  margin-right: auto;
}

.not-found-panel .actions {
  justify-content: center;
}

.site-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 16px 14px;
}

.footer-button,
.footer-link {
  color: var(--primary);
  text-decoration: none;
}

.footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(35, 54, 93, 0.16);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 24px rgba(18, 34, 61, 0.1);
  font-weight: 800;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

@media (prefers-color-scheme: dark) {
  .footer-button {
    color: #edf4ff;
    border-color: rgba(166, 188, 224, 0.14);
    background: rgba(255, 255, 255, 0.04);
  }
}

.footer-button:hover,
.footer-link:hover {
  transform: translateY(-1px);
}

.footer-link {
  font-size: 0.94rem;
  font-weight: 600;
}

.footer-copy {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 16px 0 24px;
  }

  h1 {
    max-width: none;
  }

  .preview-frame {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .brand-header {
    padding-top: 14px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .shell {
    width: min(100% - 20px, 1120px);
    gap: 14px;
  }

  .site-footer {
    gap: 6px;
    padding-bottom: 12px;
  }

  .copy-panel,
  .preview-panel {
    padding: 16px;
  }

  .preview-card,
  .preview-frame {
    padding: 14px;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
