/* ================================================================
   Schergen Corp – Anmeldung und Verwaltung
   Gleiche Farbwelt wie die Werkzeuge.
   ================================================================ */

:root {
  --bg:            #0e1016;
  --surface:       rgba(255, 255, 255, .045);
  --surface-2:     rgba(255, 255, 255, .075);
  --line:          rgba(255, 255, 255, .10);
  --line-soft:     rgba(255, 255, 255, .06);
  --text:          #e8ebf2;
  --text-dim:      #98a1b5;
  --accent:        #7aa2ff;
  --accent-strong: #5b86ff;
  --ok:            #2fd68b;
  --warn:          #ffc861;
  --off:           #ff5468;
  --radius:        16px;
  --shadow:        0 18px 45px rgba(0, 0, 0, .45);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 12% -10%, #26304a 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #2a2140 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
code { font-family: var(--mono); font-size: .92em; }
a { color: var(--accent); }

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: .5rem .9rem;
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover  { background: var(--surface-2); border-color: rgba(255,255,255,.18); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #0b1020;
  font-weight: 650;
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost  { background: transparent; }
.btn--wide   { width: 100%; padding: .7rem 1rem; margin-top: .4rem; }
.btn--danger { border-color: rgba(255,84,104,.4); color: #ffc3ca; background: rgba(255,84,104,.10); }
.btn--danger:hover { background: rgba(255,84,104,.18); border-color: rgba(255,84,104,.6); }

/* ----------------------------------------------------------------
   Anmeldeseite
   ---------------------------------------------------------------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }

.auth-card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  text-align: left;
}
.auth-card--wide { width: min(480px, 100%); }

.auth-badge {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  border-radius: 15px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}
.auth-sub  { color: var(--text-dim); margin: .35rem 0 1.4rem; font-size: .92rem; }
.auth-meta { color: var(--text-dim); font-size: .82rem; margin: 1rem 0 0; }
.auth-back {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--text-dim);
  font-size: .84rem;
  text-decoration: none;
}
.auth-back:hover { color: var(--accent); }

.auth-note {
  border-radius: 10px;
  padding: .6rem .8rem;
  font-size: .87rem;
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
}
.auth-note--ok   { border-color: rgba(47,214,139,.4);  background: rgba(47,214,139,.12);  color: #8ae9bf; }
.auth-note--warn { border-color: rgba(255,200,97,.4);  background: rgba(255,200,97,.12);  color: #ffdca0; }
.auth-note--bad  { border-color: rgba(255,84,104,.4);  background: rgba(255,84,104,.12);  color: #ffc3ca; }

/* ----------------------------------------------------------------
   Formularfelder
   ---------------------------------------------------------------- */
.field { display: block; margin-bottom: .9rem; }
.field > span {
  display: block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin-bottom: .35rem;
}
.field input {
  width: 100%;
  padding: .6rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, .18);
}

.check, .radio {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .25rem 0;
  cursor: pointer;
  font-size: .9rem;
}
.check input, .radio input { accent-color: var(--accent); margin-top: .25rem; flex: none; }
.check em, .radio em { font-style: normal; color: var(--text-dim); font-size: .88em; margin-left: .3rem; }
.check--tight { padding: .1rem 0; font-size: .85rem; }

.groups {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: .7rem .9rem;
  margin: 0 0 1rem;
}
.groups legend {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  padding: 0 .4rem;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.form { margin-bottom: 1rem; }
.form--inline {
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  flex-wrap: wrap;
  padding-top: .8rem;
  border-top: 1px solid var(--line-soft);
}
.form--inline .field { margin-bottom: 0; flex: 1; min-width: 12rem; }

/* ----------------------------------------------------------------
   Verwaltung
   ---------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 16, 22, .72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar__brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; }
.topbar__logo  { font-size: 1.25rem; }
.topbar__right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.topbar__user {
  color: var(--text-dim);
  font-size: .86rem;
  padding: .3rem .7rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.shell {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) 3rem;
}
.shell--narrow { max-width: 560px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem clamp(1rem, 2vw, 1.3rem) 1.2rem;
  margin-bottom: clamp(.9rem, 2vw, 1.2rem);
}
.card__title { font-size: 1.05rem; margin-bottom: .9rem; }
.note { color: var(--text-dim); font-size: .87rem; margin: 0 0 1rem; }
.hint { color: var(--text-dim); font-size: .82rem; margin: .5rem 0 .9rem; }
.dim  { color: var(--text-dim); }

.tabs {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .25);
  margin-bottom: 1.2rem;
}
.tab {
  color: var(--text-dim);
  font-weight: 600;
  padding: .35rem 1.1rem;
  border-radius: 9px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-2); color: var(--text); }

/* Einträge in Listen (Benutzer, Gruppen) */
.item {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: .7rem .9rem;
  margin-bottom: .6rem;
  background: rgba(255,255,255,.015);
}
.item--off { opacity: .55; }
.item__head { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.item__name { font-family: var(--mono); font-weight: 650; }
.item__label { color: var(--text-dim); font-size: .88rem; }
.item__groups { margin-left: auto; font-size: .82rem; color: var(--text-dim); }

.pill {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  padding: .12rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.pill--admin { color: #b9ccff; border-color: rgba(122,162,255,.4); background: rgba(122,162,255,.12); }

.item__edit { margin-top: .6rem; }
.item__edit > summary {
  cursor: pointer;
  font-size: .84rem;
  color: var(--text-dim);
  list-style: none;
  display: inline-block;
  padding: .15rem .5rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.item__edit > summary::-webkit-details-marker { display: none; }
.item__edit > summary:hover { color: var(--accent); border-color: rgba(122,162,255,.4); }
.item__edit[open] > summary { margin-bottom: .9rem; }

/* Rechtematrix */
.matrix {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(160px, 1.2fr);
  gap: .8rem 1.2rem;
  align-items: start;
  padding: .8rem 0;
  border-top: 1px solid var(--line-soft);
}
.matrix:first-of-type { border-top: 0; }
.matrix__app { display: flex; flex-direction: column; gap: .1rem; }
.matrix__app .dim { font-family: var(--mono); font-size: .76rem; }
.matrix__access { display: flex; flex-direction: column; gap: .1rem; }
.matrix__groups { display: flex; flex-direction: column; gap: .1rem; font-size: .85rem; }

/* Wertetabelle im Konto */
.facts { display: grid; grid-template-columns: minmax(110px, 150px) 1fr; gap: .4rem 1rem; margin: 0; }
.facts dt { color: var(--text-dim); font-size: .85rem; }
.facts dd { margin: 0; }

.foot {
  color: var(--text-dim);
  font-size: .8rem;
  text-align: center;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 700px) {
  .row2 { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: 1fr; gap: .4rem; }
  .item__groups { margin-left: 0; width: 100%; }
  .topbar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Zweiter Faktor bei der Anmeldung */
.auth-qr { width: 220px; height: 220px; margin: 14px auto; }
.auth-qr svg { width: 100%; height: 100%; border-radius: 10px; display: block; }
.auth-geheim { font-family: var(--mono); text-align: center; background: var(--surface-2); padding: 10px; border-radius: 8px; word-break: break-all; margin: 6px 0 14px; }
.auth-code { font-family: var(--mono) !important; font-size: 1.35rem !important; letter-spacing: .2em; text-align: center; }
.auth-ersatz { columns: 2; font-family: var(--mono); font-size: 1.05rem; padding-left: 20px; margin: 16px 0 20px; }
.auth-zurueck { text-align: center; margin-top: 12px; }
.auth-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
