/* ============================================================
   SAUER ACADEMY – Design System v2
   Modern, fluid, clean
   ============================================================ */

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video, iframe, svg { display: block; max-width: 100%; }
/* Das hidden-Attribut muss jede display-Regel schlagen (z.B. .kurs-karte: flex),
   sonst greifen JS-Filter wie die Kurssuche optisch nicht. */
[hidden] { display: none !important; }

/* ===== Tokens ===== */
:root {
  /* Brand */
  --teal:        #3D8C93;
  --teal-dk:     #2B6B70;
  --teal-lt:     #EAF4F5;
  --teal-mid:    #5AACB2;
  --amber:       #D4952C;
  --amber-dk:    #B07820;
  --amber-lt:    #FEF4E4;
  --green:       #3D8760;
  --green-lt:    #EAF5EF;

  /* Neutrals */
  --bg:          #F0EDE6;
  --surface:     #FFFFFF;
  --surface-2:   #F8F6F2;
  --border:      #E2DDD5;
  --border-lt:   #EDE9E3;
  --text:        #1A2728;
  --text-2:      #3C4A4B;
  --muted:       #6B7778;
  --muted-lt:    #9BA6A7;

  /* Legacy aliases */
  --blue:        var(--teal);
  --blue-dk:     var(--teal-dk);
  --yellow:      var(--amber);
  --gray-50:     #F8F6F2;
  --gray-100:    #F0EDE6;
  --gray-200:    #E2DDD5;
  --gray-400:    #9BA6A7;
  --gray-700:    #4B5A5B;
  --gray-900:    #1A2728;

  /* Shape */
  --radius-xs:   .375rem;
  --radius-sm:   .625rem;
  --radius:      .875rem;
  --radius-lg:   1.25rem;
  --radius-xl:   1.75rem;

  /* Elevation */
  --shadow-xs:   0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:   0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow:      0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:   0 8px 40px rgba(0,0,0,.11), 0 2px 8px rgba(0,0,0,.05);
  --shadow-teal: 0 4px 20px rgba(61,140,147,.25);

  /* Layout */
  --header-h:    64px;
  --page-px:     clamp(1rem, 4vw, 3rem);
  --page-py:     clamp(2rem, 4vw, 3.5rem);
}

/* ===== Background orb drift ===== */
@keyframes orb-drift {
  0%   { transform: translate(0px,   0px)   scale(1); }
  33%  { transform: translate(40px, -30px)  scale(1.06); }
  66%  { transform: translate(-25px, 20px)  scale(.96); }
  100% { transform: translate(0px,   0px)   scale(1); }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

/* ===== Base ===== */
html { scroll-behavior: smooth; }

body::before {
  content: '';
  position: fixed;
  width: 900px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(61,140,147,.11) 0%, transparent 70%);
  top: 10%;
  left: 5%;
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 28s ease-in-out infinite;
}
body::after {
  content: '';
  position: fixed;
  width: 700px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(91,115,234,.09) 0%, transparent 70%);
  bottom: 5%;
  right: 5%;
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 35s ease-in-out infinite reverse;
}

body {
  font-family: 'Inter', 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"),
    radial-gradient(circle, rgba(100,90,80,.058) 1px, transparent 1px),
    radial-gradient(ellipse 75%  65% at 42% 52%,   rgba(61,140,147,.09) 0%, transparent 60%),
    radial-gradient(ellipse 100% 70% at 5%  0%,    rgba(61,140,147,.22) 0%, transparent 55%),
    radial-gradient(ellipse 70%  60% at 95% 5%,    rgba(91,115,234,.18) 0%, transparent 50%),
    radial-gradient(ellipse 55%  50% at 50% 100%,  rgba(212,149,44,.14) 0%, transparent 45%),
    radial-gradient(ellipse 45%  40% at 80% 55%,   rgba(61,135,96,.10)  0%, transparent 40%);
  background-size: 200px 200px, 28px 28px, auto, auto, auto, auto, auto;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--teal); text-decoration: none; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--teal-dk); }

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(22, 34, 35, 0.97);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.07);
  will-change: transform;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
/* Auto-Hide beim Runterscrollen, Einblenden beim Hochscrollen */
.site-header.header-hidden { transform: translateY(-100%); }

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--page-px);
  gap: 1.5rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; opacity: .9; }
.logo-mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-dk) 100%);
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(61,140,147,.5);
}
.logo-mark svg { color: #fff; }
.logo-text {
  line-height: 1.2;
}
.logo-text-main {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}
.logo-text-sub {
  display: block;
  font-size: .62rem;
  font-weight: 500;
  color: rgba(255,255,255,.38);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Nav separator */
.header-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
}

/* Nav links */
.header-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
}
.header-nav a {
  padding: .4rem .85rem;
  border-radius: .5rem;
  font-size: .84rem;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: color .15s, background .15s;
  text-decoration: none;
}
.header-nav a:hover {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.08);
}
.header-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-profile-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 2rem;
  padding: .3rem .75rem .3rem .3rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  color: inherit;
}
.nav-profile-btn:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.22);
}
.nav-user-name {
  font-size: .82rem;
  color: rgba(255,255,255,.9);
  font-weight: 500;
}
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-dk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.15);
  overflow: hidden;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* Auth Modal */
.auth-modal-overlay { z-index: 1500; align-items: center; }
.auth-modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}
.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border-lt);
  background: var(--surface);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.auth-modal-close:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.1); }

.auth-modal-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.5rem 1.75rem .75rem;
}

.auth-modal-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border-lt);
  padding: 0 1.75rem;
  gap: .25rem;
}
.auth-modal-tab {
  padding: .65rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.auth-modal-tab:hover { color: var(--text); }
.auth-modal-tab.active { color: var(--teal); border-bottom-color: var(--teal); }

.auth-modal-body { padding: 1.5rem 1.75rem 1.75rem; }
.auth-modal-header { margin-bottom: 1.5rem; }
.auth-modal-header h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.025em; margin: 0 0 .3rem; }
.auth-modal-header p  { font-size: .875rem; color: var(--muted); margin: 0; line-height: 1.55; }

.auth-modal-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-modal-field { display: flex; flex-direction: column; gap: .35rem; }
.auth-modal-field label { font-size: .8rem; font-weight: 600; color: var(--text-2); }

.auth-modal-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem 1.25rem;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(61,140,147,.25);
  margin-top: .25rem;
}
.auth-modal-submit:hover { background: var(--teal-dk); box-shadow: 0 4px 16px rgba(61,140,147,.35); }

.auth-modal-submit-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .72rem 1.25rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.auth-modal-submit-secondary:hover { background: var(--border-lt); border-color: var(--border); }

/* Auth Modal Success State */
.auth-modal-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem 2rem;
  gap: .75rem;
}
.auth-modal-success:not([hidden]) { display: flex; }
.auth-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(61,140,147,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  margin-bottom: .5rem;
}
.auth-modal-success h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin: 0;
}
.auth-modal-success p {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
  max-width: 300px;
}
.auth-success-hint {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  width: 100%;
  text-align: left;
  margin: .25rem 0 .5rem;
}
.auth-success-hint svg { flex-shrink: 0; color: var(--teal); }

/* Nav user dropdown */
.nav-user-wrap { position: relative; }

.nav-chevron {
  color: rgba(255,255,255,.6);
  transition: transform .2s;
  flex-shrink: 0;
}
.nav-user-wrap.dropdown-open .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .6rem);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1.5px solid var(--border-lt);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
}
.nav-user-wrap.dropdown-open .nav-dropdown { display: block; }

.nav-dropdown-header {
  padding: .85rem 1rem .75rem;
}
.nav-dropdown-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.nav-dropdown-email {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-dropdown-divider {
  height: 1px;
  background: var(--border-lt);
  margin: 0;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .65rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background .12s;
}
.nav-dropdown-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-dropdown-item svg { color: var(--muted); flex-shrink: 0; }
.nav-dropdown-logout { color: #c0392b; }
.nav-dropdown-logout svg { color: #c0392b; }
.nav-dropdown-logout:hover { background: #fef2f2; }

/* ===== Mobile Hamburger + Drawer ===== */
.nav-burger {
  display: none;            /* nur < 720px sichtbar (siehe Responsive) */
  margin-left: auto;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 9px;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: .65rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.nav-burger:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.22); }
.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer-backdrop {
  display: none;            /* erst < 720px als Layer aktiv */
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(6,18,20,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.mobile-drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1200;
  height: 100dvh;
  width: min(82vw, 320px);
  background: var(--surface);
  box-shadow: -8px 0 40px rgba(0,0,0,.25);
  border-left: 1px solid var(--border-lt);
  padding: calc(var(--header-h) + .5rem) 1.1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  visibility: hidden;
}
.mobile-drawer.open { transform: none; visibility: visible; }

.mobile-drawer-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .25rem .25rem .75rem;
}
.mobile-drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-dk) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.mobile-drawer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-drawer-user-info { min-width: 0; }
.mobile-drawer-user-name { font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.mobile-drawer-user-email { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mobile-drawer-divider { height: 1px; background: var(--border-lt); margin: .35rem -.2rem; }

.mobile-drawer-nav { display: flex; flex-direction: column; gap: .1rem; }
.mobile-drawer-nav a {
  display: flex;
  align-items: center;
  padding: .85rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .98rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.mobile-drawer-nav a:hover { background: var(--surface-2); color: var(--text); }
.mobile-drawer-nav a.active { background: var(--teal-lt); color: var(--teal-dk); }

.mobile-drawer-actions { display: flex; flex-direction: column; gap: .1rem; }
.mobile-drawer-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .85rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .98rem;
  font-weight: 600;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.mobile-drawer-item svg { color: var(--muted); flex-shrink: 0; }
.mobile-drawer-item:hover { background: var(--surface-2); color: var(--text); }
.mobile-drawer-login {
  justify-content: center;
  background: var(--amber);
  color: #fff;
  margin-top: .25rem;
  box-shadow: 0 2px 8px rgba(212,149,44,.3);
}
.mobile-drawer-login svg { color: #fff; }
.mobile-drawer-login:hover { background: var(--amber-dk); color: #fff; }
.mobile-drawer-logout { color: #c0392b; }
.mobile-drawer-logout svg { color: #c0392b; }
.mobile-drawer-logout:hover { background: #fef2f2; color: #c0392b; }

/* ============================================================
   LAYOUT
   ============================================================ */
main.page {
  flex: 1;
  position: relative;
  z-index: 1;
}
.inner {
  padding: var(--page-py) var(--page-px);
}
/* Legacy container */
.container {
  padding: var(--page-py) var(--page-px);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem 1.4rem;
  border-radius: 99px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, transform .12s, box-shadow .15s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212,149,44,.3);
}
.btn-primary:hover {
  background: var(--amber-dk);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,149,44,.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  text-decoration: none;
  border-color: var(--muted-lt);
  color: var(--text);
}
.btn-block { width: 100%; justify-content: center; }
.btn-sm  { padding: .38rem 1rem; font-size: .8rem; }
.btn-lg  { padding: .75rem 1.75rem; font-size: .95rem; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.fortschritt-wrap { margin: .5rem 0; }
.fortschritt-balken {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.fortschritt-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-dk) 100%);
  border-radius: 99px;
  transition: width .5s ease;
  position: relative;
  overflow: hidden;
}
.fortschritt-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 2s ease-in-out infinite;
}
.fortschritt-label { font-size: .75rem; color: var(--muted); margin-top: .3rem; }

/* ============================================================
   CATALOG HERO
   ============================================================ */
.catalog-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #091e20 0%, #132e31 18%, #183e42 38%, var(--teal-dk) 62%, var(--teal) 85%, var(--teal-mid) 100%);
  color: #fff;
  border-radius: 0 0 2.5rem 2.5rem;
  margin-bottom: 2rem;
  height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.catalog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(90,172,178,.2) 0%, transparent 65%),
    radial-gradient(ellipse 40% 60% at 5% 80%,  rgba(27,70,74,.35)  0%, transparent 60%);
  pointer-events: none;
}

.catalog-hero-inner {
  position: relative;
  z-index: 1;
  padding: 3rem var(--page-px);
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.catalog-hero-text { flex: 1; min-width: 260px; }
.catalog-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: .6rem;
}
.catalog-hero-eyebrow::before {
  content: '';
  display: block;
  width: 16px;
  height: 2px;
  background: rgba(255,255,255,.3);
  border-radius: 1px;
}
.catalog-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.04em;
  margin-bottom: .5rem;
}
.catalog-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #7dd8de, #a8eef2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: .875rem;
  color: rgba(255,255,255,.6);
  line-height: 1.6;
  max-width: 400px;
}
/* Stats inline rechts */
.catalog-hero-stats {
  display: flex;
  gap: 1.25rem;
  flex-shrink: 0;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .75rem 1.25rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 80px;
  text-align: center;
  align-items: center;
}
.hero-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -.02em;
}
.hero-stat-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
}

/* Decorative rings */
.catalog-hero-deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.deco-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
}
.deco-ring-1 { background: radial-gradient(ellipse at center, rgba(90,172,178,.06) 0%, transparent 70%); }
.deco-ring-2 { background: radial-gradient(ellipse at center, rgba(90,172,178,.04) 0%, transparent 70%); }
.deco-ring-1 { width: 640px; height: 640px; right: -180px; top: -220px; }
.deco-ring-2 { width: 400px; height: 400px; right: 60px;   top: -60px; }
.deco-ring-3 { width: 200px; height: 200px; right: 250px;  bottom: -70px; }

/* ============================================================
   CATALOG GRID
   ============================================================ */
.catalog-grid-section {
  padding: 0 var(--page-px) 4rem;
  position: relative;
  z-index: 1;
}

/* ---- Toolbar (Suche + Filter) ---- */
.catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  margin-bottom: 1.75rem;
}

.catalog-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 480px;
}
.catalog-search-icon {
  position: absolute;
  left: .875rem;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}
.catalog-search-input {
  width: 100%;
  padding: .625rem .875rem .625rem 2.5rem;
  border: 1.5px solid rgba(255,255,255,.8);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: .875rem;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.catalog-search-input::placeholder { color: var(--muted-lt); }
.catalog-search-input:focus {
  border-color: var(--teal);
  background: rgba(255,255,255,.92);
  box-shadow: 0 0 0 3px rgba(61,140,147,.15), 0 2px 8px rgba(0,0,0,.06);
}
.catalog-search-clear {
  position: absolute;
  right: .625rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: .25rem;
  border-radius: var(--radius-xs);
  transition: color .15s, background .15s;
}
.catalog-search-clear:hover { color: var(--text); background: var(--surface-2); }

.catalog-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.filter-chip {
  padding: .375rem .875rem;
  border: 1.5px solid rgba(255,255,255,.75);
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(255,255,255,.88);
}
.filter-chip-active {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(61,140,147,.4);
}
.filter-chip-active:hover {
  background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal) 100%);
  border-color: transparent;
  color: #fff;
}

.catalog-grid-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.catalog-grid-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}
.catalog-grid-count {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.7);
  padding: .2rem .65rem;
  border-radius: 999px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Kein-Ergebnis-State */
.catalog-no-results {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.catalog-no-results .empty-state-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.catalog-no-results p { margin-bottom: 1.25rem; font-size: .9rem; }
.catalog-reset-btn {
  padding: .5rem 1.25rem;
  border: 1.5px solid var(--teal);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--teal);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.catalog-reset-btn:hover { background: var(--teal); color: #fff; }

/* Kategorie-Tag auf der Karte */
.kurs-category-tag {
  position: absolute;
  bottom: .6rem;
  left: .6rem;
  background: rgba(22,34,35,.65);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .2rem .55rem;
  border-radius: 999px;
  pointer-events: none;
  text-transform: uppercase;
}

/* ============================================================
   KURS-KARTE
   ============================================================ */
.kurs-karte {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.9);
  animation: fadeInUp .4s ease both;
  transition:
    box-shadow .3s cubic-bezier(.2,.8,.3,1),
    transform .3s cubic-bezier(.2,.8,.3,1),
    border-color .2s,
    background .2s;
}
.kurs-karte:hover {
  background: rgba(255,255,255,.92);
  box-shadow: 0 20px 60px rgba(61,140,147,.18), 0 6px 18px rgba(0,0,0,.09), inset 0 1px 0 rgba(255,255,255,.95);
  transform: translateY(-6px);
  border-color: rgba(61,140,147,.3);
}
.kurs-karte.abgeschlossen { border-color: rgba(61,135,96,.2); }
.kurs-karte.in-bearbeitung { border-color: rgba(212,149,44,.25); }

.kurs-karte-visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.kurs-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #3c8c90;
  display: block;
  transition: transform .5s cubic-bezier(.2,.8,.3,1);
}
.kurs-karte:hover .kurs-thumb { transform: scale(1.04); }

.kurs-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0d3b3f 0%, #1b5e62 40%, #3D8C93 75%, #5AACB2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.9);
  transition: transform .5s cubic-bezier(.2,.8,.3,1);
  position: relative;
}
.kurs-thumb-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 75% 25%, rgba(255,255,255,.18) 0%, transparent 60%),
    radial-gradient(ellipse 45% 45% at 20% 80%, rgba(0,0,0,.22) 0%, transparent 55%);
  pointer-events: none;
}
.kurs-thumb-placeholder svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.35));
}

/* Per-card gradient variants */
.kurs-karte:nth-child(2) .kurs-thumb-placeholder { background: linear-gradient(135deg, #2D1B5F 0%, #5B35A0 50%, #8B5CF6 100%); }
.kurs-karte:nth-child(3) .kurs-thumb-placeholder { background: linear-gradient(135deg, #5C1A0A 0%, #B2380F 55%, #F97316 100%); }
.kurs-karte:nth-child(4) .kurs-thumb-placeholder { background: linear-gradient(135deg, #0C3320 0%, #166534 55%, #22C55E 100%); }
.kurs-karte:nth-child(5) .kurs-thumb-placeholder { background: linear-gradient(135deg, #0F1F4C 0%, #1D4ED8 55%, #60A5FA 100%); }
.kurs-karte:nth-child(6) .kurs-thumb-placeholder { background: linear-gradient(135deg, #5C1036 0%, #9D174D 55%, #EC4899 100%); }
.kurs-karte:nth-child(7) .kurs-thumb-placeholder { background: linear-gradient(135deg, #1C3A0A 0%, #365314 55%, #84CC16 100%); }
.kurs-karte:nth-child(8) .kurs-thumb-placeholder { background: linear-gradient(135deg, #2A1A08 0%, #92400E 55%, #F59E0B 100%); }
.kurs-karte:hover .kurs-thumb-placeholder { transform: scale(1.04); }

.kurs-status-badge {
  position: absolute;
  top: .9rem;
  right: .9rem;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .28rem .72rem;
  border-radius: 99px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.kurs-status-neu            { background: rgba(255,255,255,.92); color: var(--teal-dk); box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.kurs-status-in-bearbeitung { background: linear-gradient(135deg, rgba(212,149,44,.95), rgba(180,120,20,.95)); color: #fff; box-shadow: 0 2px 8px rgba(212,149,44,.35); }
.kurs-status-abgeschlossen  { background: linear-gradient(135deg, rgba(61,135,96,.95),  rgba(40,100,70,.95));  color: #fff; box-shadow: 0 2px 8px rgba(61,135,96,.35); }

.kurs-karte-body {
  padding: 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  flex: 1;
}
.kurs-karte-body h2 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -.015em;
}
.kurs-desc {
  font-size: .845rem;
  color: var(--muted);
  flex: 1;
  line-height: 1.62;
}

.kurs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.kurs-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-lt);
  border-radius: 99px;
  padding: .2rem .68rem;
}
.kurs-meta-chip svg { flex-shrink: 0; }
.kurs-meta-chip-progress {
  color: var(--amber-dk);
  background: var(--amber-lt);
  border-color: rgba(212,149,44,.2);
}
.kurs-meta-chip-done {
  color: var(--green);
  background: var(--green-lt);
  border-color: rgba(61,135,96,.2);
}

.kurs-karte-footer {
  padding-top: .875rem;
  border-top: 1px solid var(--border-lt);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.kurs-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .79rem;
  font-weight: 700;
  color: var(--teal-dk);
  padding: .42rem .95rem;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(61,140,147,.12) 0%, rgba(90,172,178,.18) 100%);
  border: 1px solid rgba(61,140,147,.18);
  transition: background .18s, color .18s, box-shadow .18s, border-color .18s;
  text-decoration: none;
}
.kurs-cta:hover {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  border-color: transparent;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(61,140,147,.35);
}
.kurs-cta svg { transition: transform .2s; }
.kurs-cta:hover svg { transform: translateX(3px); }
.kurs-cta.cta-done { color: var(--green); background: var(--green-lt); }
.kurs-cta.cta-done:hover { background: var(--green); color: #fff; }

.kurs-karte:nth-child(1) { animation-delay:   0ms }
.kurs-karte:nth-child(2) { animation-delay:  60ms }
.kurs-karte:nth-child(3) { animation-delay: 120ms }
.kurs-karte:nth-child(4) { animation-delay: 180ms }
.kurs-karte:nth-child(5) { animation-delay: 240ms }
.kurs-karte:nth-child(6) { animation-delay: 300ms }
.kurs-karte:nth-child(7) { animation-delay: 360ms }
.kurs-karte:nth-child(8) { animation-delay: 420ms }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p    { font-size: 1rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(15,23,24,.98) 0%, rgba(20,31,32,.97) 100%);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 2rem var(--page-px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer p { font-size: .78rem; color: rgba(255,255,255,.38); }
.site-footer p strong { color: rgba(255,255,255,.65); }
.footer-end { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a {
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color .15s ease;
}
.footer-nav a:hover { color: rgba(255,255,255,.9); }
.footer-version {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  letter-spacing: .02em;
  color: rgba(255,255,255,.28);
}

/* ============================================================
   LEGAL – Impressum & Datenschutz
   ============================================================ */
.legal-page {
  max-width: 820px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.5rem, 4vw, 3rem);
}
.legal-page h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.legal-page .legal-updated {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 .75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-lt);
}
.legal-page h2:first-of-type { border-top: none; padding-top: 0; }
.legal-page h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-2);
  margin: 1.25rem 0 .4rem;
}
.legal-page p,
.legal-page li {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text-2);
}
.legal-page p { margin-bottom: .75rem; }
.legal-page ul { margin: 0 0 .9rem 1.25rem; }
.legal-page li { margin-bottom: .3rem; }
.legal-page a { color: var(--teal); text-decoration: underline; }
.legal-page a:hover { color: var(--teal-dk); }
.legal-page strong { color: var(--text); font-weight: 600; }
.legal-page address {
  font-style: normal;
  line-height: 1.7;
  color: var(--text-2);
  font-size: .92rem;
  margin-bottom: .75rem;
}
.legal-todo {
  background: var(--amber-lt);
  border: 1px dashed var(--amber-dk);
  border-radius: var(--radius-xs);
  color: var(--amber-dk);
  font-weight: 600;
  padding: .1rem .4rem;
}

/* ============================================================
   COURSE DETAIL – new design
   ============================================================ */

/* Hero */
.cd-hero {
  background: linear-gradient(140deg, #183e42 0%, var(--teal-dk) 40%, var(--teal) 100%);
  color: #fff;
  border-radius: 0 0 2.5rem 2.5rem;
  margin-bottom: 0;
  overflow: hidden;
  position: relative;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cd-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 90% 20%, rgba(90,172,178,.2) 0%, transparent 65%);
  pointer-events: none;
}
.cd-hero-inner {
  position: relative;
  z-index: 1;
  padding: 3rem var(--page-px);
  max-width: 900px;
  margin: 0 auto;
}
.cd-back-wrap {
  padding: 1.25rem var(--page-px) 0;
}
.cd-back {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s;
  text-decoration: none;
}
.cd-back:hover { color: var(--teal); text-decoration: none; }
.cd-hero-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cd-hero-text { flex: 1; min-width: 260px; }
.cd-eyebrow {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: .5rem;
}
.cd-hero-text h1 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin-bottom: .5rem;
}
.cd-desc {
  font-size: .875rem;
  color: rgba(255,255,255,.65);
  line-height: 1.6;
  max-width: 480px;
}
.cd-progress {
  margin-top: 1.25rem;
  max-width: 360px;
}
.cd-progress-bar {
  height: 5px;
  background: rgba(255,255,255,.15);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: .35rem;
}
.cd-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,.7) 0%, #fff 100%);
  border-radius: 99px;
  transition: width .5s ease;
}
.cd-progress-label {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  font-weight: 600;
}
.cd-hero-meta {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: flex-end;
  flex-shrink: 0;
}
.cd-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 99px;
  padding: .4rem 1rem;
  backdrop-filter: blur(6px);
}
.cd-meta-chip strong { color: #fff; }
.cd-meta-chip-done   { color: #7dd8de; border-color: rgba(125,216,222,.25); background: rgba(125,216,222,.1); }
.cd-meta-chip-active { color: #f5c97a; border-color: rgba(245,201,122,.25); background: rgba(245,201,122,.1); }
.cd-meta-chip-new    { color: rgba(255,255,255,.55); }

/* Lessons Section */
.cd-lessons-section {
  padding: 1.25rem var(--page-px) 4rem;
}
.cd-lessons-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.cd-lessons-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 1.5rem;
}
.cd-lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Lesson Card */
.cd-lesson-card {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.9);
  animation: fadeInUp .4s ease both;
  transition:
    box-shadow .3s cubic-bezier(.2,.8,.3,1),
    transform .3s cubic-bezier(.2,.8,.3,1),
    border-color .2s,
    background .2s;
}
.cd-lesson-card:hover {
  background: rgba(255,255,255,.92);
  box-shadow: 0 20px 60px rgba(61,140,147,.18), 0 6px 18px rgba(0,0,0,.09), inset 0 1px 0 rgba(255,255,255,.95);
  transform: translateY(-6px);
  border-color: rgba(61,140,147,.3);
}
.cd-lesson-card.done   { border-color: rgba(61,135,96,.25); }
.cd-lesson-card.active { border-color: rgba(212,149,44,.3); }
.cd-lesson-card.locked { opacity: .75; }
.cd-lesson-card:nth-child(1) { animation-delay:   0ms }
.cd-lesson-card:nth-child(2) { animation-delay:  60ms }
.cd-lesson-card:nth-child(3) { animation-delay: 120ms }
.cd-lesson-card:nth-child(4) { animation-delay: 180ms }
.cd-lesson-card:nth-child(5) { animation-delay: 240ms }
.cd-lesson-card:nth-child(6) { animation-delay: 300ms }
.cd-lesson-card:nth-child(7) { animation-delay: 360ms }
.cd-lesson-card:nth-child(8) { animation-delay: 420ms }

/* Visual Header */
.cd-lesson-visual {
  position: relative;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgba(255,255,255,.9);
  transition: transform .5s cubic-bezier(.2,.8,.3,1);
}
.cd-lesson-card:hover .cd-lesson-visual { transform: scale(1.04); }
.cd-lesson-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 75% 25%, rgba(255,255,255,.18) 0%, transparent 60%),
    radial-gradient(ellipse 45% 45% at 20% 80%, rgba(0,0,0,.22) 0%, transparent 55%);
  pointer-events: none;
}
.cd-lesson-visual-slides { background: linear-gradient(135deg, #4a2800 0%, #8c4d00 45%, #d4952c 75%, #f0b84a 100%); }
.cd-lesson-visual-video  { background: linear-gradient(135deg, #0d3b3f 0%, #1b5e62 40%, #3D8C93 75%, #5AACB2 100%); }
.cd-lesson-visual-quiz   { background: linear-gradient(135deg, #2D1B5F 0%, #5B35A0 50%, #8B5CF6 100%); }

.cd-lesson-num-bg {
  position: absolute;
  bottom: -.1em;
  right: .15em;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255,255,255,.08);
  letter-spacing: -.05em;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* Type badge — positioned inside visual */
.cd-lesson-type-badge {
  position: absolute;
  top: .9rem;
  left: .9rem;
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: .28rem .72rem;
  border-radius: 99px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  z-index: 2;
}
.cd-lesson-type-slides { color: var(--amber-dk); }
.cd-lesson-type-video  { color: var(--teal-dk); }
.cd-lesson-type-quiz   { color: #5B35A0; }

.cd-lesson-done-icon {
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(61,135,96,.95), rgba(40,100,70,.95));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(61,135,96,.35);
  z-index: 2;
}
.cd-lesson-lock-icon {
  position: absolute;
  top: .9rem;
  right: .9rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,.4);
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Card Body */
.cd-lesson-body {
  padding: 1.5rem 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.cd-lesson-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -.015em;
  flex: 1;
}
.cd-lesson-card.locked .cd-lesson-title { color: var(--muted); }
.cd-lesson-score {
  font-size: .7rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-lt);
  border-radius: 99px;
  padding: .2rem .65rem;
  width: fit-content;
  border: 1px solid rgba(61,135,96,.2);
}

/* Card Footer */
.cd-lesson-footer {
  padding: .875rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border-lt);
  margin-top: auto;
}
.cd-lesson-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .79rem;
  font-weight: 700;
  color: var(--teal-dk);
  padding: .42rem .95rem;
  border-radius: 99px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(61,140,147,.12) 0%, rgba(90,172,178,.18) 100%);
  border: 1px solid rgba(61,140,147,.18);
  transition: background .18s, color .18s, box-shadow .18s, border-color .18s;
}
.cd-lesson-btn:hover {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  border-color: transparent;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(61,140,147,.35);
}
.cd-lesson-btn svg { transition: transform .2s; }
.cd-lesson-btn:hover svg { transform: translateX(3px); }
.cd-lesson-btn-done  { color: var(--green); background: linear-gradient(135deg, rgba(61,135,96,.12) 0%, rgba(40,100,70,.18) 100%); border-color: rgba(61,135,96,.2); }
.cd-lesson-btn-done:hover { background: linear-gradient(135deg, var(--green) 0%, #2d7a55 100%); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(61,135,96,.35); }
.cd-lesson-btn-login { color: var(--muted); background: transparent; border: 1px solid var(--border-lt); }
.cd-lesson-btn-login:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.cd-lesson-btn-locked { color: var(--muted); background: transparent; border: 1px solid var(--border-lt); cursor: not-allowed; opacity: .6; }
.cd-lesson-btn-locked:hover { background: transparent; color: var(--muted); box-shadow: none; border-color: var(--border-lt); }

/* Legacy - keep for lesson pages */
.breadcrumb {
  font-size: .8rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-bottom: .75rem;
  transition: color .15s;
}
.breadcrumb:hover { color: var(--teal); text-decoration: none; }
.lesson-type-badge {
  font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  padding: .2rem .6rem; border-radius: 99px; background: var(--surface-2); color: var(--muted);
}
.lesson-type-badge.video  { background: var(--teal-lt);  color: var(--teal-dk); }
.lesson-type-badge.slides { background: var(--amber-lt); color: var(--amber-dk); }
.lesson-type-badge.quiz   { background: #f5ede8;         color: #7c4a25; }
.status-icon { font-size: 1rem; color: var(--green); }
.status-icon.versucht { color: var(--amber); }
.score-badge {
  font-size: .75rem; padding: .15rem .6rem; background: var(--surface-2);
  border-radius: 99px; color: var(--muted); font-weight: 600; border: 1px solid var(--border-lt);
}

/* ============================================================
   AUTH
   ============================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1.5px solid var(--border-lt);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0,0,0,.10), 0 1.5px 6px rgba(0,0,0,.06);
  padding: 2.25rem 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.auth-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.auth-brand-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.auth-card-header { display: flex; flex-direction: column; gap: .3rem; }
.auth-card-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin: 0;
}
.auth-card-header p {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.auth-alert {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
}
.auth-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.auth-alert svg { flex-shrink: 0; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-field { display: flex; flex-direction: column; gap: .35rem; }
.auth-field label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .01em;
}
.auth-input-wrap { position: relative; }
.auth-input-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.auth-input-wrap input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .92rem;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input-wrap input:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(61,140,147,.12);
}
.auth-input-wrap input::placeholder { color: var(--muted); opacity: .7; }

.auth-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .8rem 1.25rem;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(61,140,147,.25);
  margin-top: .25rem;
  text-decoration: none;
}
.auth-btn-primary:hover {
  background: var(--teal-dk);
  box-shadow: 0 4px 16px rgba(61,140,147,.35);
  text-decoration: none;
  color: #fff;
}
.auth-btn-primary:active { transform: translateY(1px); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-lt);
}

.auth-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .75rem 1.25rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.auth-btn-secondary:hover {
  background: var(--border-lt);
  border-color: var(--border);
  text-decoration: none;
  color: var(--text);
}

.auth-hint {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: .7rem .9rem;
}
.auth-hint svg { flex-shrink: 0; color: var(--teal); }

.auth-check-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(61,140,147,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
}

/* Legacy compat */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .875rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.check-email-icon { font-size: 3rem; margin-bottom: 1rem; }
.hint { font-size: .83rem; color: var(--muted); }

@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.5rem 1.5rem; }
}

/* ============================================================
   VIDEO – Fullbleed Layout
   ============================================================ */
.video-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #050c0d;
}
.video-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
}
.video-frame-wrap {
  width: 100%;
  max-width: 960px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 4px 20px rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.06);
}
.lesson-video { width: 100%; max-height: 70vh; display: block; }

/* ============================================================
   SLIDES – Fullbleed Layout
   ============================================================ */
.inner-fullbleed { padding: 0; }

.slides-shell {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--header-h));
}

/* Slim lesson bar */
.slides-lesson-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 var(--page-px);
  height: 48px;
  flex-shrink: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.6);
}
.slides-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.slides-back:hover { color: var(--teal); }
.slides-lesson-title {
  flex: 1;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slides-step-badge {
  display: flex;
  align-items: center;
  gap: .2rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 999px;
  padding: .2rem .65rem;
}
.slides-step-sep { opacity: .4; }

/* Stage – iframe fills the rest */
.slides-stage {
  flex: 1;
  min-height: 0;
  padding: 1rem var(--page-px) 1.25rem;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.slides-frame-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;
}
.slides-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Floating completion button */
.slides-next-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: .875rem 1.25rem;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(61,140,147,.45), 0 2px 8px rgba(0,0,0,.15);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.2,.8,.3,1), box-shadow .2s;
  max-width: 300px;
}
.slides-next-float:hover {
  box-shadow: 0 12px 40px rgba(61,140,147,.55), 0 4px 12px rgba(0,0,0,.18);
  text-decoration: none;
}
.slides-next-float.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.slides-next-float-done {
  background: linear-gradient(135deg, var(--green) 0%, #2d7a55 100%);
  box-shadow: 0 8px 32px rgba(61,135,96,.45), 0 2px 8px rgba(0,0,0,.15);
}
.slides-next-float-done:hover { box-shadow: 0 12px 40px rgba(61,135,96,.55), 0 4px 12px rgba(0,0,0,.18); }
.slides-next-float-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: .35rem;
}
.slides-next-float-action {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 700;
}

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-wrap { max-width: 680px; }
.quiz-question { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; line-height: 1.45; letter-spacing: -.01em; }

.quiz-options { display: flex; flex-direction: column; gap: .6rem; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.quiz-option:hover   { border-color: var(--teal); background: var(--teal-lt); }
.quiz-option.selected { border-color: var(--teal); background: var(--teal-lt); }
.quiz-option.correct  { border-color: var(--green); background: var(--green-lt); }
.quiz-option.wrong    { border-color: #e57373; background: #fef2f2; }
.quiz-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.quiz-option.selected .quiz-radio,
.quiz-option.correct  .quiz-radio { border-color: var(--teal); background: var(--teal); }
.quiz-label { font-size: .9rem; font-weight: 500; }

/* ============================================================
   QUIZ WIZARD (Wissenscheck – eine Frage pro Schritt)
   ============================================================ */
.qz-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

/* Fortschrittsbalken */
.qz-progress-track {
  height: 3px;
  background: rgba(0,0,0,.06);
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}
.qz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, #5AACB2 100%);
  width: 0%;
  transition: width .45s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 10px rgba(61,140,147,.5), 0 0 3px rgba(90,172,178,.8);
  border-radius: 0 99px 99px 0;
}

/* Header */
.qz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.5rem;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.6);
  flex-shrink: 0;
  gap: 1rem;
}
.qz-logo {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.qz-header-title {
  flex: 1;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qz-counter {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Stage */
.qz-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

/* Slides */
.qz-slide {
  display: none;
  max-width: 680px;
  width: 100%;
  animation: qzFadeIn .25s ease;
}
.qz-slide-on { display: block; }
@keyframes qzFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.qz-q-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -.015em;
  margin-bottom: 1.75rem;
}

/* Antwort-Optionen */
.qz-opts {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.qz-opt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.qz-opt:hover {
  border-color: rgba(61,140,147,.4);
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 16px rgba(61,140,147,.15), inset 0 1px 0 rgba(255,255,255,.9);
  transform: translateY(-1px);
}
.qz-opt-on {
  border-color: rgba(61,140,147,.55);
  background: linear-gradient(135deg, rgba(61,140,147,.08) 0%, rgba(90,172,178,.14) 100%);
  box-shadow: 0 4px 16px rgba(61,140,147,.18), inset 0 1px 0 rgba(255,255,255,.7);
}
.qz-opt-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
  transition: border-color .18s, background .18s, color .18s, box-shadow .18s;
}
.qz-opt:hover .qz-opt-letter,
.qz-opt-on .qz-opt-letter {
  border-color: transparent;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(61,140,147,.35);
}
.qz-opt-text {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
}
.qz-r { display: none; }

/* State-Cards (Cooldown / Nicht bestanden / Abgeschlossen) */
.qz-state-card {
  max-width: 440px;
  width: 100%;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.9);
  animation: fadeInUp .35s ease both;
}
.qz-state-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 1rem 0 .6rem;
  color: var(--text);
  letter-spacing: -.025em;
}
.qz-state-card p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
}
.qz-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.qz-icon-warn { background: linear-gradient(135deg, rgba(234,179,8,.15), rgba(202,138,4,.22)); color: var(--amber); box-shadow: 0 4px 12px rgba(234,179,8,.2); }
.qz-icon-fail { background: linear-gradient(135deg, rgba(239,68,68,.12), rgba(220,38,38,.18)); color: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,.2); }
.qz-icon-done { background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(22,163,74,.22)); color: #16a34a; box-shadow: 0 4px 12px rgba(34,197,94,.25); animation: pulseGlow 2s ease-in-out infinite; }
.qz-state-fail { border-color: rgba(239,68,68,.2); }
.qz-state-done { border-color: rgba(34,197,94,.25); }
.qz-done-btn {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  margin-top: 1.25rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  box-shadow: 0 4px 12px rgba(61,140,147,.35);
  transition: box-shadow .18s, transform .18s;
}
.qz-done-btn:hover { box-shadow: 0 6px 18px rgba(61,140,147,.45); transform: translateY(-1px); }
.qz-score-display {
  font-size: 2.8rem;
  font-weight: 900;
  color: #dc2626;
  letter-spacing: -.04em;
  margin: .5rem 0 0;
  line-height: 1;
}
.qz-score-display span { font-size: 1.4rem; }
.qz-score-pass { color: #16a34a; }
.qz-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.5rem;
  padding: .75rem 1.75rem;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(61,140,147,.35);
  transition: box-shadow .18s, transform .18s, color .15s;
}
.qz-retry-btn:hover { box-shadow: 0 6px 18px rgba(61,140,147,.45); transform: translateY(-1px); color: #fff; text-decoration: none; }

/* Footer Navigation */
.qz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid rgba(255,255,255,.6);
  flex-shrink: 0;
  gap: 1rem;
}
.qz-btn-sec {
  padding: .6rem 1.1rem;
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
  visibility: hidden;
}
.qz-btn-sec:hover { border-color: var(--teal); color: var(--teal); }
.qz-btn-pri {
  padding: .6rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dk) 100%);
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(61,140,147,.3);
  transition: box-shadow .18s, transform .18s, opacity .15s;
}
.qz-btn-pri:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }
.qz-btn-pri:not(:disabled):hover { box-shadow: 0 6px 18px rgba(61,140,147,.4); transform: translateY(-1px); }
.qz-btn-submit { background: linear-gradient(135deg, var(--teal-dk) 0%, #0d2e31 100%); }

/* Navigations-Dots */
.qz-dots {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.qz-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-lt);
  transition: background .2s, transform .2s, box-shadow .2s;
  cursor: pointer;
}
.qz-dot-cur   { background: var(--teal); transform: scale(1.35); box-shadow: 0 0 8px rgba(61,140,147,.4); }
.qz-dot-done  { background: var(--teal); opacity: .5; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  :root { --header-h: 56px; }
  .catalog-hero-inner { padding: 2rem var(--page-px); flex-direction: column; gap: 1.25rem; align-items: flex-start; }
  .catalog-hero { border-radius: 0 0 1.5rem 1.5rem; margin-bottom: 1.5rem; }
  /* Stats kompakt: kleine Karten in einer Reihe statt volle Breite gestapelt */
  .catalog-hero-stats { flex-direction: row; width: auto; gap: .5rem; flex-wrap: wrap; }
  .hero-stat { flex: 0 0 auto; min-width: 64px; padding: .4rem .7rem; }
  .hero-stat-val { font-size: 1.05rem; }
  .hero-stat-label { font-size: .52rem; letter-spacing: .06em; }
  .logo-text-sub { display: none; }
  .nav-user-name { display: none; }
  .header-sep { display: none; }
}
@media (max-width: 480px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .auth-box { margin: 1.5rem auto; padding: 1.75rem 1.5rem; }
  .kurs-karte-footer { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   CATALOG BREAKOUT – escapes .inner padding
   ============================================================ */
.catalog-breakout {
  margin-left:  calc(-1 * var(--page-px));
  margin-right: calc(-1 * var(--page-px));
}
/* When a full-bleed hero is the first child, kill the top padding on .inner */
.inner:has(> .catalog-hero:first-child),
.inner:has(> .cd-hero:first-child),
.inner:has(> .dl-hero:first-child) {
  padding-top: 0;
}
/* Hero still needs to start at the very top */
.catalog-hero.catalog-breakout,
.cd-hero.catalog-breakout,
.dl-hero.catalog-breakout {
  margin-top: 0;
}

/* Downloads page hero */
.dl-hero {
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal-dk) 0%, var(--teal) 50%, var(--teal-mid) 100%);
  border-radius: 0 0 2.5rem 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.dl-hero-deco { position: absolute; inset: 0; pointer-events: none; }
.dl-hero-inner {
  padding: 3rem var(--page-px);
  max-width: 900px;
  position: relative;
  z-index: 1;
}
.dl-page-section {
  padding: 0 var(--page-px) 4rem;
}
.dl-empty {
  color: var(--muted);
  font-size: .9rem;
  padding: 2rem 0;
}

/* ============================================================
   DOWNLOADS / WERBEUNTERLAGEN
   ============================================================ */
.dl-section {
  padding: 0 var(--page-px) 4rem;
}
.dl-inner {
  max-width: 100%;
}
.dl-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-lt);
  gap: 1rem;
}
.dl-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: -.01em;
  margin-bottom: .2rem;
}
.dl-sub {
  font-size: .8rem;
  color: var(--muted);
}
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.dl-card {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.9);
  animation: fadeInUp .4s ease both;
  transition:
    box-shadow .3s cubic-bezier(.2,.8,.3,1),
    transform .3s cubic-bezier(.2,.8,.3,1),
    border-color .2s,
    background .2s;
}
.dl-card:hover {
  background: rgba(255,255,255,.92);
  box-shadow: 0 20px 60px rgba(212,149,44,.18), 0 6px 18px rgba(0,0,0,.09), inset 0 1px 0 rgba(255,255,255,.95);
  transform: translateY(-6px);
  border-color: rgba(212,149,44,.3);
}
.dl-card:nth-child(1) { animation-delay:   0ms }
.dl-card:nth-child(2) { animation-delay:  60ms }
.dl-card:nth-child(3) { animation-delay: 120ms }
.dl-card:nth-child(4) { animation-delay: 180ms }
.dl-card:nth-child(5) { animation-delay: 240ms }
.dl-card:nth-child(6) { animation-delay: 300ms }
.dl-card-icon {
  position: relative;
  background: linear-gradient(135deg, #4a2800 0%, #8c4d00 45%, #d4952c 75%, #f0b84a 100%);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.9);
  overflow: hidden;
  transition: transform .5s cubic-bezier(.2,.8,.3,1);
}
.dl-card-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 75% 25%, rgba(255,255,255,.18) 0%, transparent 60%),
    radial-gradient(ellipse 45% 45% at 20% 80%, rgba(0,0,0,.22) 0%, transparent 55%);
  pointer-events: none;
}
.dl-card-icon svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.35));
}
.dl-card:nth-child(2) .dl-card-icon { background: linear-gradient(135deg, #2D1B5F 0%, #5B35A0 50%, #8B5CF6 100%); }
.dl-card:nth-child(3) .dl-card-icon { background: linear-gradient(135deg, #5C1A0A 0%, #B2380F 55%, #F97316 100%); }
.dl-card:nth-child(4) .dl-card-icon { background: linear-gradient(135deg, #0C3320 0%, #166534 55%, #22C55E 100%); }
.dl-card:nth-child(5) .dl-card-icon { background: linear-gradient(135deg, #0F1F4C 0%, #1D4ED8 55%, #60A5FA 100%); }
.dl-card:nth-child(6) .dl-card-icon { background: linear-gradient(135deg, #5C1036 0%, #9D174D 55%, #EC4899 100%); }
.dl-card:hover .dl-card-icon { transform: scale(1.04); }
.dl-badge {
  position: absolute;
  top: .9rem;
  right: .9rem;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: rgba(255,255,255,.92);
  color: var(--amber-dk);
  padding: .28rem .72rem;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  z-index: 2;
}
.dl-card-body {
  padding: 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  flex: 1;
}
.dl-category {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--amber-dk);
}
.dl-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -.015em;
}
.dl-card-desc {
  font-size: .845rem;
  color: var(--muted);
  line-height: 1.62;
  flex: 1;
}
.dl-pages {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface-2);
  border: 1px solid var(--border-lt);
  border-radius: 99px;
  padding: .2rem .68rem;
  width: fit-content;
}
.dl-card-footer {
  padding: .875rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border-lt);
  margin-top: auto;
}
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .79rem;
  font-weight: 700;
  color: var(--amber-dk);
  padding: .42rem .95rem;
  border-radius: 99px;
  text-decoration: none;
  transition: background .18s, color .18s, box-shadow .18s, border-color .18s;
}
.dl-btn svg { transition: transform .2s; }
.dl-btn:hover svg { transform: translateY(2px); }

/* ============================================================
   PDF VIEWER
   ============================================================ */
.pv-back-wrap {
  padding: 1.25rem var(--page-px) 0;
}
.pv-wrap {
  padding: 0 var(--page-px) 4rem;
}
.pv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 0 1.25rem;
  flex-wrap: wrap;
}
.pv-header-left { flex: 1; min-width: 200px; }
.pv-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--text);
  margin: .25rem 0 .4rem;
}
.pv-desc {
  font-size: .85rem;
  color: var(--muted);
}
.pv-header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
  padding-top: 1.4rem;
}
.pv-frame-wrap {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border-lt);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.pv-frame {
  display: block;
  width: 100%;
  height: 78vh;
  min-height: 500px;
  border: none;
}
.pv-fallback {
  display: none;
  padding: 3rem;
  text-align: center;
  color: var(--muted);
  gap: 1rem;
  flex-direction: column;
  align-items: center;
}
/* Show fallback when iframe fails (JS hook) */
.pv-frame.failed + .pv-fallback { display: flex; }

/* Download card footer: two buttons side by side */
.dl-card-footer {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.dl-btn-view {
  flex: 1;
  justify-content: center;
  background: linear-gradient(135deg, rgba(212,149,44,.12) 0%, rgba(240,184,74,.18) 100%);
  border: 1px solid rgba(212,149,44,.18);
}
.dl-btn-view:hover {
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-dk) 100%);
  border-color: transparent;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(212,149,44,.35);
}
.dl-btn-dl {
  flex-shrink: 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-lt);
}
.dl-btn-dl:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* `:has()` fix for pdf-viewer page */
.inner:has(> .pv-back-wrap:first-child) { padding-top: 0; }
.pv-back-wrap.catalog-breakout { margin-top: 0; }

/* ── Profile Modal ────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,18,20,.80);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-overlay.open .modal-dialog { animation: scaleIn .2s cubic-bezier(.34,1.56,.64,1) both; }

.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.08);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(140deg, #091e20 0%, #183e42 40%, var(--teal) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.modal-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 90% at 82% 28%, rgba(90,172,178,.22) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 8%  80%, rgba(0,0,0,.18) 0%, transparent 55%);
  pointer-events: none;
}
.modal-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.modal-header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.modal-header-info { flex: 1; min-width: 0; }
.modal-header-name { font-weight: 700; font-size: 1rem; }
.modal-header-email { font-size: .82rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background .15s, border-color .15s;
}
.modal-close:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.28); color: #fff; }

.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }

.modal-msg {
  padding: .7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
}
.modal-msg.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.modal-msg.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.modal-section h4 { font-size: .88rem; font-weight: 700; margin-bottom: .9rem; color: var(--text); }

/* Profilbild-Upload */
.avatar-edit { display: flex; align-items: center; gap: 1rem; }
.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-dk) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
  border: 2px solid var(--border-lt);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit-actions { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.avatar-edit-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.avatar-hint { font-size: .75rem; color: var(--text-2); margin: 0; }

.modal-divider { height: 1px; background: var(--border-lt); margin: 0 -.1rem; }

.modal-section .form-group { margin-bottom: .85rem; }
.modal-section label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: .3rem; }
.modal-section input[type="email"],
.modal-section input[type="password"] {
  width: 100%;
  padding: .55rem .75rem;
  border: 1.5px solid var(--border-lt);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.modal-section input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(61,140,147,.12);
}

/* =============================================
   KURS-POPUP MODAL
   ============================================= */
.course-modal-dialog {
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
}
.course-modal-hdr {
  flex-shrink: 0;
  flex-direction: row;
  align-items: center;
}
.course-modal-hdr-info { flex: 1; min-width: 0; }
.course-modal-eyebrow {
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: rgba(255,255,255,.5);
  margin-bottom: .25rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.course-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.025em;
  position: relative;
  z-index: 1;
}
.course-modal-body {
  overflow-y: auto;
  padding: 1.75rem;
  flex: 1;
  min-height: 0;
  background: var(--surface-2);
}
.course-modal-prog {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.course-modal-prog .cd-progress-bar { flex: 1; }
.course-modal-desc {
  color: var(--text-2);
  font-size: .925rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.course-modal-section-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: .85rem;
}
.course-modal-lessons { margin-bottom: 1.75rem; }

/* Lesson list (Balken-Style im Modal) */
.lesson-list { display: flex; flex-direction: column; gap: .45rem; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  border-radius: var(--radius);
  border: 1.5px solid rgba(255,255,255,.82);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: background .18s, border-color .18s, box-shadow .18s, transform .18s;
}
.lesson-row:not(.locked):hover {
  background: #fff;
  border-color: rgba(61,140,147,.28);
  box-shadow: 0 4px 16px rgba(61,140,147,.13);
  transform: translateX(3px);
}
.lesson-row.done  { border-color: rgba(61,135,96,.22); background: rgba(61,135,96,.05); }
.lesson-row.active { border-color: rgba(212,149,44,.28); background: rgba(212,149,44,.04); }
.lesson-row.locked { opacity: .5; }

.lesson-row-num {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 1.6rem;
  font-variant-numeric: tabular-nums;
}
.lesson-row-type {
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 99px;
  white-space: nowrap;
}
.cd-lesson-type-slides.lesson-row-type { background: linear-gradient(135deg, rgba(91,115,234,.15), rgba(91,115,234,.08)); color: #5b73ea; border: 1px solid rgba(91,115,234,.18); }
.cd-lesson-type-video.lesson-row-type  { background: linear-gradient(135deg, rgba(234,91,91,.15),  rgba(234,91,91,.08));  color: #e45b5b; border: 1px solid rgba(234,91,91,.18); }
.cd-lesson-type-quiz.lesson-row-type   { background: linear-gradient(135deg, rgba(212,149,44,.18), rgba(212,149,44,.09)); color: #b07b10; border: 1px solid rgba(212,149,44,.22); }

.lesson-row-title { flex: 1; font-size: .9rem; font-weight: 500; color: var(--text); }
.lesson-row.locked .lesson-row-title { color: var(--muted); }

.lesson-row-score { font-size: .78rem; color: var(--muted); white-space: nowrap; }

.lesson-row-status {
  display: flex;
  align-items: center;
  width: 1.1rem;
  color: var(--green);
  flex-shrink: 0;
}
.lesson-row.locked .lesson-row-status { color: var(--muted); }

.lesson-row-btn {
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  background: var(--teal-lt, rgba(61,140,147,.1));
  color: var(--teal);
  transition: background .15s, color .15s;
  text-decoration: none;
}
.lesson-row-btn:hover { background: var(--teal); color: #fff; }
.lesson-row-btn-done { background: rgba(61,135,96,.1); color: var(--green); }
.lesson-row-btn-done:hover { background: var(--green); color: #fff; }
.lesson-row-btn-locked { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.lesson-row-btn-locked:hover { background: var(--surface-2); color: var(--muted); }
.lesson-row-btn-login { background: linear-gradient(135deg, rgba(61,140,147,.1), rgba(90,172,178,.14)); color: var(--teal-dk); border: 1px solid rgba(61,140,147,.2); }

.course-modal-cert {
  border-top: 1px solid var(--border-lt);
  padding-top: 1.5rem;
}

/* Make course cards feel clickable */
.kurs-karte { cursor: pointer; }
.kurs-cta { border: none; cursor: pointer; font-family: inherit; }

/* Lektion-Modal: iframe-basiertes Vollbild-Popup */
.lesson-modal-overlay {
  z-index: 2000;
  background: rgba(0,0,0,1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Höhere Spezifität (.lesson-modal-overlay .lesson-modal-dialog) überschreibt .modal-dialog */
.lesson-modal-overlay .lesson-modal-dialog {
  max-width: min(1100px, calc((100dvh - 4rem) * 297 / 210), calc(100vw - 2rem));
  width: 100%;
  height: auto;
  aspect-ratio: 297 / 210;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: transparent;
}
.lesson-modal-frame {
  width: 100%;
  flex: 1;
  border: none;
  display: block;
}
/* Close-Button: fest oben rechts im Viewport, sichtbar wenn Modal offen */
.lesson-modal-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 2100;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.lesson-modal-close:hover { background: rgba(255,255,255,.32); }
.lesson-modal-overlay.open ~ .lesson-modal-close,
.lesson-modal-close.visible { display: flex; }

/* Bestätigung beim Unterbrechen einer Lektion (über dem Lektions-Viewer) */
.lesson-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(6,18,20,.55);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lesson-confirm-overlay.open { display: flex; }
.lesson-confirm-dialog {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 32px 80px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.18);
  padding: 1.75rem 1.5rem 1.4rem;
  text-align: center;
  animation: scaleIn .2s cubic-bezier(.34,1.56,.64,1) both;
}
.lesson-confirm-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto .9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-dk);
  background: var(--amber-lt);
}
.lesson-confirm-dialog h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .4rem;
}
.lesson-confirm-dialog p {
  font-size: .9rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.lesson-confirm-actions {
  display: flex;
  gap: .6rem;
}
.lesson-confirm-btn {
  flex: 1;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.lesson-confirm-stay {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 4px 12px rgba(61,140,147,.3);
}
.lesson-confirm-stay:hover { background: var(--teal-dk); }
.lesson-confirm-leave {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
}
.lesson-confirm-leave:hover { background: var(--surface-2); border-color: var(--muted-lt); }

/* Lektion-Buttons als Button-Elemente */
.cd-lesson-btn { cursor: pointer; font-family: inherit; }

/* =============================================
   FLASH-MELDUNGEN
   ============================================= */
.flash {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.flash svg { flex-shrink: 0; }
.flash-success { background: rgba(34,197,94,.1); color: #16a34a; border: 1px solid rgba(34,197,94,.25); }
.flash-warn    { background: rgba(234,179,8,.1);  color: #ca8a04; border: 1px solid rgba(234,179,8,.25); }
.flash-error   { background: rgba(239,68,68,.1);  color: #dc2626; border: 1px solid rgba(239,68,68,.25); }

/* =============================================
   VIDEO WATCH-TIME
   ============================================= */
.video-progress-hint {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 99px;
  padding: .45rem 1rem;
  max-width: 960px;
  width: fit-content;
}
.btn-primary.btn-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: auto;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-4px); }
  40%,80%  { transform: translateX(4px); }
}
.shake { animation: shake .4s ease; }

/* ===== Focus visible ===== */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  body::before, body::after { animation: none !important; }
}

/* =============================================
   QUIZ COOLDOWN
   ============================================= */
.quiz-result {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}
.quiz-result-fail { background: rgba(239,68,68,.08); color: #dc2626; border: 1px solid rgba(239,68,68,.2); }
.quiz-cooldown-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(234,179,8,.08);
  border: 1px solid rgba(234,179,8,.25);
  border-radius: var(--radius-sm);
  color: #92400e;
  font-size: .9rem;
  line-height: 1.6;
}
.quiz-cooldown-banner svg { flex-shrink: 0; margin-top: 2px; }

/* =============================================
   ZERTIFIKAT-SEKTION (course-detail)
   ============================================= */
.cert-section {
  margin-top: 3rem;
  padding: 0 0 3rem;
}
.cert-inner { max-width: 860px; margin: 0 auto; }

.cert-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.9);
  animation: fadeInUp .4s ease both;
}
.cert-card-issued { border-color: rgba(61,140,147,.25); box-shadow: 0 4px 24px rgba(61,140,147,.1), 0 1px 4px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.9); }
.cert-card-ready  { border-color: rgba(34,197,94,.25);  box-shadow: 0 4px 24px rgba(34,197,94,.1),  0 1px 4px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.9); }
@media (max-width: 640px) {
  .cert-card { flex-direction: column; align-items: flex-start; }
}

.cert-icon {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(61,140,147,.15), rgba(90,172,178,.22));
  color: var(--teal);
  box-shadow: 0 4px 12px rgba(61,140,147,.2);
}
.cert-icon-ready  { background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(22,163,74,.22)); color: #16a34a; box-shadow: 0 4px 12px rgba(34,197,94,.2); }
.cert-icon-locked { background: rgba(100,116,139,.08); color: var(--muted); box-shadow: none; }

.cert-info { flex: 1; }
.cert-info h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .35rem; color: var(--text); letter-spacing: -.02em; }
.cert-info p  { font-size: .875rem; color: var(--muted); margin: .15rem 0; }

.cert-actions { display: flex; flex-direction: column; gap: .5rem; }
.cert-download-btn, .cert-issue-btn {
  display: flex; align-items: center; gap: .4rem;
  white-space: nowrap;
}
.cert-verify-btn { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.cert-form { margin: 0; }

/* =============================================
   VERIFY-SEITE (öffentlich)
   ============================================= */
.verify-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.verify-card {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

/* Brand header */
.verify-brand {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.verify-brand-icon {
  width: 36px; height: 36px;
  background: var(--teal);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.verify-brand-name {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
}

/* Status banner */
.verify-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
}
.verify-status-valid   { background: var(--green-lt); }
.verify-status-invalid { background: rgba(239,68,68,.07); }

.verify-status-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.verify-status-valid   .verify-status-icon { background: rgba(61,135,96,.15);  color: var(--green); }
.verify-status-invalid .verify-status-icon { background: rgba(239,68,68,.15);  color: #dc2626; }

.verify-status-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .2rem;
}
.verify-status-valid   .verify-status-title { color: var(--green); }
.verify-status-invalid .verify-status-title { color: #dc2626; }

.verify-status-sub {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Detail rows */
.verify-details {
  padding: .5rem 0;
}
.verify-row {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1.75rem;
  border-bottom: 1px solid var(--border-lt);
  font-size: .875rem;
}
.verify-row:last-child { border-bottom: none; }
.verify-row-code { background: var(--bg); }

.verify-row-icon {
  width: 30px; height: 30px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.verify-row-code .verify-row-icon {
  background: var(--surface);
}

.verify-row-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
.verify-row-label { color: var(--muted); white-space: nowrap; }
.verify-row-value { font-weight: 500; color: var(--text); text-align: right; }
.verify-code { font-family: monospace; font-size: .8rem; letter-spacing: .06em; color: var(--teal); }

/* Footer */
.verify-footer {
  padding: 1.5rem 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.verify-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.5rem;
}

/* Eingabeseite zum Prüfen */
.verify-form-body {
  padding: 1.75rem;
}
.verify-form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .5rem;
}
.verify-form-intro {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1.25rem;
}
.verify-form-error {
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.25);
  color: #dc2626;
  font-size: .85rem;
  padding: .625rem .875rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.verify-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.verify-form-input {
  width: 100%;
  padding: .75rem 1rem;
  font-size: .95rem;
  font-family: monospace;
  letter-spacing: .06em;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.verify-form-input::placeholder { color: var(--muted); opacity: .6; letter-spacing: normal; }
.verify-form-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(61,140,147,.12);
}
.verify-form .verify-cta { justify-content: center; }

/* ============================================================
   ADMIN – Nutzerverwaltung
   ============================================================ */
.nav-admin-link { position: relative; }
.nav-admin-link::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: .4rem;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: middle;
}

/* Kopfbereich */
.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  margin-bottom: 1.75rem;
}
.admin-eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .4rem;
}
.admin-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; color: var(--text); margin: 0; }
.admin-sub { color: var(--muted); font-size: .95rem; margin-top: .5rem; max-width: 46ch; line-height: 1.5; }

.admin-stats { display: flex; gap: .75rem; }
.admin-stat {
  min-width: 86px;
  padding: .85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  text-align: center;
}
.admin-stat-val { display: block; font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.admin-stat-label { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); margin-top: .35rem; text-transform: uppercase; letter-spacing: .04em; }

/* Panel + Toolbar */
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-lt);
}
.admin-search-wrap { position: relative; flex: 1; max-width: 360px; }
.admin-search-icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted-lt); pointer-events: none; }
.admin-search-input {
  width: 100%;
  padding: .6rem .8rem .6rem 2.4rem;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.admin-search-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(61,140,147,.12); background: var(--surface); }
.admin-count { font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }

/* Tabelle */
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .8rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table tbody td { padding: .85rem 1.25rem; border-bottom: 1px solid var(--border-lt); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-2); }

.admin-user-cell { display: flex; align-items: center; gap: .7rem; }
.admin-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--teal-lt);
  color: var(--teal-dk);
  font-weight: 700;
  font-size: .9rem;
  overflow: hidden;
}
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.admin-user-name { font-weight: 600; color: var(--text); }
.admin-user-since { font-size: .73rem; color: var(--muted-lt); }
.admin-email { color: var(--text-2); }

.admin-badge {
  display: inline-block;
  padding: .25rem .65rem;
  font-size: .73rem;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
}
.admin-badge-admin { background: var(--amber-lt); color: var(--amber-dk); }
.admin-badge-user  { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* Klickbare Anzahl bestandener Kurse → öffnet Popup */
.admin-cert-count {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .65rem .35rem .5rem;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-lt);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.admin-cert-count:hover { border-color: var(--green); background: #e0f1e8; }
.admin-cert-count:active { transform: scale(.97); }
.admin-cert-count-num {
  display: grid; place-items: center;
  min-width: 22px; height: 22px;
  padding: 0 .35rem;
  font-size: .82rem;
  font-weight: 800;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
}
.admin-cert-count-label { color: var(--green); }
.admin-cert-count svg { color: var(--green); opacity: .7; }
.admin-login-date { color: var(--text-2); white-space: nowrap; }
.admin-empty { color: var(--muted-lt); }

.admin-no-results { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); }

/* Popup: abgeschlossene Kurse */
.admin-cert-dialog { max-width: 440px; }
.admin-cert-modal-body { padding: 1.25rem; gap: 0; }
.admin-cert-list { display: flex; flex-direction: column; gap: .6rem; }
.admin-cert-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .8rem .9rem;
  background: var(--surface-2);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius);
}
.admin-cert-item-icon {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green-lt);
  color: var(--green);
}
.admin-cert-item-meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.admin-cert-item-titlerow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.admin-cert-item-title { font-weight: 600; font-size: .92rem; color: var(--text); line-height: 1.3; }
.admin-cert-item-date { font-size: .76rem; color: var(--muted); }
.admin-cert-item-date-expired { color: #b91c1c; font-weight: 600; }
.admin-cert-expired-badge {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.admin-cert-item-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  margin-top: .25rem;
}
.admin-cert-item-id {
  font-family: monospace;
  font-size: .72rem;
  letter-spacing: .02em;
  color: var(--muted-lt);
}
.admin-cert-item-dl {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--teal);
}
.admin-cert-item-dl svg { color: var(--teal); }
.admin-cert-item-dl:hover { color: var(--teal-dk); text-decoration: underline; }

@media (max-width: 640px) {
  .admin-head { align-items: flex-start; }
  .admin-stats { width: 100%; }
  .admin-stat { flex: 1; min-width: 0; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
  .admin-search-wrap { max-width: none; }
}

/* ============================================================
   RESPONSIVE — Mobile Overhaul
   Konsolidierte Breakpoints; spätere Position = überschreibt frühere.
   ============================================================ */

/* ---- ≤ 720px: Hamburger statt Desktop-Navigation ---- */
@media (max-width: 720px) {
  .header-nav,
  .header-sep,
  .header-right { display: none; }
  .nav-burger { display: flex; }
  .mobile-drawer-backdrop { display: block; }
  .header-inner { gap: .75rem; }

  /* Lektions-Popup: Vollbild statt A4-Querformat (sonst winziger Streifen). */
  .lesson-modal-overlay .lesson-modal-dialog {
    max-width: 100vw;
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
  }
  /* Schließen: dezenter, klar sichtbarer Kreis oben rechts (auf hell & dunkel) */
  .lesson-modal-close {
    top: 8px;
    right: 8px;
    width: 2.1rem;
    height: 2.1rem;
    background: rgba(20,30,31,.55);
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .lesson-modal-close:hover { background: rgba(20,30,31,.78); border-color: rgba(255,255,255,.5); }
}

/* ---- ≤ 860px: zweispaltige Heroes/Header stapeln ---- */
@media (max-width: 860px) {
  .cd-hero-content { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .cd-hero-meta { align-items: flex-start; }
  .pv-header { flex-direction: column; gap: .75rem; }
  .pv-header-actions { padding-top: 0; width: 100%; }
}

/* ---- ≤ 640px: Phone ---- */
@media (max-width: 640px) {
  /* Heroes: feste Höhe → auto, kompaktere Paddings */
  .catalog-hero, .cd-hero, .dl-hero { height: auto; }
  .catalog-hero-inner, .cd-hero-inner, .dl-hero-inner { padding: 2rem var(--page-px); }
  .catalog-hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .cd-hero-text h1 { font-size: clamp(1.4rem, 6vw, 1.9rem); }
  .cd-back-wrap, .pv-back-wrap { padding-top: 1rem; }

  /* Farbige Visual-Fläche oben halbieren (Kurskarten + Werbematerial) */
  .kurs-karte-visual,
  .dl-card-icon { aspect-ratio: 32 / 9; }

  /* Quiz-Wizard (rechter Abstand lässt Platz für den Popup-Schließen-Button) */
  .qz-header { padding: .6rem 3.2rem .6rem .9rem; }
  .qz-footer { padding: .8rem .9rem; }
  .qz-header-title { display: none; }
  .qz-stage { padding: 1.25rem 1rem; }
  .qz-q-text { font-size: 1.05rem; margin-bottom: 1.25rem; }
  .qz-opt { padding: .8rem .9rem; gap: .75rem; }
  .qz-state-card { padding: 2rem 1.25rem; }

  /* Slides */
  .slides-stage { padding: .75rem var(--page-px) 1rem; }
  .slides-lesson-bar { gap: .5rem; }
  .slides-next-float { bottom: 1rem; right: 1rem; left: 1rem; max-width: none; }

  /* Video */
  .video-stage { padding: 1rem; gap: .75rem; }

  /* PDF-Viewer */
  .pv-frame { height: 70vh; min-height: 360px; }

  /* Kurs-Popup */
  .modal-header, .course-modal-hdr { padding: 1.1rem 1.25rem; }
  .course-modal-body { padding: 1.25rem; }
  .course-modal-title { font-size: 1.1rem; }

  /* Lektions-Kacheln: 2 saubere Zeilen statt gequetscht in eine */
  .course-modal-lessons .lesson-row {
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .55rem;
    padding: .75rem .9rem;
  }
  .course-modal-lessons .lesson-row > * { min-width: 0; }
  .course-modal-lessons .lesson-row-num    { order: 1; }
  .course-modal-lessons .lesson-row-type   { order: 2; }
  .course-modal-lessons .lesson-row-score  { order: 3; }
  .course-modal-lessons .lesson-row-status { order: 4; }
  .course-modal-lessons .lesson-row-btn    { order: 5; margin-left: auto; }
  .course-modal-lessons .lesson-row-title  { order: 6; flex: 1 0 100%; font-size: .9rem; line-height: 1.35; }

  /* Zertifikat-Karte (course-detail) */
  .cert-card { padding: 1.5rem 1.25rem; }
  .cert-actions { width: 100%; }
  .cert-download-btn, .cert-issue-btn, .cert-verify-btn { width: 100%; justify-content: center; }

  /* Admin: Stat-Kacheln kompakter */
  .admin-stats { gap: .5rem; }
  .admin-stat { padding: .55rem .35rem; min-width: 0; }
  .admin-stat-val { font-size: 1.2rem; }
  .admin-stat-label { font-size: .58rem; letter-spacing: .03em; }

  /* Admin: Nutzer-Tabelle → kompakte Karten (kein horizontales Scrollen) */
  .admin-table-wrap { overflow-x: visible; }
  .admin-table, .admin-table tbody { display: block; width: 100%; }
  .admin-table thead { display: none; }
  .admin-table tr.admin-row {
    display: block;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-lt);
    border-radius: var(--radius);
    padding: .7rem .85rem .4rem;
    margin: 0 .9rem .65rem;
    box-shadow: var(--shadow-xs);
  }
  .admin-table tbody tr:hover { background: var(--surface); }
  .admin-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .3rem 0;
    border: none;
    font-size: .82rem;
    color: var(--text-2);
  }
  .admin-table td::before {
    content: attr(data-label);
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted-lt);
    flex-shrink: 0;
  }
  /* Karten-Kopf: Avatar + Name; Status-Badge schwebt oben rechts */
  .admin-table td:first-child {
    padding: 0 4.2rem .6rem 0;
    margin-bottom: .35rem;
    border-bottom: 1px solid var(--border-lt);
  }
  .admin-table td:first-child::before { display: none; }
  .admin-table td[data-label="Status"] {
    position: absolute;
    top: .7rem;
    right: .85rem;
    padding: 0;
  }
  .admin-table td[data-label="Status"]::before { display: none; }
  .admin-table td.admin-email { word-break: break-word; text-align: right; }
  .admin-table td.admin-email::before { align-self: flex-start; }

  /* Footer stapeln */
  .site-footer { flex-direction: column; align-items: flex-start; gap: .75rem; }

  /* Modals näher an den Rand */
  .modal-overlay { padding: .5rem; }
  .modal-body { padding: 1.25rem; }
}

/* ---- ≤ 480px: kleine Phones ---- */
@media (max-width: 480px) {
  .qz-score-display { font-size: 2.2rem; }
  .avatar-edit { flex-direction: column; align-items: flex-start; }
  .auth-modal-brand { padding: 1.25rem 1.25rem .5rem; }
  .auth-modal-tabs { padding: 0 1.25rem; }
  .auth-modal-body { padding: 1.25rem 1.25rem 1.5rem; }
  .footer-nav { flex-wrap: wrap; gap: .75rem 1.25rem; }
}
