:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #66736f;
  --line: #dfe7e4;
  --brand: #0f3a33;
  --accent: #2d796a;
  --paper: #ffffff;
  --surface: #f4f7f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 58, 51, 0.08), rgba(45, 121, 106, 0.02) 42%, rgba(238, 244, 241, 0.9)),
    var(--surface);
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(620px, 1.22fr);
  gap: 32px;
  align-items: center;
  padding: 36px 0;
}

.editor-panel,
.preview-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(20, 38, 34, 0.08);
}

.editor-panel {
  padding: 32px;
}

.preview-panel {
  padding: 28px;
}

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

.qr-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-row {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 30px;
}

.brand-mark {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: #273632;
}

label span {
  font-size: 0.92rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c9d5d1;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(45, 121, 106, 0.14);
}

.full-span,
.details-form button {
  grid-column: 1 / -1;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, opacity 140ms ease;
}

button:hover:not(:disabled) {
  background: #155247;
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.qr-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  width: 100%;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.qr-output {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12px;
}

.qr-output svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-output span {
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.qr-logo {
  position: absolute;
  width: 15.5%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 10px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 0 0 8px white;
  pointer-events: none;
}

.is-hidden {
  display: none;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.preview-actions button,
.qr-card button {
  background: #1f6155;
}

.status {
  min-height: 24px;
  margin-top: 14px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 2.25rem;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1380px);
    padding: 10px 0;
    gap: 10px;
  }

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

  .brand-row,
  .details-form,
  .preview-grid,
  .preview-actions {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
  }

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