:root {
  --bg: #f3efe7;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --text: #1f2937;
  --muted: #5b6472;
  --line: rgba(31, 41, 55, 0.12);
  --accent: #0f766e;
  --accent-soft: #d5f5f0;
  --shadow: 0 24px 80px rgba(17, 24, 39, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.12), transparent 28%),
    linear-gradient(180deg, #fcfaf6 0%, var(--bg) 100%);
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
}

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

.page-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.hero-copy h1,
.preview-top h2,
.section-title-row h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 0.94;
}

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

.hero-text {
  max-width: 62ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badges span,
.preview-chip {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 118, 110, 0.16);
  box-shadow: 0 10px 30px rgba(15, 118, 110, 0.08);
  font-size: 0.92rem;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(300px, 1fr);
  gap: 24px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.controls-panel {
  padding: 22px;
}

.controls {
  display: grid;
  gap: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title-row h2,
.preview-top h2 {
  font-size: 1.3rem;
}

.field,
.range-field {
  display: grid;
  gap: 8px;
}

.field span,
.range-head span,
.range-head output {
  font-size: 0.94rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 15px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
}

.field input[type="color"] {
  min-height: 52px;
  padding: 6px;
}

.field textarea {
  resize: vertical;
}

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

.dynamic-fields {
  display: grid;
  gap: 14px;
}

.range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.ghost-button,
.download-panel button {
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ghost-button {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
}

.full-width {
  width: 100%;
}

.ghost-button:hover,
.download-panel button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.12);
}

.preview-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
  align-content: start;
}

.preview-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.preview-stage {
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: calc(var(--radius-xl) - 6px);
  background:
    linear-gradient(45deg, rgba(17, 24, 39, 0.04) 25%, transparent 25%, transparent 75%, rgba(17, 24, 39, 0.04) 75%),
    linear-gradient(45deg, rgba(17, 24, 39, 0.04) 25%, transparent 25%, transparent 75%, rgba(17, 24, 39, 0.04) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.qr-preview {
  width: 100%;
  display: grid;
  place-items: center;
}

.qr-preview canvas,
.qr-preview svg {
  max-width: 100%;
  height: auto;
  animation: qr-in 320ms ease;
  border-radius: 24px;
}

.download-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.download-panel button {
  padding: 14px 16px;
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: white;
  font-weight: 700;
}

.upload-field input[type="file"] {
  padding: 11px;
}

@keyframes qr-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

  .preview-stage {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 18px;
  }

  .controls-panel,
  .preview-panel {
    padding: 18px;
  }

  .inline-grid,
  .download-panel,
  .preview-top {
    grid-template-columns: 1fr;
    display: grid;
  }

  .preview-top {
    gap: 10px;
  }

  .section-title-row {
    align-items: start;
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 14vw, 3.8rem);
  }
}
