/* Aussehen der Anmeldeseite (eigene Datei, weil sie ohne Anmeldung erreichbar sein muss). */

@font-face {
  font-family: "Grandstander";
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/grandstander-700.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/atkinson-hyperlegible-400.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/atkinson-hyperlegible-700.woff2") format("woff2");
}

:root {
  color-scheme: only light; /* kein automatisches Umfärben im Dunkelmodus */
  --ink: #2e2a5a;
  --outline: #3b2f4a;
  --cream: #fbf6ee;
  --coral: #e98a7d;
  --coral-dark: #d9776a;
  --lilac: #eadff3;
  --font-title: "Grandstander", ui-rounded, "Arial Rounded MT Bold", "Chalkboard SE", sans-serif;
  --font-text: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 24px 16px;
  /* kleine Sterne im Hintergrund */
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 213, 110, 0.55) 0 3px, transparent 4px) 0 0 / 90px 90px,
    radial-gradient(circle at 70% 75%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px) 0 0 / 70px 70px,
    var(--lilac);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 18px;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(440px, 100%);
  padding: 32px 28px 28px;
  border: 3px solid var(--outline);
  border-radius: 34px;
  background: var(--cream);
  box-shadow: 0 8px 0 rgba(59, 47, 74, 0.25), 0 20px 40px rgba(46, 42, 90, 0.18);
  text-align: center;
}

.login-icon {
  width: 150px;
  height: 150px;
  margin-top: -90px;
  border: 4px solid var(--outline);
  border-radius: 38px;
  background: #ffffff;
  box-shadow: 0 6px 0 rgba(59, 47, 74, 0.25);
}

.login-title {
  margin: 6px 0 0;
  font-family: var(--font-title);
  font-size: 30px;
  line-height: 1.15;
}

.login-hint {
  margin: 0;
}

.login-form,
.login-account {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.login-form[hidden],
.login-account[hidden],
.login-input[hidden] {
  display: none;
}

.login-input {
  width: 100%;
  min-height: 56px;
  padding: 12px 18px;
  border: 3px solid #d9cfe3;
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
}

.login-input:focus {
  border-color: var(--outline);
  outline: none;
}

.login-button {
  display: block;
  min-height: 58px;
  padding: 14px 20px;
  border: 3px solid var(--outline);
  border-radius: 20px;
  background: var(--coral);
  box-shadow: 0 5px 0 var(--outline);
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.login-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--outline);
}

.login-button:disabled {
  opacity: 0.6;
}

.login-button--small {
  min-height: 50px;
  font-size: 20px;
}

.login-link {
  padding: 8px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.login-message {
  min-height: 1.4em;
  margin: 0;
  color: #b8443a;
  font-weight: 700;
}

.login-message.is-good {
  color: #2f8a48;
}

.login-note {
  margin: 0;
  font-size: 15px;
  opacity: 0.8;
}

/* Passwortfeld mit Augen-Knopf zum Anzeigen */
.password-field {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 160px;
}

.password-field[hidden] {
  display: none;
}

.password-field > input {
  flex: 1;
  width: 100%;
  padding-right: 58px;
}

.password-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-eye:focus-visible {
  outline: 3px solid var(--coral);
}

.password-eye img {
  width: 30px;
  height: 30px;
  pointer-events: none;
}

/* Falsches Passwort: Feld wackelt kurz */
.is-shaking {
  animation: shake 400ms ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
