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

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

.pw {
  box-sizing: border-box;
  width: min(320px, 90vw);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  color: #17141a;
}

.pw__card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background-color: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.pw__row {
  display: block;
}

.pw__box {
  box-sizing: border-box;
  padding: 4px 12px;
  border: 1px solid rgba(23, 20, 26, 0.16);
  border-radius: 8px;
  background-color: #ffffff;
  transition: border-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pw__box:focus-within {
  border-color: #2f6df6;
}

.pw__lab {
  display: block;
  font-size: 10px;
  line-height: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(23, 20, 26, 0.72);
}

.pw__field {
  position: relative;
  height: 20px;
}

.pw__in {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 20px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: #17141a;
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.pw__in:focus {
  outline: none;
}

.pw__box:focus-within {
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.2);
}

.pw__ghost {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  font-size: 13px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #17141a;
  white-space: nowrap;
  clip-path: inset(0 100% 0 0);
}

.pw:not(.is-demo) .pw__ghost {
  display: none;
}

.pw__meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.pw__cell {
  display: block;
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background-color: rgba(23, 20, 26, 0.14);
}

.pw__fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background-color: #2f6df6;
  transform: scaleX(0);
  transform-origin: left center;
}

.pw__fill[data-n="4"] {
  background-color: #4cd4a6;
}

.pw:not(.is-demo)[data-strength="1"] .pw__cell:nth-child(-n+1) .pw__fill,
.pw:not(.is-demo)[data-strength="2"] .pw__cell:nth-child(-n+2) .pw__fill,
.pw:not(.is-demo)[data-strength="3"] .pw__cell:nth-child(-n+3) .pw__fill,
.pw:not(.is-demo)[data-strength="4"] .pw__cell:nth-child(-n+4) .pw__fill {
  transform: scaleX(1);
}

.pw__hint {
  position: relative;
  margin: 0;
  height: 16px;
}

.pw__msg {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  color: rgba(23, 20, 26, 0.6);
  white-space: nowrap;
  opacity: 0;
}

.pw__msg[data-msg=bad] {
  color: #c2361a;
}

.pw__msg[data-msg=ok],
.pw__msg[data-msg=saved] {
  color: #2f6df6;
}

.pw__save {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 12px;
  background-color: rgba(23, 20, 26, 0.14);
  color: rgba(23, 20, 26, 0.8);
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1), color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.pw:not(.is-demo)[data-msg=idle] .pw__msg[data-msg=idle],
.pw:not(.is-demo)[data-msg=bad] .pw__msg[data-msg=bad],
.pw:not(.is-demo)[data-msg=ok] .pw__msg[data-msg=ok],
.pw:not(.is-demo)[data-msg=saved] .pw__msg[data-msg=saved] {
  opacity: 1;
}

.pw:not(.is-demo)[data-bad=true] .pw__box[data-box=confirm] {
  border-color: #c2361a;
  background-color: #ffe0d8;
}

.pw__save[aria-disabled=false] {
  background-color: #2f6df6;
  color: #fff7e6;
}

.pw.is-demo .pw__ghost {
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-timing-function: steps(10, end);
}

.pw.is-demo .pw__ghost[data-g=cur] {
  animation-name: pw-type-cur;
}

.pw.is-demo .pw__ghost[data-g=new] {
  animation-name: pw-type-new;
}

.pw.is-demo .pw__ghost[data-g=confirm] {
  animation-name: pw-type-confirm;
}

@keyframes pw-type-cur {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  12.5% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes pw-type-new {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  16.67% {
    clip-path: inset(0 100% 0 0);
  }
  39.58% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes pw-type-confirm {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  45.83% {
    clip-path: inset(0 100% 0 0);
  }
  54.17% {
    clip-path: inset(0 46% 0 0);
  }
  66.67% {
    clip-path: inset(0 46% 0 0);
  }
  79.17% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}
.pw.is-demo .pw__fill {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.pw.is-demo .pw__fill[data-n="1"] {
  animation-name: pw-fill-1;
}

.pw.is-demo .pw__fill[data-n="2"] {
  animation-name: pw-fill-2;
}

.pw.is-demo .pw__fill[data-n="3"] {
  animation-name: pw-fill-3;
}

.pw.is-demo .pw__fill[data-n="4"] {
  animation-name: pw-fill-4;
}

@keyframes pw-fill-1 {
  0% {
    transform: scaleX(0);
  }
  18.75% {
    transform: scaleX(0);
  }
  25% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
@keyframes pw-fill-2 {
  0% {
    transform: scaleX(0);
  }
  25% {
    transform: scaleX(0);
  }
  31.25% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
@keyframes pw-fill-3 {
  0% {
    transform: scaleX(0);
  }
  31.25% {
    transform: scaleX(0);
  }
  37.5% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
@keyframes pw-fill-4 {
  0% {
    transform: scaleX(0);
  }
  37.5% {
    transform: scaleX(0);
  }
  43.75% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
.pw.is-demo .pw__box[data-box=confirm] {
  animation-name: pw-confirm-skin;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes pw-confirm-skin {
  0% {
    border-color: rgba(23, 20, 26, 0.16);
    background-color: #ffffff;
  }
  54.17% {
    border-color: #c2361a;
    background-color: #ffe0d8;
  }
  79.17% {
    border-color: #2f6df6;
    background-color: #ffffff;
  }
  100% {
    border-color: #2f6df6;
    background-color: #ffffff;
  }
}
.pw.is-demo .pw__msg {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.pw.is-demo .pw__msg[data-msg=idle] {
  animation-name: pw-msg-idle;
}

.pw.is-demo .pw__msg[data-msg=bad] {
  animation-name: pw-msg-bad;
}

.pw.is-demo .pw__msg[data-msg=ok] {
  animation-name: pw-msg-ok;
}

.pw.is-demo .pw__msg[data-msg=saved] {
  animation-name: pw-msg-none;
}

@keyframes pw-msg-idle {
  0% {
    opacity: 1;
  }
  54.17% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes pw-msg-bad {
  0% {
    opacity: 0;
  }
  54.17% {
    opacity: 1;
  }
  79.17% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes pw-msg-ok {
  0% {
    opacity: 0;
  }
  79.17% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes pw-msg-none {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.pw.is-demo .pw__save {
  animation-name: pw-save-skin, pw-save-pop;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
}

@keyframes pw-save-skin {
  0% {
    background-color: rgba(23, 20, 26, 0.14);
    color: rgba(23, 20, 26, 0.8);
  }
  79.17% {
    background-color: #2f6df6;
    color: #fff7e6;
  }
  100% {
    background-color: #2f6df6;
    color: #fff7e6;
  }
}
@keyframes pw-save-pop {
  0% {
    transform: scale(1);
  }
  79.17% {
    transform: scale(0.96);
  }
  83.33% {
    transform: scale(1.04);
  }
  89.58% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .pw__card {
    gap: 4px;
    padding: 8px;
  }
  .pw__box {
    padding: 0 8px;
  }
  .pw__lab {
    font-size: 9px;
    line-height: 12px;
  }
  .pw__field {
    height: 18px;
  }
  .pw__in {
    height: 18px;
    font-size: 11px;
    line-height: 18px;
  }
  .pw__ghost {
    font-size: 11px;
    line-height: 18px;
  }
  .pw__cell {
    height: 4px;
  }
  .pw__hint {
    height: 12px;
  }
  .pw__msg {
    font-size: 9px;
    line-height: 12px;
  }
  .pw__save {
    height: 24px;
    font-size: 11px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pw.is-demo .pw__ghost,
  .pw.is-demo .pw__fill,
  .pw.is-demo .pw__box[data-box=confirm],
  .pw.is-demo .pw__msg,
  .pw.is-demo .pw__save {
    animation: none !important;
  }
  .pw.is-demo .pw__ghost {
    clip-path: inset(0 0 0 0) !important;
  }
  .pw.is-demo .pw__fill[data-n="1"],
  .pw.is-demo .pw__fill[data-n="2"],
  .pw.is-demo .pw__fill[data-n="3"],
  .pw.is-demo .pw__fill[data-n="4"] {
    transform: scaleX(1) !important;
  }
  .pw.is-demo .pw__msg[data-msg=ok] {
    opacity: 1 !important;
  }
  .pw.is-demo .pw__save {
    background-color: #2f6df6 !important;
    color: #fff7e6 !important;
  }
  .pw__box,
  .pw__save {
    transition: none !important;
  }
}
