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

.ie {
  width: min(240px, 82vw);
}

.ie__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  font-family: inherit;
  color: rgba(23, 20, 26, 0.75);
}

.ie__frame {
  position: relative;
}

.ie__input {
  box-sizing: border-box;
  width: 100%;
  border: 2px solid rgba(23, 20, 26, 0.25);
  border-radius: 12px;
  padding: 12px 40px 12px 16px;
  font-weight: 500;
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1;
  font-family: inherit;
  color: #17141a;
  background: #fff7e6;
  transition: border-color 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.ie__input:focus {
  outline: none;
}

.ie__icon {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%) scale(0);
  opacity: 0;
  transition: transform 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97), opacity 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
  pointer-events: none;
}

.ie__icon--ok {
  fill: none;
  stroke: #17141a;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ie__icon--bad {
  fill: none;
  stroke: #c2361a;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.ie__input:invalid:not(:placeholder-shown) {
  border-color: #c2361a;
  animation: shake 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.ie__bloom {
  position: absolute;
  inset: -6px;
  border-radius: calc(12px + 6px);
  background: radial-gradient(circle, rgba(194, 54, 26, 0.28) 0%, rgba(194, 54, 26, 0) 70%);
  opacity: 0;
  pointer-events: none;
}

.ie:has(.ie__input:invalid:not(:placeholder-shown)) .ie__bloom {
  animation: ie-bloom 600ms ease-out;
}

@keyframes ie-bloom {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}
.ie__input:invalid:not(:placeholder-shown) ~ .ie__icon--bad {
  transform: translateY(-50%) scale(1);
  opacity: 1;
}

.ie__input:valid:not(:placeholder-shown) ~ .ie__icon--ok {
  transform: translateY(-50%) scale(1);
  opacity: 1;
}

.ie__msg {
  margin: 8px 0 0;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  background: #ffffff;
  color: #c2361a;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
  font-family: inherit;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97), transform 600ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.ie:has(.ie__input:invalid:not(:placeholder-shown)) .ie__msg {
  opacity: 1;
  transform: translateY(0);
}

@keyframes shake {
  10%, 90% {
    transform: translateX(-3.1px);
  }
  20%, 80% {
    transform: translateX(5px);
  }
  30%, 70% {
    transform: translateX(-3.75px);
  }
  40%, 60% {
    transform: translateX(2.75px);
  }
  50% {
    transform: translateX(-1.7px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ie__input:invalid:not(:placeholder-shown) {
    animation: none;
  }
  .ie:has(.ie__input:invalid:not(:placeholder-shown)) .ie__bloom {
    animation: none;
  }
  .ie__icon, .ie__msg {
    transition: none;
  }
}
