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

.fi {
  display: flex;
  justify-content: center;
  width: 100%;
}

.fi__card {
  width: min(100%, 340px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.fi__pad {
  position: relative;
  z-index: 2;
  background: #fff7e6;
  border-radius: 8px;
  aspect-ratio: 300/76;
  touch-action: none;
}

.fi__hint {
  position: absolute;
  left: 8px;
  top: 4px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.fi__ico {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.fi__reset {
  position: absolute;
  right: 4px;
  top: 4px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(23, 20, 26, 0.24);
  background: #ffffff;
  color: rgba(23, 20, 26, 0.72);
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.2;
  padding: 4px 8px;
}

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

.fi__inkWrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: left center;
}

.fi__ink, .fi__ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fi__ghost {
  display: none;
  fill: none;
}

.fi__stroke {
  stroke: #17141a;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.fi__stroke--c {
  stroke-width: 8;
}

.fi__rule {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 14%;
  height: 0;
  border-bottom: 1px dashed rgba(23, 20, 26, 0.34);
}

.fi__form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fi__formLabel {
  width: 32px;
  flex: 0 0 auto;
  font-weight: 800;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.fi__slot {
  flex: 1 1 auto;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  border: 1px solid rgba(23, 20, 26, 0.28);
  border-radius: 8px;
  background: #ffffff;
}

.fi__slot.is-filled {
  border-color: #2f6df6;
}

.fi__ok {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0;
  transform: scale(0.4);
  fill: none;
  stroke: #2f6df6;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fi__slot.is-filled .fi__ok {
  opacity: 1;
  transform: scale(1);
}

.fi__fit {
  flex: 0 0 auto;
  cursor: pointer;
  border: 0;
  background: #2f6df6;
  color: #ffffff;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.2;
  padding: 8px 12px;
}

.fi__live {
  position: relative;
  margin: 0;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
  color: rgba(23, 20, 26, 0.66);
  white-space: nowrap;
}

.fi__liveDemo {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}

.fi.is-demo .fi__ink {
  visibility: hidden;
}

.fi.is-demo .fi__ghost {
  display: block;
}

.fi.is-demo .fi__stroke {
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.fi.is-demo .fi__stroke--a {
  animation-name: fiDrawA;
}

.fi.is-demo .fi__stroke--b {
  animation-name: fiDrawB;
}

.fi.is-demo .fi__stroke--c {
  animation-name: fiDrawC;
}

@keyframes fiDrawA {
  0%, 2% {
    stroke-dashoffset: 100;
  }
  22%, 86% {
    stroke-dashoffset: 0;
  }
  94%, 100% {
    stroke-dashoffset: 100;
  }
}
@keyframes fiDrawB {
  0%, 22% {
    stroke-dashoffset: 100;
  }
  34%, 86% {
    stroke-dashoffset: 0;
  }
  92%, 100% {
    stroke-dashoffset: 100;
  }
}
@keyframes fiDrawC {
  0%, 36% {
    stroke-dashoffset: 100;
  }
  44%, 86% {
    stroke-dashoffset: 0;
  }
  90%, 100% {
    stroke-dashoffset: 100;
  }
}
.fi.is-demo .fi__inkWrap {
  animation-name: fiFit;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes fiFit {
  0%, 54% {
    transform: translate(0, 0) scale(1);
  }
  76%, 94% {
    transform: translate(40px, 82%) scale(0.34);
  }
  98%, 100% {
    transform: translate(0, 0) scale(1);
  }
}
.fi.is-demo .fi__fit {
  animation-name: fiPress;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes fiPress {
  0%, 46% {
    transform: scale(1);
  }
  49% {
    transform: scale(0.88);
  }
  54%, 100% {
    transform: scale(1);
  }
}
.fi.is-demo .fi__slot {
  animation-name: fiSlotOk;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes fiSlotOk {
  0%, 77% {
    border-color: rgba(23, 20, 26, 0.28);
  }
  78%, 87% {
    border-color: #2f6df6;
  }
  88%, 100% {
    border-color: rgba(23, 20, 26, 0.28);
  }
}
.fi.is-demo .fi__ok {
  animation-name: fiOkPop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes fiOkPop {
  0%, 77% {
    opacity: 0;
    transform: scale(0.4);
  }
  78% {
    opacity: 1;
    transform: scale(0.4);
  }
  84%, 87% {
    opacity: 1;
    transform: scale(1);
  }
  88%, 100% {
    opacity: 0;
    transform: scale(0.4);
  }
}
.fi.is-demo .fi__liveReal {
  color: transparent;
}

.fi.is-demo .fi__liveDemo {
  display: block;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.fi.is-demo .fi__liveDemo--before {
  animation-name: fiSayBefore;
}

.fi.is-demo .fi__liveDemo--after {
  animation-name: fiSayAfter;
}

@keyframes fiSayBefore {
  0%, 77% {
    opacity: 1;
  }
  78%, 93% {
    opacity: 0;
  }
  94%, 100% {
    opacity: 1;
  }
}
@keyframes fiSayAfter {
  0%, 77% {
    opacity: 0;
  }
  78%, 93% {
    opacity: 1;
  }
  94%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .fi__card {
    padding: 8px;
  }
  .fi__formLabel {
    width: 28px;
  }
  .fi__fit {
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fi.is-demo .fi__stroke,
  .fi.is-demo .fi__inkWrap,
  .fi.is-demo .fi__fit,
  .fi.is-demo .fi__slot,
  .fi.is-demo .fi__ok,
  .fi.is-demo .fi__liveDemo {
    animation: none !important;
  }
  .fi.is-demo .fi__stroke {
    stroke-dashoffset: 0 !important;
  }
  .fi.is-demo .fi__inkWrap {
    transform: translate(40px, 82%) scale(0.34) !important;
  }
  .fi.is-demo .fi__slot {
    border-color: #2f6df6 !important;
  }
  .fi.is-demo .fi__ok {
    opacity: 1 !important;
    transform: scale(1) !important;
  }
  .fi.is-demo .fi__liveDemo--before {
    opacity: 0 !important;
  }
  .fi.is-demo .fi__liveDemo--after {
    opacity: 1 !important;
  }
}
