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

.eg {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(300px, 86vw);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  color: #17141a;
}

.eg__field {
  position: relative;
  height: 40px;
}

.eg__input {
  box-sizing: border-box;
  margin: 0;
  padding: 0 12px;
  width: 100%;
  height: 100%;
  border: 2px solid #17141a;
  border-radius: 8px;
  background-color: #fff7e6;
  color: #17141a;
  font-family: inherit;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
}

.eg__input:focus-visible {
  outline: 3px solid #17141a;
  outline-offset: 2px;
}

.eg__ghost {
  position: absolute;
  left: 14px;
  top: 10px;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: #17141a;
}

.eg:not(.is-demo) .eg__ghost {
  display: none;
}

.eg.is-demo .eg__input::placeholder {
  color: transparent;
}

.eg__wrap {
  position: relative;
  padding-bottom: 32px;
}

.eg__btn {
  box-sizing: border-box;
  margin: 0;
  padding: 0 16px;
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background-color: #fff7e6;
  color: #17141a;
  font-family: inherit;
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  cursor: pointer;
}

.eg__btn:focus-visible {
  outline: 3px solid #17141a;
  outline-offset: 3px;
}

.eg__btn[aria-disabled=true] {
  opacity: 0.45;
  cursor: not-allowed;
}

.eg__btn[aria-disabled=false] {
  background-color: #17141a;
  color: #ffd23f;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.eg__btn[data-sent="1"] {
  background-color: #4cd4a6;
  color: #17141a;
}

.eg__tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: #17141a;
  color: #fff7e6;
  text-align: center;
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
}

.eg:not(.is-demo) .eg__btn[aria-disabled=true]:hover + .eg__tip,
.eg:not(.is-demo) .eg__btn:focus-visible + .eg__tip,
.eg:not(.is-demo) .eg__btn[data-why="1"] + .eg__tip {
  opacity: 1;
}

.eg.is-demo .eg__ghost {
  animation-name: eg-type;
  animation-duration: 2s;
  animation-timing-function: steps(8, end);
  animation-iteration-count: infinite;
}

@keyframes eg-type {
  0% {
    width: 0;
  }
  20% {
    width: 0;
  }
  46% {
    width: 120px;
  }
  86% {
    width: 120px;
  }
  87% {
    width: 0;
  }
  100% {
    width: 0;
  }
}
.eg.is-demo .eg__btn {
  animation-name: eg-open;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes eg-open {
  0% {
    opacity: 0.45;
    background-color: #fff7e6;
    color: #17141a;
  }
  50% {
    opacity: 1;
    background-color: #17141a;
    color: #ffd23f;
  }
  86% {
    opacity: 0.45;
    background-color: #fff7e6;
    color: #17141a;
  }
  100% {
    opacity: 0.45;
    background-color: #fff7e6;
    color: #17141a;
  }
}
.eg.is-demo .eg__tip {
  animation-name: eg-tip;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes eg-tip {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  86% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
.eg.is-demo .eg__wrap {
  animation-name: eg-rise;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes eg-rise {
  0% {
    transform: translateY(0);
  }
  48% {
    transform: translateY(0);
  }
  54% {
    transform: translateY(-6px);
  }
  66% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .eg {
    gap: 8px;
  }
  .eg__field {
    height: 36px;
  }
  .eg__btn {
    height: 40px;
    font-size: 13px;
    line-height: 18px;
  }
  .eg__ghost {
    top: 8px;
  }
  .eg__wrap {
    padding-bottom: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .eg.is-demo .eg__ghost,
  .eg.is-demo .eg__btn,
  .eg.is-demo .eg__tip,
  .eg.is-demo .eg__wrap {
    animation: none !important;
  }
  .eg.is-demo .eg__tip {
    opacity: 1;
  }
}
