/* Zebra Boarding Pass-o-Matic: maximum comic, minimum shame */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Comic Sans MS", "Comic Neue", cursive;
  color: #1a1a2e;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.9) 0 60px, transparent 61px),
    radial-gradient(circle at 25% 24%, rgba(255, 255, 255, 0.9) 0 45px, transparent 46px),
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.85) 0 50px, transparent 51px),
    radial-gradient(circle at 88% 16%, rgba(255, 255, 255, 0.85) 0 38px, transparent 39px),
    linear-gradient(180deg, #aee3ff 0%, #d8f3ff 55%, #ffe9f7 100%);
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 18px 12px 4px;
}

h1 {
  font-family: "Bangers", "Comic Sans MS", cursive;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 2px;
  margin: 0 0 6px;
  text-shadow: 3px 3px 0 #ffd166, 6px 6px 0 rgba(26, 26, 46, 0.15);
  transform: rotate(-1deg);
}

marquee {
  background: #1a1a2e;
  color: #ffd166;
  border-radius: 999px;
  padding: 6px 0;
  font-size: 0.9rem;
  max-width: 900px;
  margin: 0 auto;
}

main {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(320px, 480px);
  gap: 26px;
  justify-content: center;
  align-items: start;
  padding: 24px 16px 40px;
}

.card {
  background: #fffdf5;
  border: 3px solid #1a1a2e;
  border-radius: 16px;
  box-shadow: 7px 7px 0 #1a1a2e;
  padding: 18px 20px 22px;
}

.form-card {
  transform: rotate(-0.6deg);
}

.modeToggle {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border: 2.5px solid #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 3px 3px 0 #1a1a2e;
}

.modeBtn {
  flex: 1;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #fffdf5;
  padding: 10px 8px;
}

.modeBtn + .modeBtn {
  border-left: 2.5px solid #1a1a2e;
}

.modeBtn[aria-pressed="true"] {
  background: #1a1a2e;
  color: #ffd166;
}

.modeBtn:hover:not([aria-pressed="true"]) {
  background: #ffe9b0;
  transform: none;
}

/* Professional mode: calm the playground down so the tool reads as serious. */
body[data-mode="pro"] {
  background: linear-gradient(180deg, #eef2f7 0%, #e5eaf1 100%);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body[data-mode="pro"] marquee {
  display: none;
}

body[data-mode="pro"] h1 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: none;
  transform: none;
  color: #1a2b46;
}

body[data-mode="pro"] .card {
  transform: none;
  border-color: #2c3e56;
  box-shadow: 0 6px 20px rgba(26, 43, 70, 0.15);
  border-radius: 10px;
}

body[data-mode="pro"] h2 {
  transform: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body[data-mode="pro"] .btn-print {
  animation: none;
  background: #1a6feb;
}

body[data-mode="pro"] .preview {
  background: #f4f6f9;
  border-style: solid;
}

.preview-card {
  transform: rotate(0.5deg);
  position: sticky;
  top: 12px;
}

h2 {
  font-size: 1.3rem;
  margin: 0 0 12px;
  transform: rotate(-0.5deg);
}

.fine {
  font-size: 0.75rem;
  font-weight: normal;
  font-style: italic;
  opacity: 0.75;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  font-weight: bold;
  gap: 3px;
}

.span2 {
  grid-column: span 2;
}

input,
select {
  font-family: inherit;
  font-size: 1rem;
  padding: 7px 9px;
  border: 2.5px solid #1a1a2e;
  border-radius: 10px;
  background: #fff;
  outline-offset: 2px;
}

input:focus,
select:focus {
  outline: 3px dashed #ff6392;
}

.caps {
  text-transform: uppercase;
}

button {
  font-family: inherit;
  font-weight: bold;
  font-size: 1rem;
  border: 2.5px solid #1a1a2e;
  border-radius: 12px;
  background: #ffd166;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1a2e;
  transition: transform 0.08s;
}

button:hover:not(:disabled) {
  transform: translate(-1px, -1px) rotate(-1deg);
  box-shadow: 4px 4px 0 #1a1a2e;
}

button:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1a1a2e;
}

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

.btn-surprise {
  margin-top: 14px;
  background: #b8f2e6;
  width: 100%;
}

.btn-print {
  background: #ff6392;
  color: #fff;
  font-size: 1.1rem;
  animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 92%, 100% { rotate: 0deg; }
  94% { rotate: 2deg; }
  96% { rotate: -2deg; }
  98% { rotate: 1deg; }
}

.preview {
  background: repeating-linear-gradient(45deg, #f6f2e7 0 12px, #efe9da 12px 24px);
  border: 2.5px dashed #1a1a2e;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: center;
  min-height: 200px;
}

.preview canvas {
  width: min(100%, 340px);
  height: auto;
  background: #fff;
  box-shadow: 0 4px 14px rgba(26, 26, 46, 0.25);
}

/* Landscape (receipt-style) passes want the full panel width */
.preview canvas.landscape {
  width: 100%;
}

details {
  margin: 10px 0 4px;
  font-size: 0.8rem;
}

details code {
  display: block;
  margin-top: 6px;
  padding: 8px;
  background: #1a1a2e;
  color: #b8f2e6;
  border-radius: 8px;
  font-size: 0.72rem;
  overflow-x: auto;
  white-space: pre;
}

.badge {
  font-size: 0.7rem;
  background: #b8f2e6;
  border: 1.5px solid #1a1a2e;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
}

.cloud {
  margin-top: 12px;
  background: #e8f4ff;
  border: 2.5px dashed #1a1a2e;
  border-radius: 12px;
  padding: 8px 14px 10px;
  font-size: 0.85rem;
}

.cloud input {
  width: 100%;
  font-size: 0.85rem;
}

.printbar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.printbar select {
  flex: 1 1 160px;
  min-width: 140px;
}

.status {
  min-height: 1.2em;
  font-size: 0.85rem;
  margin: 10px 2px 0;
}

.status.error {
  color: #c1121f;
  font-weight: bold;
}

.help {
  margin-top: 12px;
  background: #fff3b0;
  border: 2.5px dashed #1a1a2e;
  border-radius: 12px;
  padding: 4px 16px 10px;
  font-size: 0.85rem;
}

.help ol {
  padding-left: 20px;
}

footer {
  text-align: center;
  font-size: 0.75rem;
  padding: 0 16px 28px;
  opacity: 0.8;
}

@media (max-width: 760px) {
  main {
    grid-template-columns: 1fr;
  }

  .preview-card {
    position: static;
  }
}
