:root {
  color-scheme: only light;
  --bg: #050505;
  --line: rgba(244, 241, 236, 0.58);
  --line-active: rgba(255, 122, 26, 0.8);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  forced-color-adjust: none;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: only light;
}

input {
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: only light;
  }

  html,
  body {
    background-color: var(--bg);
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.035), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 26%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.pin-form {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 52px);
  gap: 14px;
  border: 0;
}

.pin-form.is-error {
  animation: pin-shake 180ms ease-in-out;
}

.pin-box {
  width: 52px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: transparent;
  caret-color: transparent;
  text-align: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.018);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 20px rgba(255, 255, 255, 0.035);
  appearance: none;
}

.pin-box:focus {
  border-color: var(--line-active);
  box-shadow:
    inset 0 0 0 1px rgba(255, 122, 26, 0.16),
    0 0 24px rgba(255, 122, 26, 0.12);
}

.pin-box.is-filled {
  background:
    radial-gradient(circle at center, rgba(244, 241, 236, 0.82) 0 4px, transparent 4.5px),
    rgba(255, 255, 255, 0.018);
}

.pin-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes pin-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  33% {
    transform: translateX(-6px);
  }

  66% {
    transform: translateX(6px);
  }
}

@media (max-width: 420px) {
  .pin-form {
    grid-template-columns: repeat(4, 48px);
    gap: 12px;
  }

  .pin-box {
    width: 48px;
    height: 58px;
  }
}
