/**
 * Anmeldeseite und Passwort setzen (#8, #84).
 *
 * Eigene Datei, weil diese Seiten die Anwendung nicht laden. Sie benutzen
 * dieselben Tokens wie alles andere — dieselbe Formsprache, damit die Tür
 * zum Haus gehört und nicht wie eine fremde Seite aussieht.
 *
 * Bewusst schmal gehalten: eine Anmeldeseite hat genau eine Aufgabe.
 */

.auth-body {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--surface-sunken);
  color: var(--text);
  font-family: var(--font-sans);
}

.auth-card {
  width: min(26rem, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-head h1 {
  font-family: var(--font-display);
  font-size: var(--size-xl);
  margin: 0;
}

.auth-head p {
  margin: var(--space-1) 0 0;
  color: var(--text-muted);
  font-size: var(--size-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-form label {
  font-size: var(--size-sm);
  color: var(--text-muted);
}

.auth-form input {
  font: inherit;
  font-size: var(--size-md);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  /* 16px verhindert, dass iOS beim Antippen hineinzoomt — diese Seite wird
     am Handy im Stall benutzt, und ein zoomendes Formular ist dort ein
     echtes Ärgernis. */
  min-height: 2.75rem;
}

.auth-form input:focus-visible,
.auth-form button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-form button {
  font: inherit;
  font-size: var(--size-md);
  margin-top: var(--space-2);
  padding: var(--space-3);
  min-height: 2.75rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
}

.auth-form button:hover:not(:disabled) { background: var(--accent-hover); }
.auth-form button:disabled { opacity: .6; cursor: progress; }

/* Meldungen. Die Farbe sagt dasselbe wie der Text, nie nur die Farbe —
   sonst ist die Aussage für Farbenblinde nicht da. */
.auth-note {
  margin: 0;
  font-size: var(--size-sm);
  color: var(--text-muted);
  min-height: 1.25rem;
}
.auth-note[data-art="fehler"] {
  color: var(--state-alarm);
  background: var(--state-alarm-bg);
  border-left: 3px solid var(--state-alarm-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.auth-note[data-art="hinweis"] {
  color: var(--text);
  background: var(--surface-2);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.auth-note[data-art="gut"] {
  color: var(--state-ok);
  background: var(--state-ok-bg);
  border-left: 3px solid var(--state-ok-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.auth-help summary {
  cursor: pointer;
  font-size: var(--size-sm);
  color: var(--text-muted);
}
.auth-help[open] summary { margin-bottom: var(--space-3); }

.auth-fine {
  font-size: var(--size-xs);
  color: var(--text-faint);
  margin: var(--space-2) 0 0;
}

/* Güteanzeige des Passworts. Keine Ampel mit Note, sondern die schlichte
   Auskunft, wie viele Zeichen noch fehlen — eine Note („mittel") sagt
   niemandem, was zu tun ist. */
.pw-hint {
  font-size: var(--size-xs);
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.pw-hint[data-reicht="ja"] { color: var(--state-ok); }
