:root {
  --paper: #fffaf5;
  --peach: #ffe5cf;
  --coral: #e87557;
  --coral-dark: #ca593e;
  --ink: #392c27;
  --muted: #785f54;
  --danger: #a7352a;
  --radius: 28px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 8%, rgba(255, 255, 255, 0.95), transparent 30%),
    linear-gradient(145deg, var(--paper), var(--peach));
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.58;
}

.ambient-one {
  width: 220px;
  height: 220px;
  top: -90px;
  right: -80px;
  background: #ffcba7;
}

.ambient-two {
  width: 170px;
  height: 170px;
  bottom: -70px;
  left: -60px;
  background: #ffeccc;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: min(100%, 430px);
  padding: 30px 22px 24px;
  text-align: center;
  border: 1px solid rgba(232, 117, 87, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 60px rgba(114, 65, 40, 0.14);
  backdrop-filter: blur(12px);
}

.brand-mark {
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 8px 12px rgba(232, 117, 87, 0.18));
}

.eyebrow {
  margin: 0;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

h1 {
  margin: 9px 0 8px;
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.description,
.instruction {
  color: var(--muted);
  line-height: 1.65;
}

.description {
  margin: 0 auto;
  font-size: 15px;
}

.qr-frame {
  width: min(78vw, 292px);
  margin: 22px auto 12px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(57, 44, 39, 0.08);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(74, 42, 28, 0.1);
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.qr-frame figcaption {
  padding-top: 7px;
  color: #90776a;
  font-size: 12px;
}

.expiry {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #7a4e35;
  background: #fff0df;
  font-size: 13px;
  line-height: 1.5;
}

.expiry[data-state="expiring"] {
  color: #8b3b28;
  background: #ffe2d7;
  font-weight: 700;
}

.expiry[data-state="expired"] {
  color: var(--danger);
  background: #ffe4df;
  font-weight: 750;
}

button {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 0;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  box-shadow: 0 9px 20px rgba(232, 117, 87, 0.28);
}

.primary:active {
  transform: translateY(1px);
}

.secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid #e7d3c6;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.instruction {
  margin: 14px 4px 0;
  font-size: 13px;
}

.steps {
  margin: 14px 0 0;
  padding: 14px;
  list-style: none;
  text-align: left;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  line-height: 1.65;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 7px 0;
  font-size: 13px;
}

.steps span {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--coral);
  font-size: 12px;
  font-weight: 750;
}

.toast {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 700;
}

.copy-fallback {
  position: fixed;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.trust-note {
  margin: 12px 0 0;
  color: #a08b80;
  font-size: 11px;
}

.noscript {
  margin: 0;
  padding: 12px;
  text-align: center;
  color: #fff;
  background: var(--danger);
}

@media (max-width: 360px) {
  .card {
    padding: 24px 16px;
  }

  .qr-frame {
    width: min(76vw, 260px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: arrive 0.45s ease-out both;
  }

  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }
}
