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);
}

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

.dm__label {
  display: block;
  margin-bottom: 4px;
  color: #17141a;
  font-size: 11px;
  line-height: 14px;
  font-weight: 700;
}

.dm__field {
  position: relative;
}

.dm__input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 0 40px 0 12px;
  border: 2px solid rgba(255, 247, 230, 0.38);
  border-radius: 12px;
  background: rgba(23, 20, 26, 0.18);
  color: #fff7e6;
  font-family: inherit;
  font-size: 14px;
  line-height: 40px;
  font-weight: 700;
}

.dm__input::placeholder {
  color: rgba(255, 247, 230, 0.5);
  font-weight: 600;
}

.dm__input:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.dm.is-demo .dm__input::placeholder {
  color: transparent;
}

.dm__ghost {
  position: absolute;
  left: 14px;
  top: 0;
  color: #fff7e6;
  font-size: 14px;
  line-height: 44px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.dm__icons {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
}

.dm__ic {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  transform: scale(0.4);
  opacity: 0;
}

.dm__ic--wait {
  color: rgba(255, 247, 230, 0.82);
}

.dm__ic--ok {
  color: #479075;
}

.dm__ic--no {
  color: #4a0f04;
}

.dm[data-state=wait] .dm__ic--wait,
.dm[data-state=ok] .dm__ic--ok,
.dm[data-state=no] .dm__ic--no {
  transform: scale(1);
  opacity: 1;
}

.dm[data-state=wait] .dm__ic--wait {
  animation-name: dm-spin;
  animation-duration: 600ms;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.dm[data-state=ok] .dm__input {
  border-color: #479075;
}

.dm[data-state=no] .dm__input {
  border-color: #4a0f04;
}

.dm__out {
  position: relative;
  height: 16px;
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
}

.dm__msgs {
  position: relative;
  display: block;
  height: 16px;
}

.dm__m {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
}

.dm__m[data-m=wait] {
  color: rgba(255, 247, 230, 0.72);
}

.dm__m[data-m=ok] {
  color: #479075;
}

.dm__m[data-m=no] {
  color: #4a0f04;
}

.dm[data-state=wait] .dm__m[data-m=wait],
.dm[data-state=ok] .dm__m[data-m=ok],
.dm[data-state=no] .dm__m[data-m=no] {
  opacity: 1;
}

.dm__say {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

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

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

.dm.is-demo .dm__ic--wait {
  animation-name: dm-wait, dm-spin;
  animation-duration: 2s, 600ms;
  animation-timing-function: steps(1, end), linear;
  animation-iteration-count: infinite, infinite;
}

.dm.is-demo .dm__ic--ok {
  animation-name: dm-ok;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.dm.is-demo .dm__ic--no {
  animation-name: dm-no;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.dm.is-demo .dm__m {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.dm.is-demo .dm__m[data-m=wait] {
  animation-name: dm-m-wait;
}

.dm.is-demo .dm__m[data-m=ok] {
  animation-name: dm-m-ok;
}

.dm.is-demo .dm__m[data-m=no] {
  animation-name: dm-m-no;
}

@keyframes dm-spin {
  0% {
    rotate: 0deg;
  }
  100% {
    rotate: 360deg;
  }
}
@keyframes dm-type {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  18% {
    clip-path: inset(0 100% 0 0);
  }
  26% {
    clip-path: inset(0 70% 0 0);
  }
  34% {
    clip-path: inset(0 50% 0 0);
  }
  66% {
    clip-path: inset(0 50% 0 0);
  }
  70% {
    clip-path: inset(0 0 0 0);
  }
  86% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 100% 0 0);
  }
}
@keyframes dm-input {
  0% {
    border-color: rgba(255, 247, 230, 0.38);
  }
  54% {
    border-color: #479075;
  }
  70% {
    border-color: #4a0f04;
  }
  82% {
    border-color: rgba(255, 247, 230, 0.38);
  }
  100% {
    border-color: rgba(255, 247, 230, 0.38);
  }
}
@keyframes dm-wait {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  36% {
    opacity: 1;
    transform: scale(1);
  }
  54% {
    opacity: 0;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
}
@keyframes dm-ok {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  53.9% {
    opacity: 0;
    transform: scale(0.4);
  }
  54% {
    opacity: 1;
    transform: scale(1.35);
  }
  60% {
    opacity: 1;
    transform: scale(1);
  }
  69.9% {
    opacity: 1;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(0.4);
  }
}
@keyframes dm-no {
  0% {
    opacity: 0;
    transform: scale(0.4) translateX(0);
  }
  69.9% {
    opacity: 0;
    transform: scale(0.4) translateX(0);
  }
  70% {
    opacity: 1;
    transform: scale(1) translateX(5px);
  }
  74% {
    opacity: 1;
    transform: scale(1) translateX(-5px);
  }
  78% {
    opacity: 1;
    transform: scale(1) translateX(3px);
  }
  81.9% {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
  82% {
    opacity: 0;
    transform: scale(0.4) translateX(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.4) translateX(0);
  }
}
@keyframes dm-m-wait {
  0% {
    opacity: 0;
  }
  36% {
    opacity: 1;
  }
  54% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dm-m-ok {
  0% {
    opacity: 0;
  }
  54% {
    opacity: 1;
  }
  70% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dm-m-no {
  0% {
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
  86% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 360px) {
  .dm__input {
    height: 40px;
    line-height: 36px;
  }
  .dm__ghost {
    line-height: 40px;
  }
  .dm__out {
    margin-top: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dm.is-demo .dm__ghost,
  .dm.is-demo .dm__input,
  .dm.is-demo .dm__ic,
  .dm.is-demo .dm__m,
  .dm[data-state=wait] .dm__ic--wait {
    animation: none !important;
  }
  .dm.is-demo .dm__ghost {
    opacity: 1;
    clip-path: inset(0 50% 0 0);
  }
  .dm.is-demo .dm__ic--ok {
    opacity: 1;
    transform: scale(1);
  }
  .dm.is-demo .dm__input {
    border-color: #479075;
  }
  .dm.is-demo .dm__m[data-m=ok] {
    opacity: 1;
  }
}
