*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  background: #11172b;
  color: #ece6da;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate__form {
  width: 100%;
  max-width: 340px;
}

.gate__label {
  display: block;
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #b9a47e;
}

.gate__row {
  display: flex;
  border-bottom: 1px solid rgba(236, 230, 218, 0.35);
  transition: border-color 0.25s ease;
}

.gate__row:focus-within { border-color: #c9b186; }

.gate__input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 18px;
  letter-spacing: 0.18em;
}

.gate__input:focus { outline: none; }

.gate__button {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #c9b186;
  cursor: pointer;
  transition: transform 0.25s ease, color 0.25s ease;
}

.gate__button:hover { transform: translateX(3px); color: #ece6da; }

.gate__button:focus-visible,
.gate__input:focus-visible {
  outline: 2px solid #c9b186;
  outline-offset: 4px;
}

.gate__error {
  min-height: 1.5em;
  margin: 14px 0 0;
  font-size: 13px;
  color: #e3a99b;
}

.is-invalid .gate__row { animation: nudge 0.36s ease; border-color: #e3a99b; }

@keyframes nudge {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .is-invalid .gate__row { animation: none; }
  .gate__button { transition: none; }
}

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