html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.pem {
  position: relative;
  width: min(92vw, 160vh - 12.8vw);
  aspect-ratio: 480/300;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pem__form {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
}

.pem__field {
  display: grid;
  gap: 8px;
}

.pem__labelText {
  color: rgba(255, 247, 230, 0.82);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
}

.pem__inputWrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pem__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 40px 12px 16px;
  border-radius: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: transparent;
  caret-color: #fff7e6;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0.06em;
}
.pem__input:focus {
  outline: 2px solid #5b8cf8;
  outline-offset: 2px;
}

.pem__overlay {
  position: absolute;
  left: 16px;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  pointer-events: none;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0.06em;
  color: #fff7e6;
  white-space: nowrap;
  overflow: hidden;
}

.pem__ch {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 0.62em;
}

.pem__mask,
.pem__char {
  grid-area: 1/1;
  transition: opacity 220ms ease-out;
}

.pem__mask {
  opacity: 1;
  font-size: 20px;
  line-height: 1;
}

.pem__char {
  opacity: 0;
}

.pem--revealed .pem__mask {
  opacity: 0;
}

.pem--revealed .pem__char {
  opacity: 1;
}

.pem__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 247, 230, 0.82);
  cursor: pointer;
}
.pem__toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}
.pem__toggle:focus-visible {
  outline: 2px solid #5b8cf8;
  outline-offset: 2px;
}

.pem__eye {
  display: block;
}

.pem::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(91, 140, 248, 0);
  transition: background-color 0.28s ease;
}

.pem--revealed::before {
  background: rgba(91, 140, 248, 0.16);
}

@media (max-width: 340px) {
  .pem__form {
    max-width: 260px;
  }
  .pem__input {
    font-size: 15px;
    padding-right: 32px;
  }
  .pem__overlay {
    font-size: 15px;
    right: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pem__mask,
  .pem__char {
    transition: none;
    transition-delay: 0s;
  }
  .pem::before {
    transition: none;
  }
}
