:root {
  color-scheme: light dark;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background-color: #fff7ed;
  color: #1f2937;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 32px 0 24px;
  background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
}

.app {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(320px, 1fr);
  width: min(1100px, 92vw);
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background-color: #ffffff;
  box-shadow: 0 25px 40px rgba(15, 23, 42, 0.1);
}

.controls {
  padding: 32px;
  background: linear-gradient(145deg, #fef3c7 0%, #fb923c 60%, #f97316 100%);
  color: #1f2937;
}

.controls h1 {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 1.75rem;
  font-weight: 600;
  color: #7c2d12;
}

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 0.95rem;
  font-weight: 500;
  color: #7c2d12;
}

.field input[type="url"],
.field select {
  padding: 10px 12px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background-color: rgba(255, 255, 255, 0.9);
  color: #7c2d12;
}

.field input[type="url"]:focus,
.field select:focus,
.field input[type="file"]:focus {
  outline: 2px solid rgba(234, 88, 12, 0.65);
  outline-offset: 2px;
}

.field input[type="color"] {
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(249, 115, 22, 0.4);
  padding: 0;
  background: #ffffff;
  cursor: pointer;
}

.field input[type="range"] {
  width: 100%;
}

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

.actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

button {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

#generate-btn {
  background: linear-gradient(125deg, #fb923c, #f97316);
  color: #fef3c7;
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.35);
}

#download-btn {
  background-color: rgba(255, 255, 255, 0.85);
  color: #9a3412;
  border: 1px solid rgba(249, 115, 22, 0.3);
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.2);
}

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

button:active {
  transform: translateY(1px);
}

.preview {
  position: relative;
  z-index: 0;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  background-color: #fff7ed;
}

.qr-preview {
  width: min(360px, 40vw);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background-color: #fffbeb;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.08),
    0 18px 35px rgba(249, 115, 22, 0.18);
  padding: 20px;
}

.qr-preview canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 16px;
}

.hint {
  margin: 0;
  text-align: center;
  color: #b45309;
  max-width: 320px;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    width: min(640px, 94vw);
  }

  .controls,
  .preview {
    padding: 24px;
  }

  .actions {
    flex-direction: column;
  }
}

.preview::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 20px;
  pointer-events: none;
  z-index: -1;
  border: 1px dashed rgba(249, 115, 22, 0.15);
}

.footer {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: #b45309;
}

.footer a {
  color: #ea580c;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  body {
    padding: 16px 0;
    gap: 16px;
    align-items: stretch;
  }

  .app {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 18px 32px rgba(249, 115, 22, 0.15);
  }

  .controls,
  .preview {
    padding: 20px;
  }

  .preview::after {
    inset: 12px;
    border-radius: 16px;
  }

  .qr-preview {
    width: min(320px, 100%);
    padding: 16px;
  }

  .actions button {
    width: 100%;
  }

  .hint {
    font-size: 0.95rem;
  }
}
