/* ============================================================
   Bechtle Lizenzmanagement — Komponenten
   ============================================================ */

/* ---------- KPI-Kacheln ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--future), var(--accent));
  opacity: 0; transition: opacity .16s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi:hover::before { opacity: 1; }
.kpi .label { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .09em; font-weight: 650; }
.kpi .value { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -.02em; }
.kpi .hint { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.kpi .hint.warn { color: var(--warn); font-weight: 550; }
.kpi .hint.crit { color: var(--crit); font-weight: 550; }

/* ---------- Karten & Tabellen ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card.pad { padding: 16px 18px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); font-weight: 650; padding: 11px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--accent-soft); }
tbody tr.clickable:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td.clickable { cursor: pointer; }
td.clickable:hover { color: var(--accent-hover); text-decoration: underline; }
tfoot td { font-weight: 650; background: var(--surface-2); }
.muted { color: var(--ink-faint); }
.tiny { font-size: 11.5px; }
.cancelled td { opacity: .55; }
.cancelled .desc { text-decoration: line-through; }
.empty { padding: 22px; color: var(--ink-faint); }
.inaktiv-row td { opacity: .5; }

/* ---------- Pills & Badges ---------- */
.pill {
  display: inline-block; padding: 2.5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 650; white-space: nowrap; letter-spacing: .01em;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: var(--surface-2); color: var(--ink-soft); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.pill.modell-sub { background: var(--future-soft); color: var(--exp); }
.pill.modell-kauf { background: var(--surface-2); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }
.pill.abr-bereit { background: var(--accent-soft); color: var(--accent-hover); }
.pill.abr-wartung { background: var(--ok-soft); color: var(--ok); }
.pill.abr-frei { background: var(--surface-2); color: var(--ink-faint); }
.pill.verl-auto { background: var(--ok-soft); color: var(--ok); }
.pill.verl-fix { background: var(--warn-soft); color: var(--warn); }

/* ---------- Buttons, Toolbar, Filter ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 220px; max-width: 360px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn {
  padding: 9px 16px; border-radius: 11px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #1d9560); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px -4px rgba(35, 169, 106, .55);
}
.btn.primary:hover { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); color: #fff; box-shadow: 0 6px 18px -4px rgba(35, 169, 106, .65); }
@media (prefers-color-scheme: dark) { .btn.primary, .btn.primary:hover { color: #04321f; } }
.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.danger { color: var(--crit); border-color: var(--crit-soft); }
.btn.danger:hover { border-color: var(--crit); color: var(--crit); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .search:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.filterbar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.filterbar label { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: var(--ink-faint); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.filterbar input, .filterbar select {
  padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.filterbar input:focus, .filterbar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.count-hint { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 10px; }

/* ---------- Detail: Kopf, Fakten, Hinweise ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin: 0 0 18px; box-shadow: var(--shadow-sm);
}
.facts dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin: 0; font-weight: 650; }
.facts dd { margin: 2px 0 0; font-weight: 620; font-size: 15px; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.infobar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--info-soft); color: var(--info); border-radius: 12px;
  padding: 11px 15px; font-size: 13px; margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
}
.backlink { background: none; border: 0; color: var(--accent-hover); font: inherit; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 14px; display: inline-block; }
.backlink:hover { text-decoration: underline; }
.days { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Volumen-Meter ---------- */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.meter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.meter .m-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.meter .m-val { font-variant-numeric: tabular-nums; font-weight: 650; }
.meter .track { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--future)); animation: growbar .8s cubic-bezier(.2, .7, .2, 1); }
.meter .fill.warn { background: linear-gradient(90deg, var(--warn), #ff9c5c); }
.meter .m-foot { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
@keyframes growbar { from { width: 0 !important; } }

/* ---------- Dokumente ---------- */
.docs { display: flex; flex-direction: column; }
.doc { display: flex; align-items: center; gap: 11px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.doc:last-child { border-bottom: 0; }
.doc a { color: var(--accent-hover); font-weight: 550; }
.doc .d-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700;
  background: var(--future-soft); color: var(--exp);
}
.doc .d-meta { color: var(--ink-faint); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ---------- Diagramme ---------- */
.chart { padding: 20px 20px 12px; }
.chart-title { font-size: 14px; font-weight: 650; margin-bottom: 2px; }
.chart-sub { font-size: 12px; color: var(--ink-faint); margin-bottom: 26px; }
.bars { display: flex; align-items: flex-end; gap: 9px; height: 160px; border-bottom: 1px solid var(--line); position: relative; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.gridline span { position: absolute; right: 100%; margin-right: 8px; top: -8px; font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; min-width: 0; }
.bar {
  width: 100%; max-width: 34px; min-height: 2px;
  background: linear-gradient(180deg, var(--future) -30%, var(--accent) 60%);
  border-radius: 6px 6px 0 0; position: relative;
  animation: growcol .7s cubic-bezier(.2, .7, .2, 1); transform-origin: bottom;
  transition: filter .15s;
}
.bar:hover { filter: brightness(1.12); }
@keyframes growcol { from { transform: scaleY(0); } }
.bar-label { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 650; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-cats { display: flex; gap: 9px; margin-top: 7px; }
.bar-cats span { flex: 1; text-align: center; font-size: 10.5px; color: var(--ink-faint); min-width: 0; }
.bars-wrap { margin-left: 46px; }
.hbars { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 84px; gap: 12px; align-items: center; font-size: 13px; }
.hbar .track { height: 13px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--future)); border-radius: 6px; animation: growbar .8s cubic-bezier(.2, .7, .2, 1); }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 550; }

/* ---------- Modal & Formulare ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 40; padding: 20px;
  background: rgba(4, 50, 31, .45); backdrop-filter: blur(6px);
  display: grid; place-items: center;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px -12px rgba(4, 50, 31, .45);
  padding: 24px 26px; width: min(660px, 96vw); max-height: 90vh; overflow-y: auto;
  animation: pop .25s cubic-bezier(.2, .8, .3, 1.1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal h2 { margin: 0 0 16px; text-transform: none; letter-spacing: -.01em; font-size: 17px; color: var(--ink); font-weight: 650; }
.modal h2::after { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: var(--ink-faint); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-grid label.check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--ink); }
.form-grid input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: 12px; }

/* ---------- Suchpalette (Cmd+K) ---------- */
.palette-btn kbd {
  margin-left: auto; font: inherit; font-size: 10px; padding: 2px 7px;
  border-radius: 6px; border: 1px solid rgba(223, 243, 232, .3); opacity: .7;
}
.palette-overlay {
  position: fixed; inset: 0; z-index: 55; padding: 12vh 20px 20px;
  background: rgba(4, 50, 31, .5); backdrop-filter: blur(7px);
  display: flex; justify-content: center; align-items: flex-start;
}
.palette {
  width: min(620px, 100%); background: var(--surface); border-radius: 18px;
  border: 1px solid var(--line); overflow: hidden;
  box-shadow: 0 30px 80px -16px rgba(4, 50, 31, .55);
  animation: pop .22s cubic-bezier(.2, .8, .3, 1.1);
}
.palette input {
  width: 100%; border: 0; padding: 18px 20px; font: inherit; font-size: 16px;
  background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line);
}
.palette input:focus { outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow-y: auto; }
.palette li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; cursor: pointer; font-size: 13.5px;
}
.palette li.active, .palette li:hover { background: var(--accent-soft); }
.palette li .p-titel { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette li .p-detail { color: var(--ink-faint); font-size: 12px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette li.p-leer { color: var(--ink-faint); cursor: default; }
.palette li.p-leer:hover { background: none; }
.palette-foot { padding: 9px 18px; font-size: 11px; color: var(--ink-faint); border-top: 1px solid var(--line); }

/* ---------- Laufzeiten-Timeline ---------- */
.timeline { padding: 18px 20px 10px; }
.tl-achse { position: relative; height: 18px; margin-left: 210px; }
.tl-achse span { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.tl-row { display: grid; grid-template-columns: 200px 1fr; gap: 10px; align-items: center; padding: 4px 0; }
.tl-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.tl-track { position: relative; height: 16px; background: var(--surface-2); border-radius: 5px; }
.tl-bar {
  position: absolute; top: 2px; bottom: 2px; border-radius: 4px; min-width: 4px;
  background: linear-gradient(90deg, var(--accent), var(--future));
  animation: growbar .7s cubic-bezier(.2, .7, .2, 1);
}
.tl-bar.kauf { background: var(--accent); opacity: .8; }
.tl-bar.offen { background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 6px, color-mix(in srgb, var(--accent) 55%, transparent) 6px, color-mix(in srgb, var(--accent) 55%, transparent) 12px); }
.tl-heute { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--crit); border-radius: 1px; }
.tl-frist { position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); }
.tl-legende { display: flex; gap: 18px; margin-top: 10px; font-size: 11px; color: var(--ink-faint); flex-wrap: wrap; }
.tl-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Bulk-Auswahl ---------- */
td.check, th.check { width: 34px; text-align: center; padding-left: 10px; padding-right: 4px; }
.bulkbar {
  position: sticky; bottom: 14px; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  background: var(--exp-deep); color: #fff; border-radius: 14px;
  padding: 11px 18px; margin-top: 14px;
  box-shadow: 0 12px 34px -8px rgba(4, 50, 31, .6);
  border-left: 4px solid var(--future);
  animation: toastin .25s cubic-bezier(.2, .8, .3, 1.1);
}
.bulkbar strong { font-variant-numeric: tabular-nums; }

/* ---------- Aktivitäten-Feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.feed-item:last-child { border-bottom: 0; }
.feed-datum { color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }
.feed-wer { font-weight: 650; white-space: nowrap; }
.feed-text { color: var(--ink-soft); }
.feed-kunde { color: var(--accent-hover); font-weight: 550; cursor: pointer; white-space: nowrap; }
.feed-kunde:hover { text-decoration: underline; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--exp-deep); color: #fff; padding: 12px 22px; border-radius: 12px;
  font-weight: 600; z-index: 60; box-shadow: 0 10px 30px -6px rgba(4, 50, 31, .5);
  border-left: 4px solid var(--future);
  animation: toastin .3s cubic-bezier(.2, .8, .3, 1.1);
}
.toast.error { background: var(--crit); border-left-color: #fff; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 14px); } }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 104px 1fr 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar, .meter .fill, .hbar .fill, .modal, .toast { animation: none; }
  .kpi:hover, .btn:hover { transform: none; }
}

/* ---------------------------------------------------------------- Zwei-Faktor */
.modal h2:empty { display: none; margin: 0; }
.modal.wide { width: min(780px, 96vw); padding: 0; overflow: hidden; }
.modal.wide #modal-form { display: block; }

/* Zweigeteilte Einrichtungskarte: links Scanner, rechts Formular */
.mfa-setup { display: grid; grid-template-columns: 300px 1fr; min-height: 460px; }
.mfa-scan {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 34px 26px; text-align: center; color: #dff3e8;
  background: radial-gradient(420px 300px at 50% 18%, rgba(47, 251, 149, .14), transparent 65%),
              linear-gradient(168deg, #0a3d27 0%, var(--exp-deep) 58%, #021911 100%);
}
.mfa-scan h3 { margin: 20px 0 2px; font-size: 15px; font-weight: 650; color: #fff; letter-spacing: -.01em; }
.mfa-scan p { margin: 0; font-size: 12px; line-height: 1.5; color: rgba(223, 243, 232, .72); }

/* Sucher-Rahmen mit Ecken + Scanlinie */
.mfa-viewfinder { position: relative; padding: 17px; }
.mfa-viewfinder .vf {
  position: absolute; width: 26px; height: 26px;
  border: 2.5px solid var(--future); border-radius: 2px;
}
.vf.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.vf.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.vf.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.vf.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.mfa-qr-tile { border-radius: 12px; overflow: hidden; box-shadow: 0 10px 32px -8px rgba(0, 0, 0, .55); font-size: 0; }
.mfa-qr-tile svg { width: 188px; height: 188px; display: block; }
.mfa-scanline {
  position: absolute; left: 8px; right: 8px; top: 17px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--future) 22%, #eafff5 50%, var(--future) 78%, transparent);
  box-shadow: 0 0 14px 3px rgba(47, 251, 149, .55);
  animation: scanlinie 2.6s ease-in-out infinite;
}
@keyframes scanlinie {
  0%, 100% { transform: translateY(0); opacity: .95; }
  46% { transform: translateY(182px); opacity: .95; }
  50% { transform: translateY(182px); opacity: .25; }
  96% { transform: translateY(0); opacity: .95; }
}

/* Rechte Seite: Schlüssel, Codefelder, Aktionen */
.mfa-form { padding: 32px 30px 28px; display: flex; flex-direction: column; }
.mfa-form h3 { margin: 0 0 6px; font-size: 19px; font-weight: 680; letter-spacing: -.015em; color: var(--ink); }
.mfa-sub { margin: 0 0 22px; font-size: 13px; line-height: 1.55; color: var(--ink-soft); }
.mfa-label { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); margin: 0 0 7px; }
.mfa-key {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 8px 10px 14px;
}
.mfa-key code { flex: 1; font-size: 13px; letter-spacing: .09em; color: var(--ink); overflow-wrap: anywhere; }
.mfa-key button {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-faint); cursor: pointer;
  transition: background .15s, color .15s;
}
.mfa-key button:hover { background: var(--accent-soft); color: var(--accent); }
.mfa-key button svg { width: 16px; height: 16px; }
.mfa-mini { margin: 7px 0 20px; font-size: 11.5px; color: var(--ink-faint); }
.mfa-actions { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 8px; }
.mfa-cta { border-radius: 999px; padding: 11px 30px; font-size: 13.5px; }

/* Segmentierte 6-stellige Code-Eingabe */
.otp { display: flex; gap: 8px; }
.otp input {
  width: 44px; height: 52px; text-align: center; font-size: 21px; font-weight: 650;
  font-family: inherit; color: var(--ink); caret-color: var(--accent);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 11px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.otp input:not(:placeholder-shown):valid { border-color: var(--line); }
.otp.fehler input { border-color: var(--crit); animation: otp-schuetteln .3s; }
@keyframes otp-schuetteln {
  20% { transform: translateX(-4px); } 40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}

/* Login: zweite Stufe */
#mfa-step .otp { justify-content: center; margin: 2px 0 4px; }
#mfa-step .otp[hidden] { display: none; }
.mfa-wechsel {
  display: block; margin: 8px auto 2px; border: 0; background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--accent); font-family: inherit;
}
.mfa-wechsel:hover { text-decoration: underline; }

/* Passwort-Richtlinie (Live-Checkliste) */
.pw-regeln { list-style: none; margin: 14px 0 4px; padding: 12px 14px; display: grid; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.pw-regeln li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-faint); transition: color .15s; }
.pw-regeln li i {
  flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--line); position: relative; transition: all .15s;
}
.pw-regeln li.erfuellt { color: var(--ink); }
.pw-regeln li.erfuellt i { background: var(--accent); border-color: var(--accent); }
.pw-regeln li.erfuellt i::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg);
}

/* Backup-Codes & Konto */
.mfa-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 14px; }
.mfa-codes code { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; text-align: center; font-size: 13px; letter-spacing: .6px; color: var(--ink); }
.konto-facts p { margin: 0 0 8px; font-size: 13.5px; }
.modal.wide .konto-neu { padding: 26px 30px; }

@media (max-width: 640px) {
  .mfa-setup { grid-template-columns: 1fr; min-height: 0; }
  .mfa-scan { padding: 26px 20px; }
  .otp input { width: 40px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .mfa-scanline { animation: none; opacity: .5; }
  .otp.fehler input { animation: none; }
}
