/**
 * Version: 1.1.0
 * Zweck: Zentrales Frontend Styling fuer Layout, Login, Navigation, Suche, Modale und Importstatus.
 * Änderungen: Projekt Versionsblock ergänzt, veralteten auskommentierten Toggle Block entfernt und doppelte Ladezustandsregel bereinigt.
 */
:root {
  --mw-blau: #0e3867;
  --mw-grau: #90939c;
  --mw-dunkel: #444;
  --mw-bg: #f6f7f9;
  --mw-status-warn: #b58a2b;
  --mw-status-alarm: #b04a56;
}

body {
  background: var(--mw-bg);
  color: #111;
}

.logo {
  max-height: 2.5rem;
}

.mw-nav {
  background: linear-gradient(120deg, var(--mw-blau), #0a2b4f);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
}

.mw-card {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
}

.mw-btn-primary {
  background: var(--mw-blau);
  border-color: var(--mw-blau);
  border-radius: 12px;
  padding: 10px 14px;
}

.mw-btn-primary:hover {
  filter: brightness(1.05);
}

.mw-login-bg {
  min-height: 100vh;
  background:
    radial-gradient(1400px 760px at 12% 8%, rgba(37, 99, 235, 0.22), transparent 58%),
    radial-gradient(1200px 820px at 88% 14%, rgba(14, 56, 103, 0.24), transparent 56%),
    linear-gradient(145deg, #081321 0%, #0a1a2d 38%, #060d18 100%);
  position: relative;
  overflow: hidden;
}

.mw-login-bg::before,
.mw-login-bg::after {
  content: '';
  position: absolute;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(32px);
  opacity: 0.75;
}

.mw-login-bg::before {
  width: 32rem;
  height: 32rem;
  left: -8rem;
  bottom: -10rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.28), rgba(37, 99, 235, 0));
}

.mw-login-bg::after {
  width: 26rem;
  height: 26rem;
  right: -6rem;
  top: -6rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
}

.mw-login-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0.86;
  transform: scale(1.02);
  filter: saturate(0.9) brightness(0.56) contrast(1.05);
}

.mw-login-video-versteckt {
  opacity: 0;
}

.mw-login-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(2, 8, 18, 0.88), rgba(5, 13, 25, 0.78) 38%, rgba(3, 8, 18, 0.92) 100%),
    radial-gradient(1200px 760px at 14% 12%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(900px 640px at 84% 12%, rgba(255, 255, 255, 0.05), transparent 56%);
  backdrop-filter: blur(6px) saturate(1.08);
}

.mw-login-center {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.mw-login-card {
  position: relative;
  width: 100%;
  max-width: 470px;
  padding: 28px;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(11, 22, 39, 0.78), rgba(7, 16, 30, 0.88)),
    rgba(8, 17, 31, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px) saturate(1.08);
  transform: translateY(12px) scale(0.985);
  animation: mwIn 560ms cubic-bezier(.2, .9, .2, 1) forwards;
}

.mw-login-card::before,
.mw-login-card::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.mw-login-card::before {
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 26%),
    radial-gradient(650px 180px at 50% -8%, rgba(255, 255, 255, 0.08), transparent 60%);
}

.mw-login-card::after {
  width: 11rem;
  height: 11rem;
  right: -3.5rem;
  top: -4.25rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0));
  filter: blur(10px);
}

.mw-login-card::before,
.mw-login-card::after {
  z-index: 0;
}

.mw-login-card>* {
  position: relative;
  z-index: 1;
}

@keyframes mwIn {
  to {
    transform: translateY(0) scale(1);
  }
}

.mw-brand {
  font-size: 22px;
  font-weight: 800;
  color: #f7fbff;
  letter-spacing: 0.3px;
}

.mw-sub {
  color: rgba(231, 239, 249, 0.76);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.mw-dot {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  background: #7cb3ff;
  box-shadow:
    0 0 0 8px rgba(124, 179, 255, 0.12),
    0 0 24px rgba(124, 179, 255, 0.38);
}

.mw-login-card .form-label {
  color: rgba(241, 246, 255, 0.88);
  font-size: 0.93rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}
.form-label {font-weight: 600;}
.mw-login-card .form-control {
  min-height: calc(3rem + 2px);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  background: rgba(255, 255, 255, 0.07);
  color: #f6fbff;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mw-login-card .form-control::placeholder {
  color: rgba(228, 238, 249, 0.46);
}

.mw-login-card .form-control:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.16);
}

.mw-login-card .form-control:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(124, 179, 255, 0.55);
  box-shadow:
    0 0 0 .2rem rgba(124, 179, 255, 0.16),
    0 12px 28px rgba(3, 10, 20, 0.22);
}

.mw-login-card .alert {
  background: rgba(176, 74, 86, 0.16);
  color: #ffe4e7;
  border-color: rgba(176, 74, 86, 0.34);
}

.mw-login-card .mw-btn-primary,
.mw-login-card .btn-primary {
  min-height: calc(3rem + 2px);
  transition: filter 140ms ease, transform 140ms ease, box-shadow 140ms ease;
  border: 1px solid rgba(124, 179, 255, 0.32);
  background: linear-gradient(180deg, rgba(42, 120, 255, 0.96), rgba(17, 88, 210, 0.96));
  box-shadow:
    0 16px 34px rgba(13, 73, 176, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mw-login-card .mw-btn-primary:hover,
.mw-login-card .btn-primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.mw-login-card .mw-btn-primary:focus,
.mw-login-card .btn-primary:focus {
  box-shadow:
    0 0 0 .2rem rgba(124, 179, 255, 0.18),
    0 16px 34px rgba(13, 73, 176, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mw-login-foot {
  display: flex;
  justify-content: space-between;
}

#mwNav .badge {
  text-transform: capitalize;
}

/* Navigation aktive Elemente hervorheben */
.mw-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;

  border-radius: 12px;
  padding: 0.55rem 0.85rem 0.55rem 1.15rem;

  transition: background-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.mw-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.10);
}

.mw-nav .nav-link.mw-nav-aktiv,
.mw-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.mw-nav .nav-link.mw-nav-aktiv::before,
.mw-nav .nav-link.active::before {
  height: 70%;
  opacity: 1;
}

.mw-nav .nav-link i {
  opacity: 0.92;
}

.mw-nav .nav-link.mw-nav-aktiv i,
.mw-nav .nav-link.active i {
  opacity: 1;
}

.mw-nav .nav-link:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 0 0.2rem rgba(255, 255, 255, 0.12);
}

.nav-item {
  margin-right: .5rem;
}

.table td.mw-import-alt-warn {
  color: var(--mw-status-warn) !important;
  font-weight: 600;
}

.table td.mw-import-alt-alarm {
  color: var(--mw-status-alarm) !important;
  font-weight: 700;
}

.mw-suche-mark {
  background: #fff3bf;
  color: inherit;
  padding: 0 .15em;
  border-radius: .2rem;
}

.mw-suche-live-status {
  min-height: 1.25rem;
}

.mw-suchmodus {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem;
  border-radius: 999px;
  background: #eef2f7;
  border: 1px solid rgba(14, 56, 103, .10);
}

.mw-suchmodus-eingabe {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mw-suchmodus-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: .55rem .9rem;
  border-radius: 999px;
  margin: 0;
  font-weight: 600;
  color: var(--mw-blau);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.mw-suchmodus-eingabe:checked+.mw-suchmodus-label {
  background: var(--mw-blau);
  color: #fff;
  box-shadow: 0 10px 24px rgba(14, 56, 103, .18);
}

.mw-suchmodus-eingabe:focus-visible+.mw-suchmodus-label {
  box-shadow: 0 0 0 .2rem rgba(14, 56, 103, .18);
}

.mw-toggle-eingabe {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mw-toggle-slider {
  position: relative;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #cfd7e3;
  transition: background-color 140ms ease;
}

.mw-toggle-slider::after {
  content: "";
  position: absolute;
  top: .125rem;
  left: .125rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform 140ms ease;
}

.mw-toggle-text {
  line-height: 1.2;
  font-weight: 500;
  color: var(--bs-body-color);
  white-space: nowrap;
}

.mw-toggle:hover {
  border-color: rgba(14, 56, 103, .22);
}

.mw-toggle-eingabe:checked+.mw-toggle-slider {
  background: var(--mw-blau);
}

.mw-toggle-eingabe:checked+.mw-toggle-slider::after {
  transform: translateX(1.1rem);
}

.mw-toggle-eingabe:focus-visible+.mw-toggle-slider {
  box-shadow: 0 0 0 .2rem rgba(14, 56, 103, .18);
}

.mw-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  height: calc(1.5em + .75rem + 2px);
  min-height: 0;
  padding: .375rem .75rem;
  margin: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
  background: #fff;
  cursor: pointer;
  user-select: none;
}

.mw-toggle-bestand {
  height: auto;
}

.mw-artikel-link {
  color: var(--mw-blau);
  font-weight: 600;
}

.mw-artikel-link:hover,
.mw-artikel-link:focus {
  color: var(--mw-blau);
  text-decoration: underline !important;
}

.mw-artikel-meta {
  font-size: .875rem;
}

.mw-modal-tabelle td,
.mw-modal-tabelle th {
  white-space: nowrap;
}

.modal-custom {
  min-width: calc(100% - 32px) !important;
}

.mw-suchergebnis-wrap {
  min-height: 8rem;
}

.mw-suchergebnis-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(246, 247, 249, 0.72), rgba(246, 247, 249, 0.88));
  backdrop-filter: blur(4px);
}

.mw-suchergebnis-loader {
  position: relative;
  width: min(100%, 28rem);
  overflow: hidden;
  border: 1px solid rgba(14, 56, 103, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(14, 56, 103, 0.12);
  padding: 1.25rem 1.25rem 1rem;
  text-align: center;
}

.mw-suchergebnis-spinner {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto .85rem;
  border-radius: 50%;
  border: 3px solid rgba(14, 56, 103, 0.12);
  border-top-color: var(--mw-blau);
  animation: mw-suchergebnis-drehen .8s linear infinite;
}

.mw-suchergebnis-text {
  font-weight: 700;
  color: var(--mw-blau);
  letter-spacing: .01em;
}

.mw-suchergebnis-shimmer {
  height: .4rem;
  margin-top: 1rem;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      rgba(14, 56, 103, 0.06) 0%,
      rgba(14, 56, 103, 0.14) 18%,
      rgba(14, 56, 103, 0.06) 36%);
  background-size: 220% 100%;
  animation: mw-suchergebnis-shimmer 1.2s linear infinite;
}

.mw-suche-ladezustand {
  opacity: .45;
  pointer-events: none;
  filter: saturate(.85);
  transition: opacity 160ms ease, filter 160ms ease;
}

@keyframes mw-suchergebnis-drehen {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mw-suchergebnis-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -20% 0;
  }
}

@media (max-width: 991.98px),
(prefers-reduced-motion: reduce) {
  .mw-login-video {
    display: none;
  }

  .mw-login-overlay {
    backdrop-filter: blur(10px);
  }

  .mw-login-card {
    padding: 22px;
    transform: none;
    animation: none;
    backdrop-filter: blur(14px) saturate(1.04);
  }

  .mw-suchergebnis-spinner,
  .mw-suchergebnis-shimmer {
    animation: none;
  }
}