/* ---------- Seite: Hintergrund, Logo, Position ---------- */

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

body {
  background: #4e4e4e url(/bg.jpg) 0 0 repeat;
  color: #e9edf1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Ab hier waere das 2560x1440-Bild gekachelt; stattdessen flaechig skalieren. */
@media (min-width: 2561px), (min-height: 1441px) {
  body {
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
  }
}

/* Schmale Bildschirme: Bild verkleinert auf Bildschirmhoehe, damit das Muster sichtbar ist.
   Eigene feste Ebene statt body-Hintergrund, damit die ein-/ausfahrende Adressleiste
   mobiler Browser keine Luecke oder Kachelung erzeugt. */
@media (max-width: 900px) {
  body {
    background-image: none;
  }

  body::before {
    content: "";
    position: fixed;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    background: url(/bg.jpg) 42% 0 / cover no-repeat;
  }
}

/* Hochformat: Bild 120 % der Bildschirmhoehe, oben buendig. Die Kante, an der drei Sechsecke
   zusammenstossen (Bildpunkt 1126/723 von 2560x1440), liegt damit auf 60 % der Hoehe.
   Waagerecht: gewuenschte Stelle (30 % der Breite) minus Lage der Kante im skalierten Bild
   (1126/2560 x 2560/1440 x 1,2 = 93,83 % der Hoehe). */
@media (max-width: 900px) and (orientation: portrait) {
  body::before {
    background-size: auto 120%;
    background-position: calc(30vw - 93.83vh) 0;
    background-position: calc(30vw - 93.83lvh) 0;
  }
}

#login {
  box-sizing: border-box;
  width: 340px;
  max-width: calc(100% - 40px);
  padding: 5% 0 40px;
  margin: 0 auto;
}

@media screen and (max-height: 550px) {
  #login {
    padding-top: 20px;
  }
}

.login h1 {
  margin: 0;
  text-align: center;
}

.login h1 a {
  background: url(/logo.png) center top / 84px 84px no-repeat;
  width: 84px;
  height: 84px;
  margin: 0 auto 25px;
  text-indent: -9999px;
  outline: 0;
  overflow: hidden;
  display: block;
}

/* ---------- Login: rundes Eingabefeld mit Pfeil-Knopf ---------- */

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

#loginform {
  position: relative;
  display: grid;
  margin: 0;
}

#loginform.enter {
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

#loginform.shake {
  animation: shake .2s cubic-bezier(.19, .49, .38, .79) both;
  animation-iteration-count: 3;
}

@keyframes shake {
  25% { transform: translateX(-12px); }
  75% { transform: translateX(12px); }
  100% { transform: translateX(0); }
}

.input,
.submit {
  grid-row: 1;
  grid-column: 1;
}

.input {
  box-sizing: border-box;
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0 60px 0 24px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  caret-color: #5bdcfb;
  background: rgba(38, 42, 50, .62);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 27px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .input {
    background: rgba(38, 42, 50, .9);
  }
}

.input[type="password"] {
  letter-spacing: .16em;
}

.input::placeholder {
  color: rgba(255, 255, 255, .55);
  letter-spacing: normal;
}

.input:hover {
  border-color: rgba(255, 255, 255, .34);
}

.input:focus {
  background: rgba(38, 42, 50, .7);
  border-color: rgba(91, 220, 251, .9);
  box-shadow: 0 0 0 4px rgba(91, 220, 251, .18), 0 24px 50px -20px rgba(0, 0, 0, .85);
}

.has-error .input {
  border-color: rgba(255, 107, 107, .85);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, .15), 0 24px 50px -20px rgba(0, 0, 0, .85);
}

.submit {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: end;
  width: 40px;
  height: 40px;
  margin: 0 7px 0 0;
  padding: 0;
  color: #04222e;
  background: linear-gradient(180deg, #6fe2fc 0%, #1fb9ec 100%);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 18px -8px rgba(31, 185, 236, .8), inset 0 1px 0 rgba(255, 255, 255, .45);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform .12s, filter .15s;
}

.submit:hover {
  filter: brightness(1.07);
}

.submit:active {
  transform: scale(.95);
}

.submit:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.submit-arrow {
  transition: opacity .15s, transform .15s;
}

.submit:hover .submit-arrow {
  transform: translateX(2px);
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(4, 34, 46, .25);
  border-top-color: #04222e;
  border-radius: 50%;
  opacity: 0;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.busy .submit {
  pointer-events: none;
}

.busy .submit-arrow {
  opacity: 0;
}

.busy .spinner {
  opacity: 1;
}

.error {
  grid-row: 2;
  justify-self: center;
  margin: 14px 0 0;
  padding: 6px 14px 7px;
  font-size: 13px;
  color: #ffb4b4;
  background: rgba(17, 19, 23, .62);
  border: 1px solid rgba(255, 107, 107, .35);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.error[hidden] {
  display: none;
}
