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

.fn {
  box-sizing: border-box;
  width: clamp(320px, 92vw, 432px);
  padding: 16px;
  border-radius: 16px;
  background: #1b1a20;
  color: #ffffff;
}

.fn__title {
  margin: 0;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
}

.fn__desc {
  margin: 4px 0 12px;
  color: #b9b3c4;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
}

.fn__label {
  display: block;
  margin-bottom: 4px;
  color: #b9b3c4;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
}

.fn__row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.fn__input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid #b9b3c4;
  border-radius: 12px;
  background: #2c2a33;
  color: #ffffff;
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
}

.fn__input::placeholder {
  color: #b9b3c4;
}

.fn__input:focus-visible {
  outline: 2px solid #b3dad5;
  outline-offset: 2px;
}

.fn__send {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid #b3dad5;
  border-radius: 12px;
  background: #479089;
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.fn__send:focus-visible {
  outline: 2px solid #b3dad5;
  outline-offset: 2px;
}

.fn.is-done .fn__send {
  background: #b3dad5;
  color: #1b1a20;
}

.fn.is-sending .fn__send {
  transform: translateY(3px);
}

.fn__icons {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.fn__ic {
  grid-area: 1/1;
  display: grid;
  place-items: center;
  opacity: 0;
}

.fn.is-idle .fn__ic--plane,
.fn.is-error .fn__ic--plane {
  opacity: 1;
}

.fn.is-sending .fn__ic--load {
  opacity: 1;
}

.fn.is-done .fn__ic--done {
  opacity: 1;
}

.fn__spin {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation-name: fnSpin;
  animation-duration: 500ms;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.fn__bar {
  display: block;
  height: 2px;
  margin-top: 8px;
  border-radius: 999px;
  background: #b3dad5;
  transform: scaleX(0);
  transform-origin: left center;
}

.fn.is-sending .fn__bar {
  transform: scaleX(0.6);
}

.fn.is-done .fn__bar {
  transform: scaleX(1);
}

.fn__msg {
  display: grid;
  margin: 8px 0 0;
  min-height: 17px;
}

.fn__m {
  grid-area: 1/1;
  opacity: 0;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
}

.fn__m--idle, .fn__m--send {
  color: #b9b3c4;
}

.fn__m--done {
  color: #b3dad5;
}

.fn__m--err {
  color: #ff4d1f;
}

.fn.is-idle .fn__m--idle,
.fn.is-sending .fn__m--send,
.fn.is-done .fn__m--done,
.fn.is-error .fn__m--err {
  opacity: 1;
}

.fn__legal {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #2c2a33;
  color: #b9b3c4;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.fn.is-demo .fn__ic, .fn.is-demo .fn__m {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.fn.is-demo .fn__ic--plane {
  animation-name: fnPlane;
}

.fn.is-demo .fn__ic--load {
  animation-name: fnLoad;
}

.fn.is-demo .fn__ic--done {
  animation-name: fnDone;
}

.fn.is-demo .fn__m--idle {
  animation-name: fnMsgIdle;
}

.fn.is-demo .fn__m--send {
  animation-name: fnMsgSend;
}

.fn.is-demo .fn__m--done {
  animation-name: fnMsgDone;
}

.fn.is-demo .fn__ic--done svg {
  animation-name: fnPop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.fn.is-demo .fn__send {
  animation-name: fnFace, fnPress;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite, infinite;
}

.fn.is-demo .fn__bar {
  animation-name: fnBar;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes fnSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fnPlane {
  0% {
    opacity: 1;
  }
  40% {
    opacity: 0;
  }
  82% {
    opacity: 1;
  }
}
@keyframes fnLoad {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  58% {
    opacity: 0;
  }
}
@keyframes fnDone {
  0% {
    opacity: 0;
  }
  58% {
    opacity: 1;
  }
  82% {
    opacity: 0;
  }
}
@keyframes fnMsgIdle {
  0% {
    opacity: 1;
  }
  40% {
    opacity: 0;
  }
  89% {
    opacity: 1;
  }
}
@keyframes fnMsgSend {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  58% {
    opacity: 0;
  }
}
@keyframes fnMsgDone {
  0% {
    opacity: 0;
  }
  58% {
    opacity: 1;
  }
  89% {
    opacity: 0;
  }
}
@keyframes fnFace {
  0% {
    background: #479089;
    color: #ffffff;
  }
  58% {
    background: #b3dad5;
    color: #1b1a20;
  }
  86% {
    background: #479089;
    color: #ffffff;
  }
}
@keyframes fnPress {
  0%, 38% {
    transform: translateY(0);
  }
  41% {
    transform: translateY(3px);
  }
  46%, 100% {
    transform: translateY(0);
  }
}
@keyframes fnPop {
  0%, 58% {
    transform: translateY(6px) scale(0.7);
  }
  66%, 82% {
    transform: translateY(0) scale(1);
  }
  83%, 100% {
    transform: translateY(6px) scale(0.7);
  }
}
@keyframes fnBar {
  0%, 40% {
    transform: scaleX(0);
  }
  58%, 88.9% {
    transform: scaleX(1);
  }
  89%, 100% {
    transform: scaleX(0);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .fn {
    width: 100%;
    padding: 8px;
  }
  .fn__title {
    font-size: 12px;
  }
  .fn__desc {
    margin: 4px 0 8px;
    font-size: 10px;
    line-height: 1.3;
  }
  .fn__label {
    font-size: 10px;
  }
  .fn__row {
    gap: 4px;
  }
  .fn__input {
    padding: 4px 8px;
    font-size: 11px;
  }
  .fn__send {
    padding: 4px 8px;
    font-size: 11px;
  }
  .fn__bar {
    margin-top: 4px;
  }
  .fn__msg {
    margin-top: 4px;
    min-height: 14px;
  }
  .fn__m {
    font-size: 10px;
    line-height: 1.3;
  }
  .fn__legal {
    margin-top: 4px;
    padding-top: 4px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fn__ic, .fn__m, .fn__send, .fn__bar, .fn__spin, .fn__ic--done svg {
    animation: none !important;
  }
}
