:root {
  --gate-error: #b32f4b;
  color-scheme: light dark;
  font:
    15px/1.6 system-ui,
    -apple-system,
    sans-serif;
  color: #292b36;
  background: #f6f7fa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate {
  width: min(100%, 410px);
  padding: 36px;
  background: #fff;
  border: 1px solid #e5e5ee;
  border-radius: 20px;
  box-shadow: 0 12px 50px #25213508;
}
.gate-symbol {
  display: grid;
  place-items: center;
  position: relative;
  width: 44px;
  height: 44px;
  background: #7555e8;
  color: #fff;
  border-radius: 13px;
}
.gate-symbol::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #d5fc99;
  border: 2px solid #fff;
  border-radius: 50%;
}
#password-fields {
  display: grid;
  gap: 8px;
}
.gate-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff55;
  border-top-color: #fff;
  border-radius: 50%;
  animation: gate-spin 0.75s linear infinite;
}
button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes gate-spin {
  to {
    transform: rotate(360deg);
  }
}
h1 {
  font-size: 29px;
  letter-spacing: -1px;
  margin: 18px 0 8px;
}
h1 span {
  color: #9676ea;
}
p {
  margin: 0 0 22px;
  color: #666a79;
}
form {
  display: grid;
  gap: 12px;
}
label {
  font-size: 13px;
  font-weight: 600;
}
input,
button {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
}
.password-control {
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid #c8cad8;
  border-radius: 10px;
}
.password-control input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.password-control input:focus {
  outline: none;
}
.password-control:focus-within {
  outline: 2px solid #a489ed;
  outline-offset: 2px;
}
#password-fields[data-invalid="true"] label {
  color: var(--gate-error);
}
#password-fields[data-invalid="true"] .password-control {
  border-color: var(--gate-error);
}
#password-fields[data-invalid="true"] .password-control:focus-within {
  outline-color: var(--gate-error);
}
button {
  border: 0;
  background: #7955de;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}
button:disabled {
  opacity: 1;
  cursor: wait;
}
.password-visibility {
  flex: 0 0 36px;
  width: 36px;
  min-height: 36px;
  padding: 8px;
  margin-right: 6px;
  background: transparent;
  color: #777b88;
  border-radius: 6px;
}
.password-visibility:hover {
  background: #eee8ff;
  color: #7655dc;
}
.password-visibility:focus-visible {
  outline: 2px solid #a489ed;
  outline-offset: -2px;
}
small {
  color: #777b88;
  text-align: center;
  font-size: 12px;
}
#error {
  margin: 18px 0 0;
  color: #a53248;
}
[hidden] {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root {
    --gate-error: #ffa4b5;
    color: #e5e6ef;
    background: #14161f;
  }
  .gate {
    background: #1e202c;
    border-color: #303343;
  }
  .gate-symbol {
    background: #7555e8;
    color: #fff;
  }
  .gate-symbol::after {
    border-color: #1e202c;
  }
  p,
  small {
    color: #a6a9b9;
  }
  .password-control {
    border-color: #4d5064;
  }
  .password-visibility {
    color: #a6a9b9;
  }
  .password-visibility:hover {
    background: #302740;
    color: #c4abff;
  }
  #error {
    color: #ffa4b5;
  }
}
