:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.container {
  max-width: 720px;
  margin: 48px auto;
  padding: 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

p {
  margin-top: 0;
  margin-bottom: 20px;
  color: #4b5563;
}

form {
  margin-bottom: 24px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.required {
  color: #dc2626;
}

textarea,
select,
input[type='color'] {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
}

textarea {
  resize: vertical;
  margin-bottom: 20px;
}

select,
input[type='color'] {
  height: 38px;
  cursor: pointer;
}

input[type='color'] {
  padding: 2px;
}

fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

legend {
  padding: 0 8px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.checkbox-group {
  margin-top: -4px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.checkbox-label input[type='checkbox'] {
  width: auto;
  margin: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.options-toggle {
  margin-top: 24px;
  margin-bottom: 16px;
}

.toggle-btn {
  background: #f3f4f6;
  color: #1f2937;
  border: 1px solid #d1d5db;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-btn:hover {
  background: #e5e7eb;
}

#optionsFieldset {
  max-height: 600px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
  margin-bottom: 20px;
}

#optionsFieldset.hidden {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
}

#generateBtn {
  background: #2563eb;
  color: #fff;
}

#generateBtn:hover {
  background: #1d4ed8;
}

#downloadBtn {
  background: #16a34a;
  color: #fff;
}

#downloadBtn:hover:not(:disabled) {
  background: #15803d;
}

#resetBtn {
  background: #9ca3af;
  color: #fff;
}

#resetBtn:hover {
  background: #6b7280;
}

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

.result {
  min-height: 280px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 20px;
}

#qrcode canvas,
#qrcode img {
  max-width: 100%;
  height: auto;
}
