* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #091422;
  color: #f4f7fc;
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
}

.login {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 44%) 1fr;
  align-items: center;
  min-height: 100svh;
}

.photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #091422, rgb(9 20 34 / 76%) 34%, transparent 64%);
}

@media (min-width: 801px) and ((max-aspect-ratio: 5/4) or (min-aspect-ratio: 2/1)) {
  .photo img {
    object-fit: contain;
  }
}

.form {
  position: relative;
  grid-column: 1;
  justify-self: center;
  display: grid;
  gap: 18px;
  width: min(100% - 48px, 360px);
  padding-block: 32px;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

label {
  display: grid;
  gap: 6px;
  color: #dbe6f4;
}

input,
button {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  font: inherit;
}

input {
  padding: 10px 12px;
  border: 1px solid #607089;
  background: #101e31;
  color: #f4f7fc;
}

button {
  margin-top: 6px;
  border: 0;
  background: #1766cd;
  color: white;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: #1259b5;
}

:focus-visible {
  outline: 2px solid #93c5ff;
  outline-offset: 3px;
}

.error {
  margin: 0;
  color: #ffb4ae;
}

@media (max-width: 800px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }

  .photo {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 560px;
    justify-self: center;
  }

  .photo img {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .photo::after {
    background: linear-gradient(0deg, #091422, transparent 20%);
  }

  .form {
    padding-top: 16px;
  }
}
