html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ff4d1f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.pin__row {
  position: relative;
  display: flex;
  gap: 8px;
}

.pin__box {
  position: relative;
  width: 38px;
  height: 46px;
}

.pin__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 247, 230, 0.28);
  border-radius: 12px;
  background: rgba(255, 247, 230, 0.08);
  color: #fff7e6;
  text-align: center;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  outline: none;
  transition: border-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.pin__input:focus {
  border-color: #17141a;
}

.pin__ghost {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff7e6;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}

.pin__scramble {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #17141a;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}

.pin__box.is-scrambling .pin__input {
  color: transparent;
  caret-color: transparent;
}

.pin__box.is-scrambling .pin__scramble {
  opacity: 1;
}

.pin.is-demo .pin__ghost {
  animation: pin-ghost-hold 2s linear infinite;
}

.pin.is-demo .pin__box:nth-child(1) .pin__ghost {
  animation-delay: 0ms;
}

.pin.is-demo .pin__box:nth-child(2) .pin__ghost {
  animation-delay: 60ms;
}

.pin.is-demo .pin__box:nth-child(3) .pin__ghost {
  animation-delay: 120ms;
}

.pin.is-demo .pin__box:nth-child(4) .pin__ghost {
  animation-delay: 180ms;
}

.pin.is-demo .pin__box:nth-child(5) .pin__ghost {
  animation-delay: 240ms;
}

.pin.is-demo .pin__box:nth-child(6) .pin__ghost {
  animation-delay: 300ms;
}

@keyframes pin-ghost-hold {
  0%, 100% {
    opacity: 0;
  }
  7% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  94% {
    opacity: 0;
  }
}
.pin__timer {
  position: relative;
  width: 26px;
  height: 26px;
}

.pin__timer-n {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff7e6;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
}

.pin.is-demo .pin__timer-n {
  animation: pin-timer 2s steps(1) infinite;
}

.pin.is-demo .pin__timer-n:nth-child(1) {
  animation-delay: 0ms;
}

.pin.is-demo .pin__timer-n:nth-child(2) {
  animation-delay: 260ms;
}

.pin.is-demo .pin__timer-n:nth-child(3) {
  animation-delay: 520ms;
}

@keyframes pin-timer {
  0%, 13% {
    opacity: 1;
  }
  13.1%, 100% {
    opacity: 0;
  }
}
.pin__resend {
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  background: rgba(255, 247, 230, 0.14);
  color: #17141a;
  opacity: 0.82;
  transform: scale(0.96);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pin.is-demo .pin__resend {
  animation: pin-resend 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes pin-resend {
  0%, 86% {
    opacity: 0.82;
    transform: scale(0.96);
  }
  94%, 100% {
    opacity: 1;
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pin__ghost, .pin__ghost--dot, .pin__ghost--digit, .pin__caret, .pin__signal,
  .pin__row, .pin__timer-n, .pin__resend, .pin__input, .pin__scramble {
    animation: none !important;
    transition: none !important;
  }
  .pin.is-demo .pin__ghost,
  .pin.is-demo .pin__ghost--digit {
    opacity: 1;
  }
  .pin.is-demo .pin__ghost--dot {
    opacity: 0;
  }
  .pin.is-demo .pin__caret {
    opacity: 0.9;
    transform: translateX(230px);
  }
  .pin.is-demo .pin__signal {
    opacity: 1;
    transform: scale(1);
  }
  .pin.is-demo .pin__signal--toggle::before {
    transform: translateX(16px);
  }
  .pin.is-demo .pin__resend {
    opacity: 1;
    transform: scale(1);
  }
  .pin__box.is-scrambling .pin__input {
    color: #fff7e6;
    caret-color: auto;
  }
  .pin__box.is-scrambling .pin__scramble {
    opacity: 0;
  }
}
