:root {
  color-scheme: light;
  --qr-orange: #ff4f1f;
  --ink: #3f3f3f;
  --danger: #b42318;
  --content-shift-y: -5.2%;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ff5a21;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background: #ff5a21;
  overflow-x: hidden;
}

.template {
  position: relative;
  width: min(100vw, 430px);
  aspect-ratio: 1260 / 2736;
  flex: 0 0 auto;
  overflow: hidden;
}

.template-stage {
  position: absolute;
  inset: 0;
  transform: translateY(var(--content-shift-y));
  transform-origin: top center;
}

.template-image {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}

.time-overlay {
  position: absolute;
  left: 29.45%;
  top: 21.65%;
  width: 41.1%;
  height: 4.85%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #424242;
  font-size: min(8.85vw, 38px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.qr-button {
  position: absolute;
  left: 25.48%;
  top: 31.03%;
  width: 48.81%;
  aspect-ratio: 1;
  border: 0;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

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

.qr-canvas,
.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.qr-text,
.loading {
  width: 100%;
  color: #9a9a9a;
  font-size: min(4vw, 17px);
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}

.expired-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(80, 80, 80, 0.74);
  color: #ffffff;
  font-size: min(4.55vw, 19.5px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.card-date {
  position: absolute;
  left: 32.75%;
  top: 58.65%;
  width: 34.5%;
  height: 2.6%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: #9a9a9a;
  font-size: min(3.95vw, 17px);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}

.status-text {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 61.5%;
  margin: 0;
  min-height: 20px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
}

.status-text:empty {
  visibility: hidden;
}

.status-text.error {
  color: #ffffff;
  font-weight: 700;
}

.token-dialog {
  width: min(100% - 32px, 360px);
  border: 0;
  border-radius: 8px;
  padding: 0;
}

.token-dialog::backdrop {
  background: rgba(0, 0, 0, 0.36);
}

.token-form {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.token-form label {
  font-weight: 700;
}

.token-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 12px;
}

.token-form button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: #ff5a21;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}
