:root {
  --ink: #f7efe5;
  --muted: #b9aebf;
  --dim: #887d8f;
  --bg: #0d0b10;
  --panel: #17131f;
  --panel-raised: #1d1826;
  --control: #100d15;
  --line: rgba(247, 239, 229, 0.14);
  --line-strong: rgba(247, 239, 229, 0.24);
  --amber: #f5b84b;
  --amber-dark: #d6862e;
  --mint: #9ee6cf;
  --danger: #ff8d8d;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(245, 184, 75, 0.14), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgba(158, 230, 207, 0.1), transparent 28rem),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="color"],
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(158, 230, 207, 0.48);
  outline-offset: 3px;
}

a {
  color: inherit;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  opacity: 0.12;
  filter: blur(80px);
  pointer-events: none;
}

.page-glow-one {
  top: 18rem;
  left: -13rem;
  background: var(--amber);
}

.page-glow-two {
  right: -12rem;
  bottom: 4rem;
  background: var(--mint);
}

.topbar,
.app-shell,
.site-footer {
  width: min(1220px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 0;
}

.brand,
.back-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand {
  gap: 11px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.back-link {
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.back-link:hover {
  color: var(--ink);
}

.step-label {
  margin: 0;
  color: var(--mint);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2,
p {
  margin-top: 0;
}

.status-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(158, 230, 207, 0.1);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 22px;
  align-items: start;
  padding-top: 28px;
  padding-bottom: 90px;
}

.control-panel,
.preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.control-panel {
  overflow: hidden;
}

.preview-panel {
  position: sticky;
  top: 22px;
  padding: 24px;
}

.panel-heading,
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  padding: 24px 26px 20px;
}

.panel-heading h2,
.preview-heading h2 {
  margin: 4px 0 0;
  font-size: 1.65rem;
  letter-spacing: -0.045em;
}

.text-button {
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.86rem;
  font-weight: 750;
}

.text-button:hover {
  color: var(--amber);
}

.setting-section {
  margin: 0;
  padding: 24px 26px 10px;
  border: 0;
  border-top: 1px solid var(--line);
}

.setting-section legend {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px 0 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.setting-section legend span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 9px;
  color: #191108;
  background: var(--amber);
  font-size: 0.78rem;
}

.setting-section legend em {
  color: var(--dim);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 650;
}

.form-group {
  margin: 0 0 18px;
}

label,
.eye-color-group > label {
  display: block;
  margin-bottom: 8px;
  color: #e9dfe7;
  font-size: 0.84rem;
  font-weight: 750;
}

textarea,
input[type="text"],
input[type="url"],
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--control);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

textarea:hover,
input[type="text"]:hover,
input[type="url"]:hover,
select:hover {
  border-color: var(--line-strong);
}

textarea:focus,
input[type="text"]:focus,
input[type="url"]:focus,
select:focus {
  border-color: rgba(158, 230, 207, 0.62);
  box-shadow: 0 0 0 4px rgba(158, 230, 207, 0.08);
  outline: none;
}

.field-meta,
.help-text {
  color: var(--dim);
  font-size: 0.75rem;
  line-height: 1.45;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 7px;
}

.field-meta span:last-child {
  flex: 0 0 auto;
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.color-input-wrapper {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--control);
}

.color-input-wrapper input[type="text"] {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
}

input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 1px 0 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  margin-bottom: 3px;
  font-size: 0.84rem;
}

.toggle-row small {
  color: var(--dim);
  font-size: 0.73rem;
  font-weight: 500;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: #2b2532;
  transition: 0.2s ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: 0.2s ease;
}

.toggle-row input:checked + .switch {
  border-color: var(--mint);
  background: rgba(158, 230, 207, 0.25);
}

.toggle-row input:checked + .switch::after {
  transform: translateX(18px);
  background: var(--mint);
}

.eye-color-group {
  max-width: 230px;
  margin-bottom: 16px;
}

.eye-color-group[hidden] {
  display: none;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 13px;
  background: var(--control);
}

.tab-btn {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--dim);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 750;
}

.tab-btn.active {
  color: var(--ink);
  background: var(--panel-raised);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.dropzone {
  display: flex;
  width: 100%;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  transition: 0.18s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--amber);
  background: rgba(245, 184, 75, 0.07);
}

.dropzone strong,
.dropzone small {
  display: block;
}

.dropzone strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.dropzone small {
  margin-top: 3px;
  color: var(--dim);
  font-size: 0.72rem;
}

.upload-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #1a1105;
  background: var(--amber);
  font-size: 1.2rem;
  font-weight: 900;
}

.url-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.help-text {
  margin: 8px 2px 0;
}

.logo-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid rgba(158, 230, 207, 0.24);
  border-radius: 14px;
  background: rgba(158, 230, 207, 0.055);
}

.logo-preview-box[hidden] {
  display: none;
}

.logo-preview-box img {
  width: 44px;
  height: 44px;
  padding: 4px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.logo-preview-info {
  min-width: 0;
  flex: 1;
}

.logo-preview-info span {
  color: var(--dim);
  font-size: 0.7rem;
}

.logo-preview-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-button {
  padding: 6px;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 750;
}

.logo-options {
  margin-top: 19px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-val {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--amber);
}

.preview-heading {
  margin-bottom: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(158, 230, 207, 0.18);
  border-radius: 99px;
  color: var(--mint);
  background: rgba(158, 230, 207, 0.06);
  font-size: 0.72rem;
  font-weight: 800;
}

.status-badge.error {
  border-color: rgba(255, 141, 141, 0.22);
  color: var(--danger);
  background: rgba(255, 141, 141, 0.07);
}

.status-badge.error i {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 141, 141, 0.1);
}

.preview-stage {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.018) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.018) 75%),
    #100d15;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.preview-canvas-wrapper {
  display: grid;
  min-height: 340px;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  background: #fffdf8;
}

#qrCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 512px;
  aspect-ratio: 1;
}

.scan-hint {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 3px 0;
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.4;
}

.scan-hint span {
  color: var(--amber);
  font-size: 1.1rem;
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.preview-meta span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.69rem;
}

.preview-meta strong {
  color: var(--muted);
}

.actions-group {
  display: grid;
  gap: 9px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 850;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

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

.button.primary {
  border-color: rgba(245, 184, 75, 0.9);
  color: #1b1207;
  background: var(--amber);
  box-shadow: 0 9px 24px rgba(245, 184, 75, 0.18);
}

.button.primary:hover {
  background: #ffc861;
}

.button.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
}

.button.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.075);
}

.button.small {
  min-height: 48px;
}

.btn-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.action-feedback {
  min-height: 18px;
  margin: 0;
  color: var(--mint);
  font-size: 0.74rem;
  text-align: center;
}

.action-feedback.error {
  color: var(--danger);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 32px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.8rem;
}

.site-footer div {
  display: grid;
  gap: 4px;
}

.site-footer strong {
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  text-align: right;
}

@media (max-width: 930px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: relative;
    top: 0;
    grid-row: 1;
  }

  .control-panel {
    grid-row: 2;
  }

  .preview-canvas-wrapper {
    min-height: 280px;
  }

  #qrCanvas {
    max-width: 420px;
  }
}

@media (max-width: 600px) {
  .topbar,
  .app-shell,
  .site-footer {
    width: min(100% - 24px, 1220px);
  }

  .topbar {
    padding: 16px 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .back-link {
    font-size: 0.8rem;
  }

  .workspace {
    gap: 14px;
    padding-top: 12px;
    padding-bottom: 56px;
  }

  .control-panel,
  .preview-panel {
    border-radius: 22px;
  }

  .preview-panel {
    padding: 16px;
  }

  .panel-heading {
    padding: 20px 18px 17px;
  }

  .setting-section {
    padding: 21px 18px 8px;
  }

  .grid-2col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .preview-canvas-wrapper {
    min-height: 0;
  }

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

  .field-meta span:first-child {
    display: none;
  }

  .field-meta {
    justify-content: flex-end;
  }

  .site-footer {
    flex-direction: column;
    padding-bottom: 34px;
  }

  .site-footer p {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
