/* QR code generator: the text on the left, the code on the right (under each other on a phone) */

.qr-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-large) var(--radius-large);
  background: var(--color-surface);
}

.qr-input {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.qr-label {
  font-size: 13px;
  color: var(--color-muted);
}

.qr-text {
  flex-grow: 1;
  min-height: 160px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.6;
}

.qr-text:focus-visible {
  outline: none;
  border-color: var(--color-teal);
}

.qr-text::placeholder {
  color: var(--color-muted);
  opacity: 0.7;
}

.qr-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.qr-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-copper);
  cursor: pointer;
}

/* The code is always black on white, also in the dark theme: scanners need the contrast. */
.qr-preview {
  aspect-ratio: 1;
  border-radius: var(--radius-medium);
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-preview.is-empty {
  background: var(--color-surface-2);
  border: 1px dashed var(--color-border);
}

.qr-code,
.qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-preview.is-empty .qr-code,
.qr-preview:not(.is-empty) .qr-empty {
  display: none;
}

.qr-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-muted);
}

.tool-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.tool-button:disabled:hover {
  border-color: var(--color-border);
}

@media (max-width: 760px) {
  .qr-panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .qr-preview {
    width: 100%;
    max-width: 360px;
    justify-self: center;
  }
}
