/* Anmelde-Overlay (Netzwerkportal) */

html.nw-auth-done #nw-auth-gate {
  display: none !important;
}

body.nw-auth-gate--open {
  overflow: hidden;
}

body.nw-auth-gate--open .app {
  pointer-events: none;
  user-select: none;
}

.nw-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 20, 25, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

html[data-theme="dark"] .nw-auth-gate {
  background: rgba(0, 0, 0, 0.65);
}

.nw-auth-gate__card {
  width: 100%;
  max-width: 400px;
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
}

.nw-auth-gate__card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.nw-auth-gate__lead {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.nw-auth-gate__field {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nw-auth-gate__field span {
  display: block;
  margin-bottom: 0.35rem;
}

.nw-auth-gate__field input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 1rem;
}

.nw-auth-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.nw-auth-gate__actions .btn-primary {
  margin-top: 0.35rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

.nw-auth-gate__actions .btn-primary:hover {
  background: var(--accent-hover);
}

.nw-auth-gate__actions .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.nw-auth-gate__actions .btn-ghost {
  padding: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nw-auth-gate__actions .btn-ghost:hover {
  color: var(--accent);
}

.nw-auth-gate__err {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: var(--danger);
}

.nw-auth-gate__debug {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nw-auth-gate__debug-summary {
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
}

.nw-auth-gate__debug-summary:hover {
  color: var(--accent);
}

.nw-auth-gate__debug-pre {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.55rem;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}

.nw-auth-gate__debug-hint {
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.nw-auth-gate__debug-hint code {
  font-size: 0.68rem;
  padding: 0.05rem 0.2rem;
  border-radius: 3px;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.topbar__session {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 420px;
  justify-content: flex-end;
}

.topbar__einordnung {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--kpi-bg-1);
  color: var(--accent);
  border: 1px solid var(--kpi-border);
  white-space: nowrap;
}

html[data-theme="dark"] .topbar__einordnung {
  background: var(--kpi-bg-1);
  color: var(--accent);
}

.topbar__logout {
  padding: 0.15rem 0.4rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.topbar__logout:hover {
  color: var(--accent);
  border-color: var(--accent);
}
