:root {
  --red: #b92335;
  --red-dark: #941b2b;
  --cream: #f5ebdd;
  --cream-dark: #eadbc8;
  --white: #ffffff;
  --ink: #292525;
  --muted: #81756c;
  --line: #e8ded2;
  --soft: #faf7f2;
  --font: "Manrope", sans-serif;
  --mono: "DM Mono", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, textarea {
  font: inherit;
}

button {
  color: inherit;
}

.topbar {
  height: 74px;
  max-width: 1240px;
  margin: auto;
  padding: 0 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(55,40,30,.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--red);
  border-radius: 7px;
  font-size: 16px;
  box-shadow: 0 4px 13px rgba(185,35,53,.18);
}

.brand-muted {
  color: #998b7e;
  font-weight: 500;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8c7c6d;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.2px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #a93442;
  border-radius: 50%;
  box-shadow: 0 0 9px rgba(185,35,53,.25);
}

.page {
  width: min(100% - 48px, 1080px);
  margin: auto;
  padding: 76px 0 68px;
}

.hero {
  margin-bottom: 37px;
  animation: rise-in .65s ease both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #8c7868;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.8px;
}

.eyebrow > span {
  width: 20px;
  height: 1px;
  background: var(--red);
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

h1 {
  color: var(--ink);
  font-size: clamp(43px, 7vw, 67px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -3.6px;
}

h1 span {
  color: var(--red);
}

.hero p {
  margin-top: 13px;
  color: #897c70;
  font-size: 13px;
}

.hero-stamp {
  width: 82px;
  height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #d6c6b5;
  border-radius: 50%;
  color: var(--red);
  transform: rotate(-9deg);
}

.hero-stamp span,
.hero-stamp small {
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 1px;
}

.hero-stamp strong {
  font-size: 27px;
  line-height: 1.15;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 17px;
  align-items: stretch;
  animation: rise-in .75s .08s ease both;
}

.editor-card,
.preview-card {
  min-width: 0;
  background: var(--white);
  border: 1px solid rgba(90,65,45,.09);
  border-radius: 13px;
  box-shadow: 0 18px 55px rgba(86,55,32,.065);
}

.editor-card {
  padding: 27px;
}

.preview-card {
  display: flex;
  flex-direction: column;
  padding: 27px 23px 22px;
}

.card-heading,
.preview-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.section-label {
  color: #a09285;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1.3px;
}

.card-heading h2,
.preview-top h2 {
  margin-top: 7px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.5px;
}

.step-number {
  color: #d8c7b7;
  font-family: var(--mono);
  font-size: 11px;
}

.type-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 23px;
}

.type-tab {
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #faf7f2;
  border: 1px solid #eee5db;
  border-radius: 6px;
  color: #897b6e;
  font-size: 13px;
  cursor: pointer;
  transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease;
}

.type-tab span {
  font-size: 10px;
  font-weight: 600;
}

.type-tab:hover {
  border-color: #d8b9ae;
  transform: translateY(-2px);
}

.type-tab.active {
  color: white;
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 5px 13px rgba(185,35,53,.15);
}

.form-section {
  margin-top: 24px;
  animation: fade-in .2s ease both;
}

.form-section.hidden {
  display: none;
}

.form-section label,
.color-control label,
.size-heading label {
  display: block;
  margin-bottom: 9px;
  color: #837568;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
}

.form-section input,
.form-section textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  color: var(--ink);
  background: #fcfaf7;
  border: 1px solid #e9e0d7;
  border-radius: 6px;
  outline: none;
  font-size: 11px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-section input {
  height: 45px;
}

.form-section textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.7;
}

.form-section input:focus,
.form-section textarea:focus {
  background: white;
  border-color: #c47a81;
  box-shadow: 0 0 0 3px rgba(185,35,53,.07);
}

.form-section input::placeholder,
.form-section textarea::placeholder {
  color: #b2a69a;
}

.field-note {
  margin-top: 8px;
  color: #a09285;
  font-size: 9px;
}

.secondary-label {
  margin-top: 17px;
}

.secondary-label span {
  color: #b5a89c;
  font-size: 8px;
}

.divider {
  height: 1px;
  margin: 27px 0 24px;
  background: #eee7df;
}

.customization-heading {
  margin-bottom: 22px;
}

.color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.color-picker-wrap {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 5px 10px;
  background: #fcfaf7;
  border: 1px solid #e9e0d7;
  border-radius: 6px;
}

.color-picker-wrap input[type="color"] {
  width: 29px;
  height: 29px;
  padding: 2px;
  background: white;
  border: 1px solid #e1d8cf;
  border-radius: 5px;
  cursor: pointer;
}

.color-picker-wrap span {
  color: #66594e;
  font-family: var(--mono);
  font-size: 10px;
}

.size-control {
  margin-top: 23px;
}

.size-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.size-heading label {
  margin-bottom: 0;
}

.size-heading > span {
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
}

.size-control input[type="range"] {
  width: 100%;
  margin-top: 15px;
  accent-color: var(--red);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #ad9e91;
  font-family: var(--mono);
  font-size: 8px;
}

.generate-button {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  color: white;
  background: linear-gradient(110deg, #c02d3e, #a51e30);
  border: 1px solid #a51e30;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 17px rgba(185,35,53,.14);
  transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.generate-button span {
  font-size: 15px;
}

.generate-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.07);
  box-shadow: 0 9px 22px rgba(185,35,53,.2);
}

.generate-button:active {
  transform: translateY(0);
}

.privacy-note {
  margin-top: 13px;
  color: #a09386;
  text-align: center;
  font-size: 9px;
}

.privacy-note span {
  margin-right: 5px;
  color: #78936e;
  font-size: 8px;
}

/* PREVIEW */

.preview-top {
  align-items: center;
}

.preview-live {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: #8d7e71;
  background: #faf7f2;
  border: 1px solid #eee5db;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 1px;
}

.preview-live i {
  width: 6px;
  height: 6px;
  display: block;
  background: #8b9a75;
  border-radius: 50%;
}

.qr-stage {
  position: relative;
  width: 100%;
  min-height: 335px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 25px;
  padding: 22px;
  overflow: hidden;
  background-color: #f8f4ed;
  background-image: radial-gradient(#e8ded2 0.7px, transparent 0.7px);
  background-size: 12px 12px;
  border: 1px solid #eee5db;
  border-radius: 9px;
}

.qr-placeholder {
  max-width: 220px;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.placeholder-symbol {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  color: var(--red);
  background: #f1e5dc;
  border: 1px solid #e6d5c8;
  border-radius: 13px;
  font-size: 31px;
}

.qr-placeholder strong {
  color: #55483e;
  font-size: 12px;
}

.qr-placeholder p {
  margin-top: 7px;
  color: #a09285;
  font-size: 10px;
  line-height: 1.6;
}

#qrcode {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: white;
  border-radius: 5px;
  box-shadow: 0 9px 30px rgba(55,35,20,.12);
  animation: qr-appear .35s cubic-bezier(.2,.8,.2,1) both;
}

#qrcode canvas,
#qrcode img {
  display: block;
  max-width: 100%;
  height: auto;
}

.preview-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: #a09285;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .7px;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  margin-top: 19px;
}

.download-button,
.copy-button {
  height: 45px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  color: #76675b;
  background: white;
  border: 1px solid #e5dacf;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.download-button span,
.copy-button span {
  font-size: 16px;
}

.download-button:hover:not(:disabled),
.copy-button:hover:not(:disabled) {
  color: var(--red);
  background: #fcf5f1;
  border-color: #d8b3ac;
  transform: translateY(-2px);
}

.download-button:disabled,
.copy-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.preview-note {
  min-height: 16px;
  margin-top: 13px;
  color: #a09285;
  text-align: center;
  font-size: 9px;
  line-height: 1.5;
}

/* BOTTOM STRIP */

.bottom-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
  margin-top: 23px;
  animation: rise-in .8s .15s ease both;
}

.bottom-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(100,70,45,.08);
  border-radius: 8px;
  transition: transform .22s ease, box-shadow .22s ease;
}

.bottom-strip > div:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(86,55,32,.07);
}

.strip-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: var(--red);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 10px;
}

.bottom-strip strong {
  color: #4a3c32;
  font-size: 10px;
  font-weight: 800;
}

.bottom-strip p {
  margin-top: 4px;
  color: #998a7c;
  font-size: 9px;
}

.footer {
  max-width: 1240px;
  margin: auto;
  padding: 22px 34px 27px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: #99897b;
  border-top: 1px solid rgba(55,40,30,.1);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 1px;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 25px;
  padding: 11px 17px;
  color: white;
  background: #332a28;
  border: 1px solid #594744;
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(50,30,20,.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(17px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes qr-appear {
  from {
    opacity: 0;
    transform: scale(.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 800px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-card {
    min-height: 550px;
  }

  .qr-stage {
    min-height: 370px;
  }
}

@media (max-width: 580px) {
  .topbar {
    height: 65px;
    padding: 0 19px;
  }

  .page {
    width: min(100% - 30px, 520px);
    padding: 55px 0 45px;
  }

  h1 {
    font-size: 43px;
    letter-spacing: -2.5px;
  }

  .hero-stamp {
    width: 66px;
    height: 66px;
  }

  .hero-stamp strong {
    font-size: 22px;
  }

  .editor-card {
    padding: 21px 16px;
  }

  .preview-card {
    padding: 22px 16px;
  }

  .type-tabs {
    gap: 5px;
  }

  .type-tab {
    gap: 4px;
    font-size: 11px;
  }

  .type-tab span {
    font-size: 9px;
  }

  .qr-stage {
    min-height: 320px;
  }

  .bottom-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bottom-strip > div {
    padding: 12px;
  }

  .footer {
    padding: 19px;
    font-size: 8px;
  }
}

@media (max-width: 360px) {
  .hero-stamp {
    display: none;
  }

  .color-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}