/* Farben aus der bestehenden Wagenliste/RailDocCheck-Linie, damit die Toolbox nicht
   wie ein Fremdkoerper wirkt: lila #5C4B96, schiefergrau #34495E, blau #3D5A80. */
:root {
  --lila: #3D4A85;
  --lila-dunkel: #2C3766;
  --grau: #34495E;
  --blau: #2C4568;
  --text: #22202b;
  --muted: #6b6580;
  --rand: #ddd8ea;
  --fehler: #b3261e;
  --flaeche: #f6f4fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--flaeche);
  line-height: 1.5;
}

/* ---------- Anmeldung ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--lila) 0%, var(--grau) 100%);
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 32px 30px 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.login-box .marke {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-box h1 {
  margin: 2px 0 6px;
  font-size: 27px;
  color: var(--lila);
}

.sub { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }

label {
  display: block;
  margin: 14px 0 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--grau);
}

input[type=text], input[type=password], select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--rand);
  border-radius: 9px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--lila);
  box-shadow: 0 0 0 3px rgba(92, 75, 150, .16);
}

button[type=submit] {
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: var(--lila);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button[type=submit]:hover { background: var(--lila-dunkel); }

.fuss { margin: 16px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; }

.meldung {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 4px;
}

.meldung.fehler { background: #fdecec; border: 1px solid #f0c2c0; color: var(--fehler); }
.meldung.hinweis { background: #eef4fb; border: 1px solid #c8dbf0; color: var(--blau); }

/* ---------- Angemeldeter Bereich ---------- */

.topbar {
  background: var(--lila);
  color: #fff;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar .marke { font-size: 16px; letter-spacing: .02em; }
.topbar .marke strong { font-weight: 700; }
.topbar .rechts { display: flex; align-items: center; gap: 14px; }
.topbar .wer { font-size: 12.5px; opacity: .92; }

/* "Konto" und "Abmelden" als zusammengehoerendes Paar: enger Abstand zueinander, klar
   getrennt vom Namenstext links davon (Abstand kommt aus .rechts' gap). Beide Knoepfe
   teilen sich EINE Stilklasse, damit sie sich nie wieder auseinanderentwickeln koennen -
   frueher hatten "Konto" (Link) und "Abmelden" (Button) leicht unterschiedliche Optik. */
.knopfgruppe { display: flex; align-items: center; gap: 8px; }

/* Ueber ".knopfgruppe .topbar-btn" statt nur ".topbar-btn" verscharft: die generische
   Regel "button[type=submit]" (Typ+Attribut, hoehere Spezifitaet als eine blosse Klasse)
   hat sonst width/border/margin von "Abmelden" ueberschrieben, waehrend "Konto" als <a>
   davon unberuehrt blieb - dadurch sahen beide Knoepfe unterschiedlich aus, obwohl beide
   dieselbe Klasse trugen. Jede hier kollidierende Eigenschaft steht deshalb explizit da. */
.knopfgruppe .topbar-btn {
  display: inline-block;
  width: auto;
  margin: 0;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .75);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
}

.knopfgruppe .topbar-btn:hover { background: rgba(255, 255, 255, .2); }

.abschnitt {
  margin: 28px 0 6px;
  font-size: 16px;
  color: var(--grau);
  padding-top: 18px;
  border-top: 1px solid var(--rand);
}

.geraete {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 13px;
}

.geraete th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--rand);
}

.geraete td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--rand);
  vertical-align: middle;
}

.geraete tr.hier td { background: #f7f5fc; }

.hier-marke {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--lila);
  color: #fff;
}

.geraete .loeschen {
  background: transparent;
  border: 1px solid #e3b3b0;
  color: var(--fehler);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.geraete .loeschen:hover { background: #fdecec; }

.inhalt { max-width: 980px; margin: 0 auto; padding: 26px 22px 48px; }
.inhalt h1 { margin: 0 0 4px; font-size: 23px; color: var(--grau); }

.kacheln {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.kachel {
  display: block;
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

a.kachel:hover {
  border-color: var(--lila);
  box-shadow: 0 8px 22px rgba(92, 75, 150, .14);
  transform: translateY(-2px);
}

.kachel h2 { margin: 0 0 6px; font-size: 17px; color: var(--lila); }
.kachel p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.kachel.gesperrt { opacity: .62; }

.marken { display: flex; flex-wrap: wrap; gap: 6px; }

.stufe {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #efeaf9;
  color: var(--lila);
}

.stufe.admin { background: var(--lila); color: #fff; }
.stufe.lesen { background: #eceff3; color: var(--grau); }
.stufe.extra { background: #e6eff8; color: var(--blau); }

.bald {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.leer { color: var(--muted); }

/* ---------- Zweiter Faktor ---------- */

.code-feld {
  font-size: 24px;
  letter-spacing: .32em;
  text-align: center;
  font-family: "Consolas", ui-monospace, monospace;
}

.merken {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
}

.merken input { width: auto; }

.schritte { margin: 0 0 16px; padding-left: 20px; font-size: 13px; color: var(--muted); }
.schritte li { margin-bottom: 4px; }

.qr {
  display: flex;
  justify-content: center;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 10px;
}

.qr svg { display: block; width: 190px; height: 190px; }

.notfall { margin: 16px 0 0; font-size: 13px; }
.notfall summary { cursor: pointer; color: var(--blau); }
.notfall .sub { margin: 10px 0 6px; }

.geheimnis {
  display: block;
  padding: 10px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
  font-family: "Consolas", ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: .08em;
  word-break: break-all;
}

.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 16px;
}

.codes span {
  padding: 9px;
  text-align: center;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
  font-family: "Consolas", ui-monospace, monospace;
  font-size: 14px;
}

.weiter {
  display: block;
  margin-top: 14px;
  padding: 11px;
  text-align: center;
  background: var(--lila);
  color: #fff;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
}

.weiter:hover { background: var(--lila-dunkel); }

.abbruch {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--rand);
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
}

.abbruch:hover { border-color: var(--muted); }

.konto-zeile {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--rand);
  font-size: 12.5px;
  color: var(--muted);
}

.konto-zeile a { color: var(--lila); }
