/* ============================================================================
   Anmeldemaske. Nutzt die Farben und Radien aus theme.css, bringt aber ihr
   eigenes, mittiges Layout mit – die App-Shell (nav.js) läuft hier nicht.
   ========================================================================= */

.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  /* Zarter Farbverlauf, damit die Karte nicht auf leerer Fläche schwebt. */
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(31, 107, 255, 0.14), transparent 70%),
    radial-gradient(700px 460px at 92% 108%, rgba(123, 104, 238, 0.12), transparent 72%),
    var(--page);
}

.login-wrap {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card), 0 24px 60px rgba(30, 52, 110, 0.1);
  padding: 34px 32px 26px;
  animation: karte-auf 0.42s cubic-bezier(0.22, 0.68, 0.32, 1) both;
}

@keyframes karte-auf {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

/* ---------- Kopf ---------- */

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}
.login-brand .brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
}
.login-brand .brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.login-titel {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.login-sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- Felder ---------- */

.login-form {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.feld {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.feld-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}

.feld input[type="text"],
.feld input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--tile);
  border: 1px solid var(--line-2);
  border-radius: 13px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.feld input::placeholder {
  color: var(--muted);
}
.feld input:hover {
  border-color: #cdd8ea;
}
.feld input:focus {
  background: var(--card);
  border-color: var(--blue-2);
  box-shadow: 0 0 0 4px rgba(31, 107, 255, 0.14);
}
/* Autofill des Browsers nicht knallgelb werden lassen. */
.feld input:-webkit-autofill,
.feld input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--tile) inset, 0 0 0 4px rgba(31, 107, 255, 0);
  transition: background-color 9999s;
}

.feld-mit-knopf {
  position: relative;
  display: block;
}
.feld-mit-knopf input {
  padding-right: 46px;
}

.augen-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.16s, background 0.16s;
}
.augen-btn:hover {
  color: var(--ink-2);
  background: var(--tile-2);
}
.augen-btn:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 1px;
}

.caps-hinweis {
  font-size: 12px;
  color: var(--amber);
  font-weight: 600;
}

/* ---------- Angemeldet bleiben ---------- */

.merken {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  margin-top: -2px;
}
.merken input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* ---------- Fehler ---------- */

.login-fehler {
  margin: 0;
  padding: 11px 13px;
  font-size: 13.5px;
  font-weight: 500;
  color: #a8323e;
  background: var(--red-soft);
  border: 1px solid rgba(228, 80, 92, 0.24);
  border-radius: 12px;
  animation: fehler-rein 0.22s ease both;
}
@keyframes fehler-rein {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.login-card.zittert {
  animation: zittern 0.32s ease;
}
@keyframes zittern {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}

/* ---------- Knopf ---------- */

.login-btn {
  position: relative;
  height: 48px;
  margin-top: 5px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(31, 107, 255, 0.28);
  transition: background 0.16s, box-shadow 0.16s, transform 0.1s;
}
.login-btn:hover:not(:disabled) {
  background: #1a5ee6;
}
.login-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(31, 107, 255, 0.26);
}
.login-btn:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 2px;
}
.login-btn:disabled {
  cursor: default;
  opacity: 0.75;
  box-shadow: none;
}

.btn-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dreht 0.7s linear infinite;
}
.login-btn.laedt .btn-text {
  visibility: hidden;
}
.login-btn.laedt .btn-spinner {
  display: block;
}
@keyframes dreht {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Fuß ---------- */

.login-fuss {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  text-wrap: pretty;
}
.login-fuss code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--tile-2);
  color: var(--ink-2);
}

@media (max-width: 420px) {
  .login-card {
    padding: 28px 22px 22px;
  }
  .login-titel {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card,
  .login-fehler {
    animation: none;
  }
  .login-card.zittert {
    animation: none;
  }
}
