/* ============================================
   BGM-Bildung Lernplattform - Styling
   ============================================ */

:root {
  --navy: #1A3C6E;
  --navy-dark: #0F2248;
  --green: #2E7D4F;
  --green-light: #EAF3DE;
  --red: #C0392B;
  --red-light: #FCEBEB;
  --blue-mid: #2A5FA8;
  --blue-light: #E6F1FB;
  --white: #ffffff;
  --off-white: #F4F6FA;
  --gray-light: #F0F2F7;
  --gray-mid: #9CA3B0;
  --gray-dark: #4A5568;
  --text: #1a2133;
  --text-muted: #6B7A99;
  --border: rgba(26,60,110,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── LOGIN PAGE ─── */
.login-page {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  background: var(--white);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 980px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-left {
  background: var(--navy);
  padding: 60px 48px;
  color: white;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-mid) 33%, var(--green) 33% 66%, var(--red) 66%);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}

.logo-blocks {
  display: flex;
  gap: 4px;
}

.lb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
}

.lb-b { background: var(--blue-mid); }
.lb-g { background: var(--green); }
.lb-m { background: var(--red); }

.brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
}

.brand-text p {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.login-headline {
  font-family: 'DM Serif Display', serif;
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.login-subtext {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
}

.login-right {
  padding: 60px 48px;
}

.login-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.login-form { display: none; }
.login-form.active { display: block; }

.login-form h3 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 24px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--navy);
}

.btn-primary {
  width: 100%;
  background: var(--navy);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}

.btn-primary:hover { background: var(--navy-dark); }
.btn-primary:active { transform: scale(0.99); }

.form-info {
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
  min-height: 16px;
}
.form-info.error { color: var(--red); }
.form-info.success { color: var(--green); }

.test-info {
  margin-top: 24px;
  padding: 14px;
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--gray-dark);
  line-height: 1.7;
}

.test-info code {
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10.5px;
  font-family: monospace;
}

/* ─── DASHBOARD ─── */
.dashboard-body {
  background: var(--off-white);
}

.topbar {
  background: var(--navy);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.tb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tb-logo .lb {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.tb-name {
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  margin-left: 4px;
}

.tb-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tb-badge {
  background: rgba(46,125,79,0.25);
  color: #7EC8A0;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  border: 1px solid rgba(126,200,160,0.3);
}

.tb-badge.schueler {
  background: rgba(192,57,43,0.25);
  color: #FF8B7A;
  border-color: rgba(255,139,122,0.3);
}

.tb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
}

.tb-username {
  color: white;
  font-size: 13px;
}

.tb-logout {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.tb-logout:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
}

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}

.side-section { margin-bottom: 24px; }

.side-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--gray-mid);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding: 0 10px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--gray-dark);
  cursor: pointer;
  margin-bottom: 2px;
  text-decoration: none;
  transition: background 0.15s;
}

.side-link:hover { background: var(--blue-light); }
.side-link.active { background: var(--blue-light); color: var(--navy); font-weight: 700; }

.side-count {
  margin-left: auto;
  background: var(--navy);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.main {
  padding: 32px;
}

.welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.welcome h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--navy);
  line-height: 1.2;
}

.welcome p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-new {
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.btn-new:hover { background: #256B42; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.section-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-h h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.section-h a {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.kurs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.kurs-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.kurs-head {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--navy);
}

.kurs-name {
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.kurs-status {
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 700;
}

.kurs-body {
  padding: 16px 18px;
}

.kurs-info {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.kurs-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.kurs-btn {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: 'DM Sans', sans-serif;
}

.btn-live { background: var(--red); color: white; }
.btn-mat { background: var(--blue-light); color: #0C447C; }
.btn-tn { background: var(--green-light); color: #27500A; }

.live-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.term-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-light);
}

.term-item:last-child { border-bottom: none; }

.term-date {
  background: var(--blue-light);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  flex-shrink: 0;
  width: 48px;
}

.term-day {
  font-size: 10px;
  color: #0C447C;
  font-weight: 700;
}

.term-num {
  font-size: 16px;
  color: #0C447C;
  font-weight: 700;
}

.term-info { flex: 1; }

.term-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}

.term-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.term-action {
  background: var(--green);
  color: white;
  font-size: 10px;
  padding: 6px 12px;
  border-radius: 5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}

.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.loader {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 768px) {
  .login-container { grid-template-columns: 1fr; }
  .login-left { padding: 32px 24px; }
  .login-right { padding: 32px 24px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .kurs-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
}
