:root {
  color: #111827;
  font-family: Figtree, ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pin-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 2rem;
}

.pin-form {
  margin-bottom: 1rem;
}

.pin-fields {
  display: flex;
  gap: 1rem;
}

.pin-fields input {
  width: 4rem;
  height: 4rem;
  border: 1px solid #9ca3af;
  border-radius: 0.5rem;
  background: #fff;
  color: #111827;
  text-align: center;
  font: inherit;
  font-size: 1.875rem;
  line-height: 2.25rem;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}

.pin-fields input:focus-visible {
  border-color: #4b5563;
  outline: 3px solid rgb(59 130 246 / 35%);
  outline-offset: 2px;
}

.pin-fields.has-error input {
  border-color: #ef4444;
}

.pin-fields.is-loading input {
  cursor: wait;
  opacity: 0.72;
}

.error {
  min-height: 1.5rem;
  color: #dc2626;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.shake {
  animation: shake 600ms ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-10px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(10px);
  }
}

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

@media (max-width: 360px) {
  .pin-fields {
    gap: 0.65rem;
  }

  .pin-fields input {
    width: 3.5rem;
    height: 3.5rem;
  }
}

