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

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

.ph {
  position: relative;
  box-sizing: border-box;
  width: min(300px, 86vw);
  padding-top: 40px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.ph__tip {
  position: absolute;
  left: 0;
  top: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 12px;
  background: #17141a;
  color: rgba(255, 247, 230, 0.45);
  font-size: 13px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform-origin: left bottom;
  transform: translateY(-6px) scale(0.94);
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ph__tip::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: #17141a;
  transform: rotate(45deg);
}

.ph.is-open .ph__tip {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ph__seg, .ph__dash {
  transition: color 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ph[data-done="1"] .ph__seg[data-seg="0"],
.ph[data-done="2"] .ph__seg[data-seg="0"],
.ph[data-done="2"] .ph__seg[data-seg="1"],
.ph[data-done="2"] .ph__dash[data-seg="0"],
.ph[data-done="3"] .ph__seg,
.ph[data-done="3"] .ph__dash {
  color: #4cd4a6;
}

.ph__label {
  display: block;
  margin-bottom: 4px;
  color: rgba(23, 20, 26, 0.72);
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
}

.ph__field {
  position: relative;
}

.ph__input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 2px solid rgba(23, 20, 26, 0.22);
  border-radius: 12px;
  background: #ffffff;
  color: #17141a;
  font-family: inherit;
  font-size: 14px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ph__input::placeholder {
  color: rgba(23, 20, 26, 0.38);
  font-weight: 600;
}

.ph__input:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.ph.is-open .ph__input {
  border-color: #2f6df6;
}

.ph[data-done="3"] .ph__input {
  border-color: #479075;
}

.ph.is-demo .ph__input::placeholder {
  color: transparent;
}

.ph__ghost {
  position: absolute;
  left: 14px;
  top: 0;
  color: #17141a;
  font-size: 14px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.ph.is-demo .ph__tip {
  transition: none;
  animation-name: ph-tip;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.ph.is-demo .ph__ghost {
  opacity: 1;
  animation-name: ph-type;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ph.is-demo .ph__input {
  transition: none;
  animation-name: ph-input;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ph.is-demo .ph__seg,
.ph.is-demo .ph__dash {
  transition: none;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ph.is-demo .ph__seg[data-seg="0"] {
  animation-name: ph-s0;
}

.ph.is-demo .ph__dash[data-seg="0"] {
  animation-name: ph-s1;
}

.ph.is-demo .ph__seg[data-seg="1"] {
  animation-name: ph-s1;
}

.ph.is-demo .ph__dash[data-seg="1"] {
  animation-name: ph-s2;
}

.ph.is-demo .ph__seg[data-seg="2"] {
  animation-name: ph-s2;
}

@keyframes ph-tip {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.94);
  }
  17% {
    opacity: 0;
    transform: translateY(-6px) scale(0.94);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  76% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  79% {
    opacity: 0;
    transform: translateY(-6px) scale(0.94);
  }
  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.94);
  }
}
@keyframes ph-type {
  0% {
    clip-path: inset(0 54% 0 0);
  }
  30% {
    clip-path: inset(0 38% 0 0);
  }
  46% {
    clip-path: inset(0 20% 0 0);
  }
  62% {
    clip-path: inset(0 0 0 0);
  }
  84% {
    clip-path: inset(0 54% 0 0);
  }
  100% {
    clip-path: inset(0 54% 0 0);
  }
}
@keyframes ph-input {
  0% {
    border-color: rgba(23, 20, 26, 0.22);
  }
  20% {
    border-color: #2f6df6;
  }
  62% {
    border-color: #479075;
  }
  84% {
    border-color: rgba(23, 20, 26, 0.22);
  }
  100% {
    border-color: rgba(23, 20, 26, 0.22);
  }
}
@keyframes ph-s0 {
  0% {
    color: #4cd4a6;
  }
  100% {
    color: #4cd4a6;
  }
}
@keyframes ph-s1 {
  0% {
    color: rgba(255, 247, 230, 0.45);
  }
  46% {
    color: #4cd4a6;
  }
  84% {
    color: rgba(255, 247, 230, 0.45);
  }
  100% {
    color: rgba(255, 247, 230, 0.45);
  }
}
@keyframes ph-s2 {
  0% {
    color: rgba(255, 247, 230, 0.45);
  }
  62% {
    color: #4cd4a6;
  }
  84% {
    color: rgba(255, 247, 230, 0.45);
  }
  100% {
    color: rgba(255, 247, 230, 0.45);
  }
}
@media (max-width: 360px) {
  .ph {
    padding-top: 32px;
  }
  .ph__input {
    height: 36px;
    line-height: 32px;
  }
  .ph__ghost {
    line-height: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ph.is-demo .ph__tip,
  .ph.is-demo .ph__ghost,
  .ph.is-demo .ph__input,
  .ph.is-demo .ph__seg,
  .ph.is-demo .ph__dash {
    animation: none !important;
  }
  .ph.is-demo .ph__tip {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  .ph.is-demo .ph__ghost {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
  .ph.is-demo .ph__seg,
  .ph.is-demo .ph__dash {
    color: #4cd4a6;
  }
  .ph.is-demo .ph__input {
    border-color: #479075;
  }
  .ph__tip, .ph__seg, .ph__dash, .ph__input {
    transition: none;
  }
}
