:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --ink: #1a1a1a;
  --muted: #9a9a9a;
  --quote-bg: #cfeee6;
  --quote-text: #3b8f80;
  --dash: #e6e6e6;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.06);
  --radius: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.app {
  width: min(430px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px 18px 36px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 14px;
}

.logo {
  grid-column: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(168, 80, 210, 0.28);
}

.logo img,
.logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.info-btn {
  justify-self: end;
  width: 28px;
  height: 28px;
  border: 1.5px solid #cfcfcf;
  border-radius: 50%;
  background: transparent;
  color: #b0b0b0;
  font: 700 15px/1 Georgia, "Times New Roman", serif;
  font-style: italic;
  cursor: pointer;
  appearance: none;
}

.ticket {
  position: relative;
  filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.06));
}

.ticket-top,
.ticket-bottom {
  background: var(--card);
}

.ticket-top {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  padding-bottom: 28px;
}

.quote {
  background: var(--quote-bg);
  color: var(--quote-text);
  font-size: 12.25px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  padding: 11px 0;
  overflow: hidden;
  white-space: nowrap;
}

.quote-track {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding-left: 16px;
  animation: quote-scroll 22s linear infinite;
}

.quote-sep {
  opacity: 0.7;
}

@keyframes quote-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticket-body {
  padding: 22px 16px 0;
  text-align: center;
}

.transport {
  font-size: 16px;
  font-weight: 500;
  color: #2b2b2b;
}

.purchased {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.amount {
  margin-top: 22px;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 18px 8px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c9f3d8 0%, #d7e7fb 100%);
  color: #3a3a3a;
  font-size: 14.5px;
  font-weight: 500;
}

.status.is-expired {
  background: linear-gradient(90deg, #fde9c4 0%, #f8d4e4 100%);
  color: #5a5a5a;
}

.status.is-expired .status-dot,
.status.is-expired #timer {
  display: none;
}

body.is-expired .qr {
  opacity: 0.32;
  filter: grayscale(1);
}

.status-dot {
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.vehicle {
  margin-top: 22px;
  color: #8d8d8d;
  font-size: 16px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.vehicle strong {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.vehicle-input {
  width: 4.2ch;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  outline: none;
  border-radius: 6px;
}

.vehicle-input:focus {
  background: #f4f4f4;
}

.perforation {
  position: relative;
  height: 28px;
  background: var(--card);
}

.perforation::before,
.perforation::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  transform: translateY(-50%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.perforation::before {
  left: -11px;
}

.perforation::after {
  right: -11px;
}

.dash {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 50%;
  border-top: 1.5px dashed #d9d9d9;
}

.ticket-bottom {
  padding: 8px 22px 6px;
  text-align: center;
}

.qr-wrap {
  position: relative;
  width: min(268px, 72vw);
  margin: 8px auto 0;
  padding: 8px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
}

.qr {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
}

.number {
  margin: 22px 0 18px;
  color: #8b8b8b;
  font-size: 14.5px;
}

.number strong {
  color: #4a4a4a;
  font-weight: 600;
}

.scallop {
  height: 16px;
  background:
    radial-gradient(circle at 14px 16px, var(--bg) 11px, transparent 11.6px);
  background-size: 28px 16px;
  background-repeat: repeat-x;
  background-color: var(--card);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.28);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  z-index: 10;
}

.overlay.is-open {
  display: flex;
}

.sheet {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
}

.sheet h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.sheet p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.sheet-fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sheet-fields label {
  display: grid;
  gap: 6px;
  color: #666;
  font-size: 13px;
}

.sheet-fields input {
  height: 44px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 0 12px;
  font: 600 16px Inter, sans-serif;
  color: var(--ink);
  outline: none;
}

.sheet-fields input:focus {
  border-color: #c44dff;
}

.sheet-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.sheet button,
.sheet-link {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  font: 600 15px Inter, sans-serif;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
}

.sheet button {
  background: #111;
  color: #fff;
}

.sheet-link {
  background: #f3f3f5;
  color: #222;
}

@media (min-width: 760px) {
  body {
    background: #e9eaee;
  }

  .app {
    min-height: calc(100svh - 48px);
    margin-top: 24px;
    background: var(--bg);
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  }
}
