html.invest-gate-active,
html.invest-gate-active body {
  overflow: hidden;
  height: 100%;
}

.invest-gate {
  position: fixed;
  inset: 0;
  z-index: 99998;
  color-scheme: light;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f0f2f5;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.invest-gate__panel {
  width: min(100%, 320px);
  text-align: center;
  animation: invest-gate-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.invest-gate__logo {
  display: block;
  width: 320px;
  height: 132px;
  margin: 0 auto 32px;
}

.invest-gate__logo-fallback {
  display: block;
  width: 249px;
  height: auto;
  margin: 0 auto;
}

.invest-gate__logo--3d .invest-gate__logo-fallback {
  display: none;
}

.invest-gate__logo-canvas-wrap {
  display: none;
  width: 320px;
  height: 132px;
  margin: 0 auto;
}

.invest-gate__logo--3d .invest-gate__logo-canvas-wrap {
  display: block;
}

.invest-gate__logo-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.invest-gate__subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: rgba(60, 60, 67, 0.6);
}

.invest-gate__form {
  display: grid;
  gap: 20px;
}

.invest-gate__pin {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.invest-gate__pin-cell {
  width: 100%;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: #ffffff;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.02);
  font: inherit;
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: center;
  color: #1d1d1f;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  -moz-appearance: textfield;
}

.invest-gate__pin-cell::-webkit-outer-spin-button,
.invest-gate__pin-cell::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.invest-gate__pin-cell:focus {
  border-color: rgba(0, 113, 227, 0.45);
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(0, 113, 227, 0.12),
    inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.invest-gate__pin-cell.is-spinning {
  border-color: rgba(47, 128, 237, 0.35);
  color: rgba(29, 29, 31, 0.72);
}

.invest-gate__pin-cell.is-lit {
  border-color: #2f80ed;
  background: rgba(47, 128, 237, 0.1);
  color: #2f80ed;
  box-shadow:
    0 0 0 3px rgba(47, 128, 237, 0.22),
    0 0 14px rgba(47, 128, 237, 0.32),
    inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.invest-gate__pin-cell.is-lit:focus {
  border-color: #2f80ed;
  background: rgba(47, 128, 237, 0.12);
  box-shadow:
    0 0 0 3px rgba(47, 128, 237, 0.28),
    0 0 14px rgba(47, 128, 237, 0.36),
    inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.invest-gate.is-unlock-animating .invest-gate__pin-cell:not(.is-spinning):not(.is-lit) {
  opacity: 0.55;
}

.invest-gate.is-unlock-animating .invest-gate__pin-cell:focus {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.invest-gate__button {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 14px;
  background: #0071e3;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    opacity 0.2s ease;
}

.invest-gate__button:hover:not(:disabled) {
  background: #0077ed;
}

.invest-gate__button:active:not(:disabled) {
  transform: scale(0.985);
}

.invest-gate__button:disabled {
  background: rgba(29, 29, 31, 0.12);
  color: rgba(29, 29, 31, 0.28);
  cursor: not-allowed;
}

.invest-gate__message {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #ff3b30;
}

.invest-gate__panel.is-shake {
  animation: invest-gate-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.invest-gate.is-revealing {
  pointer-events: none;
  will-change: transform;
  animation: invest-gate-curtain 0.72s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.invest-gate.is-revealing .invest-gate__panel {
  animation: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition:
    opacity 0.28s cubic-bezier(0.4, 0, 1, 1),
    transform 0.28s cubic-bezier(0.4, 0, 1, 1);
}

@keyframes invest-gate-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes invest-gate-curtain {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-100%);
  }
}

@keyframes invest-gate-shake {
  10%,
  90% {
    transform: translateX(-1px);
  }

  20%,
  80% {
    transform: translateX(2px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }

  40%,
  60% {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .invest-gate__panel {
    animation: none;
  }

  .invest-gate__panel.is-shake {
    animation: none;
  }

  .invest-gate__button {
    transition: none;
  }

  .invest-gate__pin-cell {
    transition: none;
  }

  .invest-gate__pin-cell.is-lit {
    box-shadow: inset 0 0 0 2px #2f80ed;
  }
}
