:root {
  color-scheme: light;
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
  color: #111111;
  background: #f4f4f3;
  font-synthesis: none;
  text-rendering: geometricPrecision;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  background: #f4f4f3;
}

button,
input {
  font: inherit;
}

.access-gate {
  position: fixed;
  inset: 0;
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow: auto;
  background: rgb(255 255 255 / 42%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.access-card {
  position: relative;
  display: flex;
  width: min(500px, 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.access-language-control {
  position: absolute;
  top: -64px;
  right: 0;
}

.fasti-language-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 2px;
  border: 1px solid rgb(17 17 17 / 28%);
  border-radius: 999px;
  color: #111111;
  background: transparent;
}

.fasti-language-pill button {
  display: inline-grid;
  width: 31px;
  min-width: 31px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.fasti-language-pill button:hover,
.fasti-language-pill button:focus-visible {
  background: #ffffff;
  box-shadow: 5px 5px 12px rgb(13 39 80 / 12%), -5px -5px 10px rgb(255 255 255 / 92%);
}

.fasti-language-pill button:focus-visible {
  outline: 2px solid rgb(35 124 207);
  outline-offset: 2px;
}

.fasti-language-pill button[aria-pressed="true"] {
  color: #ffffff;
  background: #4a4a45;
}

.gate-title {
  min-height: 24px;
  margin: 0;
  color: #111111;
  font-family: "Courier New", Courier, "IBM Plex Mono", SFMono-Regular, Consolas, monospace;
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
}

.gate-cursor {
  display: inline-block;
  width: 1px;
  height: 19px;
  margin-left: 3px;
  vertical-align: -3px;
  background: currentColor;
}

.passcode-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.passcode-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.passcode-boxes {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 10px;
}

.passcode-box {
  width: 42px;
  height: 46px;
  padding: 1px 2px;
  border: 1px solid #111111;
  border-radius: 6px;
  outline: none;
  color: #111111;
  background: rgb(255 255 255 / 62%);
  box-shadow: 0 0 0 3px rgb(17 17 17 / 8%);
  caret-color: transparent;
  font-family: "Courier New", Courier, "IBM Plex Mono", SFMono-Regular, Consolas, monospace;
  font-size: 22px;
  font-weight: 400;
  line-height: 46px;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.passcode-box:hover {
  background: rgb(255 255 255 / 88%);
}

.passcode-box:focus-visible {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgb(35 124 207 / 24%);
}

.passcode-box:disabled {
  opacity: 0.55;
}

.passcode-error {
  min-height: 15px;
  margin: 0;
  color: #111111;
  font-family: "Courier New", Courier, "IBM Plex Mono", SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 15px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.passcode-error.is-visible {
  opacity: 1;
}

.passcode-form.is-error .passcode-boxes {
  animation: passcode-reject 180ms ease-out;
}

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

@keyframes gate-cursor-blink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

@keyframes passcode-reject {
  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-4px);
  }

  70% {
    transform: translateX(4px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .gate-cursor {
    animation: gate-cursor-blink 780ms steps(1) infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .passcode-box,
  .passcode-error {
    transition: none;
  }

  .passcode-form.is-error .passcode-boxes {
    animation: none;
  }
}

@media (max-width: 420px) {
  .access-gate {
    padding: 20px 16px;
  }

  .access-card {
    gap: 20px;
  }

  .passcode-boxes {
    grid-template-columns: repeat(6, 38px);
    gap: 8px;
  }

  .passcode-box {
    width: 38px;
    height: 44px;
    line-height: 44px;
  }
}
