/* QR-Aufsteller (/qr-aufsteller). Die Karte ist in mm gebaut, damit Vorschau
   und Druck identisch sind. Die Vorschau skaliert sie per JS auf die Spalte. */

/* ---------- Formular ---------- */

.qa-fieldset {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.qa-fieldset legend {
  margin-bottom: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading-color, #1f1433);
}

.qa-switch,
.qa-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.qa-switch label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #ddd6e8;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
}

.qa-switch label:has(input:checked) {
  border-color: var(--accent-color, #742372);
  background: #f6eef8;
}

.qa-theme {
  position: relative;
  flex: 1 1 0;
  min-width: 90px;
  cursor: pointer;
}

.qa-theme input {
  position: absolute;
  opacity: 0;
}

.qa-theme span {
  display: block;
  padding: 18px 8px 10px;
  border: 2px solid transparent;
  border-radius: 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.qa-theme--klassisch span { background: #fff; color: #1f1433; box-shadow: inset 0 0 0 1px #e4dfee; }
.qa-theme--elegant span { background: #f7f1e8; color: #3b2f24; }
.qa-theme--nacht span { background: linear-gradient(135deg, #2a1458, #742372); color: #fff; }

.qa-theme input:checked + span {
  border-color: var(--accent-color, #742372);
}

.qa-theme input:focus-visible + span {
  outline: 2px solid var(--accent-color, #742372);
  outline-offset: 2px;
}

.qa-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 26px;
}

.qa-actions .btn-hero {
  border: 0;
}

.qa-secondary {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-color, #742372);
  font-weight: 600;
}

.qa-secondary:hover {
  text-decoration: underline;
}

/* ---------- Vorschau ---------- */

.qa-preview-wrap {
  position: sticky;
  top: 100px;
}

.qa-preview-label {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #6b6b7b;
}

.qa-preview {
  box-sizing: content-box;
  overflow: hidden;
  padding: 18px;
  border-radius: 14px;
  background: #f1edf6;
}

.qa-preview .qa-card {
  transform-origin: top left;
  box-shadow: 0 10px 34px rgba(42, 20, 88, 0.16);
}

.qa-preview-hint {
  margin-top: 14px;
  font-size: 0.9rem;
  color: #6b6b7b;
}

.qa-scan-warning {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff4e0;
  color: #7a4b00;
  font-size: 0.9rem;
}

/* ---------- Karte ---------- */

.qa-card {
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.qa-card-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.qa-card-kicker {
  font-size: 4.2mm;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.qa-card-title {
  margin: 2mm 0 4mm;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 11mm;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.qa-card-text {
  font-size: 4.6mm;
  line-height: 1.4;
}

.qa-card-pin {
  margin-top: 4mm;
  font-size: 3.6mm;
  line-height: 1.35;
  opacity: 0.85;
}

.qa-card-credit {
  position: absolute;
  right: 6mm;
  bottom: 4mm;
  font-size: 2.6mm;
  opacity: 0.55;
}

/* Querformat: eine Haelfte eines A4-Blatts, zum Zelt gefaltet */
.qa-card--zelt {
  display: grid;
  grid-template-columns: 66mm 1fr;
  align-items: center;
  gap: 12mm;
  width: 210mm;
  height: 148.5mm;
  padding: 16mm 18mm;
}

/* Hochformat A6: ein Viertel eines A4-Blatts */
.qa-card--a6 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 105mm;
  height: 148.5mm;
  padding: 9mm 9mm 11mm;
  text-align: center;
}

.qa-card--a6 .qa-card-body { display: contents; }
.qa-card--a6 .qa-card-kicker { order: 1; font-size: 3.4mm; }
.qa-card--a6 .qa-card-title { order: 2; font-size: 8mm; margin: 1.5mm 0 4mm; }
.qa-card--a6 .qa-card-qr { order: 3; width: 58mm; }
.qa-card--a6 .qa-card-text { order: 4; margin-top: 4mm; font-size: 3.8mm; }
.qa-card--a6 .qa-card-pin { order: 5; margin-top: 2.5mm; font-size: 3mm; }
.qa-card--a6 .qa-card-credit { right: 0; left: 0; bottom: 3.5mm; text-align: center; }

/* Designs */
.qa-theme-klassisch { background: #fff; color: #1f1433; }
.qa-theme-klassisch .qa-card-kicker { color: #742372; }

.qa-theme-elegant { background: #f7f1e8; color: #3b2f24; box-shadow: inset 0 0 0 3mm #f7f1e8, inset 0 0 0 3.3mm #a8824f; }
.qa-theme-elegant .qa-card-kicker { color: #a8824f; }
.qa-theme-elegant .qa-card-title { font-style: italic; font-weight: 600; }

.qa-theme-nacht { background: linear-gradient(135deg, #2a1458 0%, #742372 100%); color: #fff; }
.qa-theme-nacht .qa-card-kicker { color: #e9c9ff; }
.qa-theme-nacht .qa-card-qr { padding: 1.5mm; border-radius: 3mm; background: #fff; }

/* ---------- Druckbogen ---------- */

@media screen {
  #qaPrintSheet { display: none; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body > *:not(#qaPrintSheet) { display: none !important; }

  #qaPrintSheet {
    display: grid;
    width: 210mm;
    height: 296.5mm;
    overflow: hidden;
  }

  .qa-sheet-cell {
    position: relative;
    overflow: hidden;
  }

  .qa-sheet--zelt { grid-template-rows: 1fr 1fr; }
  /* Obere Haelfte kopfueber: nach dem Falten zeigt der Aufsteller nach beiden Seiten */
  .qa-sheet--zelt .qa-sheet-cell:first-child { transform: rotate(180deg); }
  .qa-sheet--zelt .qa-sheet-cell:first-child::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    border-top: 0.2mm dashed rgba(0, 0, 0, 0.25);
  }

  .qa-sheet--a6 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .qa-sheet--a6 .qa-sheet-cell { outline: 0.2mm dashed rgba(0, 0, 0, 0.25); outline-offset: -0.1mm; }

  .qa-sheet .qa-card { box-shadow: none; transform: none !important; }
  .qa-sheet .qa-theme-elegant { box-shadow: inset 0 0 0 3mm #f7f1e8, inset 0 0 0 3.3mm #a8824f; }
}
