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: 600;
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
}

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

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

.pin__signal {
  position: relative;
  width: 22px;
  height: 22px;
  opacity: 0;
  transform: scale(0.6);
}

.pin__signal--check::before,
.pin__signal--check::after {
  content: "";
  position: absolute;
  background: #17141a;
  border-radius: 2px;
}

.pin__signal--check::before {
  left: 6px;
  top: 12px;
  width: 6px;
  height: 3px;
  transform: rotate(225deg);
  transform-origin: left center;
}

.pin__signal--check::after {
  left: 6px;
  top: 12px;
  width: 13px;
  height: 3px;
  transform: rotate(-45deg);
  transform-origin: left center;
}

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

@keyframes pin-ghost-burst {
  0%, 100% {
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  78% {
    opacity: 0;
  }
}
.pin.is-demo .pin__signal--check {
  animation: pin-signal 2s linear infinite;
}

@keyframes pin-signal {
  0%, 78% {
    opacity: 0;
    transform: scale(0.6);
  }
  86% {
    opacity: 1;
    transform: scale(1.12);
  }
  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 {
    animation: none !important;
    transition: none !important;
  }
  .pin__scramble {
    display: none !important;
  }
  .pin__box.is-scrambling .pin__input {
    color: #fff7e6 !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);
  }
}
