/* Reseller page — the card is an airmail envelope; the letter inside holds the form. */

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--white);
  background-image: radial-gradient(var(--line) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.envelope {
  width: 100%;
  max-width: 430px;
  padding: 9px;
  border-radius: var(--r-lg);
  background: var(--airmail);
  box-shadow: 0 1px 0 rgba(58, 51, 65, 0.04), 0 24px 48px -28px rgba(121, 88, 120, 0.35);
}

.letter {
  background: var(--white);
  border-radius: calc(var(--r-lg) - 7px);
  padding: 28px 24px 26px;
}

.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

h1 {
  font-size: clamp(1.6rem, 6.4vw, 1.95rem);
  font-variation-settings: 'opsz' 96;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--grey);
  font-size: 0.9375rem;
}

/* Postage stamp: a perforated pink frame around a white face */
.stamp {
  flex: none;
  padding: 5px;
  background: radial-gradient(circle, transparent 2.2px, var(--pink) 2.8px) -1px -1px / 8px 8px;
  transform: rotate(4deg);
}
.stamp svg {
  display: block;
  background: var(--white);
  width: 44px;
  height: 52px;
  padding: 10px 7px;
  border: 1.5px solid var(--pink);
}

.form {
  display: grid;
  gap: 18px;
}

.code-input {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.code-input::placeholder {
  letter-spacing: 0.06em;
}

.get-btn {
  width: 100%;
  margin-top: 4px;
}

.muted {
  color: var(--ink-soft);
  margin: 0;
}
.muted strong {
  color: var(--ink);
  font-weight: 650;
  word-break: break-all;
}

/* Waiting */
.waiting {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 6px 0 2px;
}
.waiting h2 {
  font-size: 1.3rem;
  margin-top: 6px;
}
.mail-icon {
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
.countdown {
  margin: 6px 0 4px;
  font-size: 0.875rem;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}
.row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}
.row .btn {
  flex: 1 1 130px;
}

/* Result */
.result {
  display: grid;
  gap: 14px;
}
.result > * {
  min-width: 0;
}

.ticket {
  position: relative;
  border-radius: var(--r-md);
  background: var(--blue);
  padding: 22px 14px 0;
}
/* tear-off notches */
.ticket::before,
.ticket::after {
  content: '';
  position: absolute;
  bottom: 34px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
}
.ticket::before {
  left: -8px;
}
.ticket::after {
  right: -8px;
}

.digits {
  display: flex;
  justify-content: center;
  gap: clamp(5px, 2vw, 9px);
}
.digit {
  flex: 1 1 0;
  min-width: 0;
  max-width: 50px;
  height: clamp(50px, 15vw, 62px);
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--white);
  font-family: var(--display);
  font-size: clamp(1.7rem, 8vw, 2.2rem);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  animation: drop 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.digit:nth-child(3) {
  margin-right: clamp(4px, 2vw, 10px);
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ticket-foot {
  margin-top: 22px;
  padding: 10px 4px 12px;
  border-top: 2px dashed rgba(121, 179, 226, 0.55);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8125rem;
  color: #46708f;
  font-variant-numeric: tabular-nums;
}

.copy-btn {
  width: 100%;
}
.copy-btn.copied {
  background: var(--ok-bg);
  color: var(--ok);
}
.used-note {
  text-align: center;
}

.link-btn {
  justify-self: center;
  background: none;
  border: 0;
  padding: 6px 4px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--pink-deep);
  text-underline-offset: 4px;
  cursor: pointer;
}

.foot {
  margin: 22px 0 0;
  font-size: 0.8125rem;
  color: var(--grey);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .letter {
    padding: 36px 34px 32px;
  }
}
