/* ============================================================
   TJCreate – Authelia Login Theme
   Ergänzt Authelias natives `theme: dark` (lesbare helle Schrift)
   um das TJCreate-Branding. Wird per nginx sub_filter in
   auth.tjcreate.de eingebunden (alias /var/www/assets/...).
   Hinweis: Theme MUSS in configuration.yml `dark` sein – sonst
   rendert MUI dunkle Schrift auf dunklem Grund.
   ============================================================ */

:root {
  --tj-bg:          #0f1418;   /* Grundfläche */
  --tj-text:        #eef3f5;   /* Haupttext */
  --tj-teal:        #42b7c8;   /* Akzent / Fokus */
  --tj-teal-strong: #23899a;   /* Primär-Button */
  --tj-teal-hover:  #2aa2b5;   /* Button hover */
  --tj-link:        #63c8d7;   /* Links */
  --tj-link-hover:  #8bd9e5;
  --tj-radius:      10px;
  color-scheme: dark;
}

/* Grundfläche – ruhiges, gleichmäßiges Dunkel (kein Verlauf →
   keine Nähte zwischen body und #root). */
html,
body,
#root {
  background: var(--tj-bg) !important;
  color: var(--tj-text) !important;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif !important;
}

/* Teal-Akzentleiste oben über die volle Breite */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #23899a 0%, #42b7c8 50%, #63c8d7 100%);
  z-index: 10;
}

/* Logo – mittig, mit dezentem teal Schimmer */
img[alt="Logo"] {
  content: url("/tjcreate-login-logo.png") !important;
  width: 120px !important;
  height: 120px !important;
  object-fit: contain !important;
  margin-bottom: 16px !important;
  filter: drop-shadow(0 6px 18px rgba(66, 183, 200, 0.18));
}

/* Eingabefelder – abgerundet, teal Fokus */
input,
fieldset {
  border-radius: var(--tj-radius) !important;
}
input:focus,
fieldset:has(input:focus) {
  border-color: var(--tj-teal) !important;
}

/* Sicherheitsnetz: sichtbarer Eingabetext IMMER hell – unabhängig von
   MUI-Theme-Zuständen. */
input,
.MuiInputBase-input {
  color: var(--tj-text) !important;
  -webkit-text-fill-color: var(--tj-text) !important;
}
input::placeholder,
.MuiInputBase-input::placeholder {
  color: #7d929b !important;
  -webkit-text-fill-color: #7d929b !important;
  opacity: 1 !important;
}

/* Browser-Autofill (Passwort-Manager) – die häufigste „manchmal dunkle
   Schrift"-Ursache: der Browser färbt autofilled Felder selbst ein
   (heller/gelber BG + dunkler Text). Hier erzwungen hell auf dunklem Grund. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--tj-text) !important;
  caret-color: var(--tj-text) !important;
  -webkit-box-shadow: 0 0 0 1000px #161c21 inset !important;
  box-shadow: 0 0 0 1000px #161c21 inset !important;
  transition: background-color 9999s ease-in-out 0s !important;
}

/* Textauswahl in Markenfarbe */
::selection {
  background: rgba(66, 183, 200, 0.35);
  color: #ffffff;
}

/* MUI Fokus-/Checkbox-/Outline-Akzent */
.Mui-focused,
.MuiCheckbox-root.Mui-checked {
  color: var(--tj-teal) !important;
}
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--tj-teal) !important;
}

/* Primär-Button „Anmelden" */
#sign-in-button {
  min-height: 48px !important;
  border-radius: var(--tj-radius) !important;
  background: var(--tj-teal-strong) !important;
  box-shadow: 0 6px 18px rgba(35, 137, 154, 0.30) !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease !important;
}
#sign-in-button:hover {
  background: var(--tj-teal-hover) !important;
  box-shadow: 0 8px 22px rgba(42, 162, 181, 0.38) !important;
}
#sign-in-button:active {
  transform: translateY(1px) !important;
}

/* Links: „Passwort zurücksetzen", „Betrieben mit Authelia" */
#reset-password-button,
a {
  color: var(--tj-link) !important;
  transition: color 0.15s ease !important;
}
#reset-password-button:hover,
a:hover {
  color: var(--tj-link-hover) !important;
}

/* Mobile-First Feinschliff (Touch-Ziele ≥ 44px) */
@media (max-width: 600px) {
  body::before { height: 4px; }
  img[alt="Logo"] {
    width: 104px !important;
    height: 104px !important;
    margin-bottom: 12px !important;
  }
  #sign-in-button { min-height: 50px !important; }
}

/* Bewegung reduzieren respektieren */
@media (prefers-reduced-motion: reduce) {
  #sign-in-button,
  #reset-password-button,
  a { transition: none !important; }
}
