/* ═══════════════════════════════════════════════════════════════
   Zwei-Faktor-Anmeldung – Login-Schritt (index.html #mfa-form)
   und Reiter "Sicherheit" in den Einstellungen (js/twofactor.js)
════════════════════════════════════════════════════════════════ */

/* ── Login: zweiter Schritt ───────────────────────────────────── */
.mfa-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.mfa-badge {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; background: linear-gradient(135deg, var(--accent), #ff7a3d);
  box-shadow: 0 8px 24px rgba(232,66,10,.35);
}
.mfa-title { font-size: 19px; font-weight: 800; letter-spacing: -.2px; margin-bottom: 4px; }
.mfa-sub { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.mfa-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .32em; text-align: center; padding: 13px 10px; }
.mfa-code.recovery { font-size: 17px; letter-spacing: .12em; }
.mfa-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.mfa-link { background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--accent2); }
.mfa-link.muted { color: var(--text-3); }
.mfa-link:hover { text-decoration: underline; }

/* ── Einstellungen → Sicherheit ───────────────────────────────── */
.tfa-card { padding: 20px 22px; }
.tfa-card.is-on { border-color: rgba(0,230,118,.28); }
.tfa-top { display: flex; gap: 16px; align-items: flex-start; }
.tfa-ico {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 23px; color: #fff; background: linear-gradient(135deg, var(--accent), #ff7a3d); box-shadow: 0 8px 22px rgba(232,66,10,.3);
}
.tfa-card.is-on .tfa-ico { background: linear-gradient(135deg, #00b85c, var(--accent2)); box-shadow: 0 8px 22px rgba(0,230,118,.22); }
.tfa-main { flex: 1; min-width: 0; }
.tfa-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tfa-chip {
  font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  color: var(--danger, #f5365c); background: rgba(245,54,92,.10); border: 1px solid rgba(245,54,92,.28);
}
.tfa-chip.on { color: var(--success); background: rgba(0,230,118,.10); border-color: rgba(0,230,118,.28); }
.tfa-text { font-size: 13px; color: var(--text-2); line-height: 1.55; margin: 0 0 10px; }
.tfa-text b { color: var(--text-1); }
.tfa-sub { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.tfa-warn { color: var(--warning); font-weight: 700; }
.tfa-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.tfa-actions .btn-ghost, .tfa-actions .btn-danger { padding: 9px 14px; font-size: 13px; }
.tfa-go { width: auto; padding: 11px 20px; font-size: 14px; }
.tfa-go:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.tfa-flow { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.tfa-form { display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.tfa-form .form-label { margin: 6px 0 0; }

.tfa-steps { list-style: none; padding: 0; margin: 0 0 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.tfa-steps li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.tfa-steps li + li::before { content: ''; width: 22px; height: 1px; background: var(--border); margin-right: 1px; }
.tfa-steps span {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; border: 1px solid var(--border);
}
.tfa-steps .cur { color: var(--text-1); }
.tfa-steps .cur span { border-color: transparent; color: #fff; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.tfa-steps .done span { border-color: rgba(0,230,118,.5); color: var(--success); }

.tfa-scan { display: grid; grid-template-columns: 240px 1fr; gap: 26px; align-items: start; }
.tfa-qr-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tfa-qr {
  width: 220px; aspect-ratio: 1; padding: 10px; border-radius: 18px; background: #fff;
  display: flex; align-items: center; justify-content: center; color: #889; font-size: 24px;
  box-shadow: 0 0 0 1px var(--border), 0 14px 40px rgba(232,66,10,.22);
}
.tfa-qr svg { width: 100%; height: 100%; display: block; }
.tfa-qr .tfa-text { color: #556; font-size: 12px; text-align: center; padding: 12px; }
.tfa-open { display: none; text-decoration: none; padding: 8px 12px; font-size: 13px; }
@media (pointer: coarse) { .tfa-open { display: inline-flex; align-items: center; gap: 6px; } }
.tfa-how { padding-left: 18px; margin: 0 0 12px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.tfa-manual { margin-bottom: 14px; font-size: 13px; }
.tfa-manual summary { cursor: pointer; color: var(--accent2); font-weight: 600; margin-bottom: 8px; }
.tfa-secret {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed var(--border); background: rgba(0,0,0,.18);
}
.tfa-secret code { flex: 1; font-family: var(--font-mono); font-size: 14px; color: var(--accent2); letter-spacing: .05em; word-break: break-all; }
.tfa-secret .btn-ghost { padding: 6px 10px; font-size: 12px; }
.tfa-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .32em; text-align: center; max-width: 260px; }
.tfa-code.small { font-size: 16px; letter-spacing: .12em; }

.tfa-done {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: var(--success); background: rgba(0,230,118,.08); border: 1px solid rgba(0,230,118,.25);
}
.tfa-codes {
  list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px;
  border-radius: 12px; background: rgba(0,0,0,.18); border: 1px solid var(--border); max-width: 460px;
}
.tfa-codes li { font-family: var(--font-mono); font-size: 15px; text-align: center; color: var(--text-1); }
.tfa-saved { margin-top: 14px; }
[data-theme="light"] .tfa-secret, [data-theme="light"] .tfa-codes { background: rgba(0,0,0,.04); }

/* Admin-Benutzerliste */
.tfa-user-badge {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px; margin-left: 4px; white-space: nowrap;
  color: var(--success); background: rgba(0,230,118,.10); border: 1px solid rgba(0,230,118,.25);
}

@media (max-width: 700px) {
  .tfa-card { padding: 16px; }
  .tfa-top { flex-direction: column; gap: 12px; }
  .tfa-scan { grid-template-columns: 1fr; gap: 18px; }
  .tfa-qr { width: min(240px, 100%); }
  .tfa-code { max-width: none; }
  .tfa-actions > * { flex: 1 1 auto; justify-content: center; }
}
