/* ============================================================
   Einführungsguide MAV · BR · SBV · JAV – Stylesheet v1.2
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1e3d73;
  --accent:  #3a8c68;
  --mav:   #3a8c68;
  --br:    #1e3d73;
  --sbv:   #4b5a6e;
  --jav:   #2d7055;
  --bg:    #f0f4f8;
  --card:  #ffffff;
  --text:  #1e293b;
  --muted: #6b7a8d;
  --border:#dde3ec;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(30,61,115,.08);
  --nav-h: 56px;
}

[data-theme="dark"] {
  --bg:    #111827;
  --card:  #1f2937;
  --text:  #e5e7eb;
  --muted: #9ca3af;
  --border:#374151;
  --shadow: 0 2px 8px rgba(0,0,0,.4);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background .25s, color .25s;
}

a { color: inherit; text-decoration: underline; }
a:hover { opacity: .75; }

ul { padding-left: 1.3rem; }
li { margin-bottom: .35rem; }

h2 { font-size: 1.75rem; margin-bottom: 1.25rem; }
h3 { font-size: 1.2rem; margin-bottom: .6rem; }
h4 { margin: 1rem 0 .4rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }

/* ---- Header ---- */
header {
  background: var(--bg);
  color: var(--text);
  padding-bottom: 0;
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 2px 10px rgba(30,61,115,.12);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
}

.site-title-link { text-decoration: none; color: inherit; }
.site-title-link:hover { opacity: .85; }

.header-inner h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--primary);
  font-family: Georgia, serif;
}

.subtitle { font-size: 1.1rem; font-weight: 600; margin-top: .3rem; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; }
.tagline  { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

/* ---- Theme Toggle ---- */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: var(--primary);
  border: none;
  color: #fff;
  padding: .35rem .85rem;
  border-radius: 9px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  transition: background .15s;
  white-space: nowrap;
}
.theme-toggle:hover { background: #2a4f8f; }

/* ---- Nav ---- */
nav {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav ul {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
  list-style: none;
  display: flex;
  gap: .2rem;
  flex-wrap: wrap;
  min-height: var(--nav-h);
  align-items: center;
}

nav a {
  display: inline-block;
  padding: .35rem .75rem;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}

nav a:hover,
nav a.active { background: var(--primary); color: #fff; opacity: 1; }

/* ---- Main layout ---- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

section { scroll-margin-top: calc(var(--nav-h) + 16px); }

.intro-text { color: var(--muted); margin-bottom: 1.5rem; max-width: 70ch; }

/* ---- Page Utilities ---- */
.page-utils {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -1.5rem;
}

.print-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: .4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  transition: background .15s, color .15s;
}
.print-btn:hover { background: var(--border); color: var(--text); }

/* ---- Cards (Grundlagen) ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: #fff;
}
.card-header h3 { margin: 0; font-size: 1.25rem; color: #fff; }

.badge {
  font-size: .7rem;
  font-weight: 700;
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 4px;
  padding: .2rem .5rem;
  letter-spacing: .08em;
  flex-shrink: 0;
}

.mav-color { background: var(--mav); }
.br-color  { background: var(--br);  }
.sbv-color { background: var(--sbv); }
.jav-color { background: var(--jav); }

.card-body { padding: 1.25rem 1.5rem 1.5rem; }
.card-body p { margin-bottom: .75rem; }

/* ---- Steps Grid (Sofortmaßnahmen) ---- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.step-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  border-top: 4px solid var(--primary);
  position: relative;
  transition: opacity .25s, border-top-color .25s;
}

.step-number {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2rem;
  font-weight: 800;
  color: #e8eaf6;
  line-height: 1;
  user-select: none;
}
[data-theme="dark"] .step-number { color: #374151; }

.step-card h4 {
  color: var(--primary);
  text-transform: none;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-top: 0;
  margin-bottom: .6rem;
  padding-right: 3rem;
  transition: color .25s, text-decoration .25s;
}

/* ---- Step Checkbox ---- */
.step-check-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .75rem;
  cursor: pointer;
  font-size: .8rem;
  color: var(--muted);
  user-select: none;
}
.step-check-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: #4caf50;
}

.step-card.done { opacity: .6; border-top-color: #4caf50; }
.step-card.done h4 { text-decoration: line-through; color: var(--muted); }

/* ---- Progress Bar ---- */
.progress-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  margin-bottom: .6rem;
  color: var(--muted);
}
.progress-label strong { color: var(--text); }

.progress-bar {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 5px;
  transition: width .4s ease;
  width: 0%;
}

/* ---- FAQ ---- */
.faq-list { display: flex; flex-direction: column; gap: .75rem; }

.faq-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid var(--primary);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }

.faq-answer { padding: 1rem 1.25rem; color: var(--text); }
.faq-answer p { margin-bottom: .6rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---- Links Grid ---- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.link-category {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  border-top: 4px solid var(--accent);
}

.link-category h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: .75rem; }

.link-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.link-list li { margin: 0; display: flex; flex-direction: column; gap: .1rem; }
.link-list a { color: var(--primary); font-weight: 600; word-break: break-word; }
.link-desc { font-size: .8rem; color: var(--muted); }

/* ---- Search ---- */
.search-wrap { max-width: 620px; margin: 0 auto; }

.search-input-wrap { position: relative; }

.search-input {
  width: 100%;
  padding: .9rem 1.25rem .9rem 3rem;
  border: 2px solid var(--border);
  border-radius: 30px;
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58,140,104,.15);
}
.search-input::placeholder { color: var(--muted); }

.search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-results { margin-top: .75rem; display: flex; flex-direction: column; gap: .5rem; }

.search-result-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .85rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  border-left: 3px solid var(--primary);
  transition: transform .1s;
}
.search-result-item:hover { transform: translateX(3px); opacity: 1; }
.search-result-item strong { display: block; font-size: .95rem; margin-bottom: .2rem; color: var(--primary); }
.search-result-item span { font-size: .82rem; color: var(--muted); }
.search-no-result { text-align: center; color: var(--muted); font-size: .9rem; padding: .5rem; }

/* ---- Home Tiles ---- */
.home-intro { text-align: center; }

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .6rem;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
  width: 100%;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(30,61,115,.15); border-color: var(--primary); opacity: 1; }

.tile-icon { font-size: 2.2rem; line-height: 1; }
.tile h2 { font-size: 1.15rem; margin-bottom: 0; color: var(--primary); font-weight: 700; }
.tile p { font-size: .88rem; color: var(--muted); flex: 1; margin: 0; }

.tile-arrow {
  align-self: flex-end;
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 700;
  transition: transform .15s;
}
.tile:hover .tile-arrow { transform: translateX(4px); }

/* ---- Glossar ---- */
.glossar-grid { display: flex; flex-direction: column; gap: .75rem; }

.glossar-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid var(--accent);
}

.glossar-item summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.glossar-item summary::-webkit-details-marker { display: none; }
.glossar-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s;
}
.glossar-item[open] summary::after { transform: rotate(45deg); }
.glossar-item[open] summary { border-bottom: 1px solid var(--border); }

.glossar-body { padding: 1rem 1.25rem; }
.glossar-body p { margin-bottom: .5rem; }
.glossar-body p:last-child { margin-bottom: 0; }

.glossar-tag {
  display: inline-block;
  font-size: .72rem;
  background: rgba(106,27,154,.1);
  color: var(--sbv);
  border-radius: 4px;
  padding: .15rem .5rem;
  margin-bottom: .6rem;
  font-weight: 600;
}
[data-theme="dark"] .glossar-tag { background: rgba(206,147,216,.15); }

/* ---- Vergleich ---- */
.vergleich-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.vergleich-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  min-width: 640px;
}

.vergleich-table th,
.vergleich-table td {
  padding: .85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  vertical-align: top;
}

.vergleich-table thead th {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff;
  white-space: nowrap;
}

.vergleich-table thead th:nth-child(1) { background: #455a64; }
.vergleich-table thead th:nth-child(2) { background: var(--br); }
.vergleich-table thead th:nth-child(3) { background: var(--mav); }
.vergleich-table thead th:nth-child(4) { background: var(--sbv); }
.vergleich-table thead th:nth-child(5) { background: var(--jav); }

.vergleich-table tbody tr:hover { background: rgba(0,0,0,.03); }
[data-theme="dark"] .vergleich-table tbody tr:hover { background: rgba(255,255,255,.04); }

.vergleich-table tbody tr:last-child td { border-bottom: none; }

.vergleich-table td:first-child {
  font-weight: 600;
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}

/* ---- Fristen ---- */
.fristen-grid { display: flex; flex-direction: column; gap: 1.75rem; }

.fristen-category {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.fristen-category-header {
  padding: .85rem 1.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.fristen-list { list-style: none; padding: 0; }

.fristen-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .85rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.fristen-item:last-child { border-bottom: none; }

.fristen-item-text { font-size: .9rem; flex: 1; }
.fristen-item-text small { display: block; color: var(--muted); font-size: .78rem; margin-top: .15rem; }

.frist-badge {
  font-size: .78rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.frist-red    { background: #fde8e8; color: #c62828; }
.frist-orange { background: #fff3e0; color: #e65100; }
.frist-blue   { background: #e3f2fd; color: #1565c0; }
.frist-green  { background: #e8f5e9; color: #2e7d32; }
.frist-purple { background: #f3e5f5; color: #6a1b9a; }

[data-theme="dark"] .frist-red    { background: rgba(198,40,40,.2); color: #ef9a9a; }
[data-theme="dark"] .frist-orange { background: rgba(230,81,0,.2); color: #ffcc80; }
[data-theme="dark"] .frist-blue   { background: rgba(21,101,192,.2); color: #90caf9; }
[data-theme="dark"] .frist-green  { background: rgba(46,125,50,.2); color: #a5d6a7; }
[data-theme="dark"] .frist-purple { background: rgba(106,27,154,.2); color: #ce93d8; }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--br);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .15s;
  z-index: 200;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-2px); }

/* ---- Footer ---- */
footer {
  background: #263238;
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 1.5rem;
  font-size: .85rem;
  line-height: 1.6;
}
footer p + p { margin-top: .4rem; }

.disclaimer { font-size: .78rem; opacity: .6; max-width: 70ch; margin: .5rem auto 0; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  nav ul { gap: 0; flex-wrap: wrap; height: auto; padding: .5rem 1rem; }
  nav a  { font-size: .78rem; padding: .3rem .55rem; }
  .steps-grid, .links-grid { grid-template-columns: 1fr; }
  .tiles-grid { grid-template-columns: 1fr; }
  .deadlines-grid { grid-template-columns: 1fr; }
  .timeline { padding-left: 1.5rem; }
  .lang-term { flex-direction: column; gap: .4rem; }
  .lang-de { min-width: unset; }
  .nav-group-menu { min-width: 150px; }
  .quiz-wrap { padding: 1.25rem; }
  .header-inner h1 { font-size: 1.6rem; }
  .theme-toggle { position: static; margin-top: 1rem; }
  .back-to-top { bottom: 1rem; right: 1rem; }
  .fristen-item { flex-direction: column; gap: .4rem; }
}

/* ---- Nav Dropdown Groups ---- */
.nav-group { position: relative; }

.nav-group-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 9px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  font-family: inherit;
}
.nav-group-btn:hover,
.nav-group-btn.open { background: var(--primary); color: #fff; }

.nav-group-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--primary);
  border-radius: 8px;
  min-width: 170px;
  list-style: none;
  padding: .35rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s, visibility .15s, transform .15s;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.nav-group-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-group-menu li { margin: 0; }
.nav-group-menu a {
  display: block;
  padding: .5rem 1.1rem;
  border-radius: 0;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: .85rem;
}
.nav-group-menu li:last-child a { border-bottom: none; }

/* ---- Nav Search Button ---- */
.nav-search-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: .35rem .75rem;
  border-radius: 9px;
  transition: background .15s, color .15s;
  line-height: 1;
}
.nav-search-btn:hover { background: var(--primary); color: #fff; }

/* ---- Search Overlay ---- */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8rem;
  backdrop-filter: blur(2px);
}
.search-overlay.open { opacity: 1; visibility: visible; }

.search-overlay-inner {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  width: min(92vw, 600px);
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,.3);
}
.search-overlay-input {
  width: 100%;
  padding: .75rem 3rem .75rem 1.1rem;
  border: 2px solid var(--br);
  border-radius: 8px;
  font-size: 1.05rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.search-overlay-input::placeholder { color: var(--muted); }
.search-overlay-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: background .1s;
}
.search-overlay-close:hover { background: var(--border); color: var(--text); }
#search-overlay-results { margin-top: .75rem; display: flex; flex-direction: column; gap: .5rem; }

/* ---- Tile Progress Badge ---- */
.tile-progress {
  display: inline-block;
  background: rgba(30,61,115,.12);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 10px;
  margin-left: .35rem;
  vertical-align: middle;
}
[data-theme="dark"] .tile-progress { background: rgba(144,202,249,.15); }

/* ---- Step Notes ---- */
.step-note {
  width: 100%;
  min-height: 56px;
  margin-top: .75rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color .15s;
}
.step-note:focus { outline: none; border-color: var(--accent); }
.step-note::placeholder { color: var(--muted); }

/* ---- Quiz ---- */
.quiz-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 740px;
  margin: 0 auto;
}
.quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .5rem; }
.quiz-counter { font-size: .85rem; color: var(--muted); }

.quiz-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 1.5rem; }
.quiz-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 3px; transition: width .35s; }

.quiz-question-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.25rem; line-height: 1.55; }

.quiz-options { display: flex; flex-direction: column; gap: .6rem; }
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: .75rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: .95rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary); background: rgba(30,61,115,.05); }
.quiz-option.correct { border-color: #4caf50; background: #e8f5e9; color: #1b5e20; }
.quiz-option.wrong   { border-color: #f44336; background: #fde8e8; color: #b71c1c; }
[data-theme="dark"] .quiz-option.correct { background: rgba(76,175,80,.15); color: #a5d6a7; }
[data-theme="dark"] .quiz-option.wrong   { background: rgba(244,67,54,.15); color: #ef9a9a; }
.quiz-option:disabled { cursor: default; }

.quiz-feedback { margin-top: 1rem; padding: .75rem 1rem; border-radius: 8px; font-size: .9rem; min-height: 1em; }
.quiz-feedback.ok  { background: #ddf0e8; color: #1a5c3a; }
.quiz-feedback.nok { background: #fde8e8; color: #c62828; }
[data-theme="dark"] .quiz-feedback.ok  { background: rgba(46,125,50,.2); color: #a5d6a7; }
[data-theme="dark"] .quiz-feedback.nok { background: rgba(198,40,40,.2); color: #ef9a9a; }

.quiz-next-btn, .quiz-retry-btn {
  margin-top: 1.25rem;
  padding: .65rem 1.75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.quiz-next-btn:hover, .quiz-retry-btn:hover { opacity: .85; }
.quiz-next-btn:disabled { opacity: .4; cursor: default; }

.quiz-score-screen { text-align: center; padding: 2rem 1rem; }
.quiz-score-big { font-size: 3rem; font-weight: 800; color: var(--primary); }
.quiz-score-label { font-size: 1.1rem; color: var(--muted); margin-top: .25rem; }
.quiz-score-msg { margin: 1.25rem 0; font-size: 1rem; }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: .6rem;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
  padding-left: 1.25rem;
}
.timeline-dot {
  position: absolute;
  left: -1.55rem;
  top: .35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--br);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 2px var(--br);
  flex-shrink: 0;
}
.timeline-item.milestone .timeline-dot {
  width: 18px;
  height: 18px;
  left: -1.7rem;
  background: var(--mav);
  box-shadow: 0 0 0 2px var(--mav);
}
.timeline-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--br);
}
.timeline-item.milestone .timeline-card { border-left-color: var(--mav); }
.timeline-week { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--br); margin-bottom: .25rem; }
.timeline-item.milestone .timeline-week { color: var(--mav); }
.timeline-title { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.timeline-desc { font-size: .87rem; color: var(--muted); }
.timeline-desc ul { margin-top: .3rem; }

/* ---- Vorlagen ---- */
.vorlagen-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.vorlage-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.vorlage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.25rem;
  background: rgba(30,61,115,.06);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.vorlage-header h3 { font-size: 1rem; margin: 0; color: var(--primary); }
.copy-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: .35rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.copy-btn:hover { opacity: .85; }
.copy-btn.copied { background: var(--accent); }
.vorlage-desc { padding: .7rem 1.25rem; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.vorlage-text {
  font-family: 'Courier New', monospace;
  font-size: .82rem;
  line-height: 1.7;
  padding: 1.1rem 1.25rem;
  white-space: pre-wrap;
  color: var(--text);
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg);
  margin: 0;
}

/* ---- Fristenrechner ---- */
.fristen-rechner-form {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.form-select, .form-date {
  width: 100%;
  padding: .65rem .9rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.form-select:focus, .form-date:focus { border-color: var(--br); }
.calc-btn {
  background: var(--br);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .7rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.calc-btn:hover { opacity: .85; }

.deadlines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.deadline-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--br);
}
.deadline-card.urgent { border-left-color: #f44336; }
.deadline-card.warning { border-left-color: #ff9800; }
.deadline-card.ok-c { border-left-color: #4caf50; }
.deadline-label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.deadline-date { font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; }
.deadline-desc { font-size: .83rem; color: var(--muted); }

/* ---- Urteile ---- */
.urteile-grid { display: flex; flex-direction: column; gap: 1.1rem; }
.urteil-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid var(--primary);
}
.urteil-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem .6rem;
  flex-wrap: wrap;
}
.urteil-az { font-weight: 700; font-size: .95rem; color: var(--text); }
.urteil-date { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.urteil-topic { display: inline-block; font-size: .72rem; background: rgba(121,134,203,.15); color: #5c6bc0; border-radius: 4px; padding: .15rem .5rem; margin: 0 1.25rem .75rem; font-weight: 700; }
[data-theme="dark"] .urteil-topic { background: rgba(121,134,203,.25); }
.urteil-body { padding: 0 1.25rem 1rem; }
.urteil-leitsatz { font-size: .9rem; font-style: italic; color: var(--muted); margin-bottom: .5rem; border-left: 3px solid #7986cb; padding-left: .75rem; }
.urteil-praxis { font-size: .88rem; }
.urteil-praxis strong { color: var(--text); }

/* ---- Language Tabs ---- */
.lang-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.lang-tab {
  padding: .45rem 1.25rem;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.lang-tab.active { border-color: var(--br); background: var(--br); color: #fff; }
.lang-tab:hover:not(.active) { border-color: var(--br); color: var(--br); }

.lang-panel { display: none; }
.lang-panel.active { display: block; }

.lang-terms { display: flex; flex-direction: column; gap: .75rem; }
.lang-term {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .9rem 1.25rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.lang-de { font-weight: 700; min-width: 180px; color: var(--text); }
.lang-trans { color: var(--muted); font-size: .9rem; flex: 1; }
.lang-trans em { display: block; font-style: italic; font-size: .82rem; margin-top: .2rem; }

/* ---- Module Selection Overlay ---- */
#module-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: linear-gradient(135deg, #1e3d73 0%, #1a3460 55%, #2d7055 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  color: #fff;
  transition: opacity .4s, visibility .4s;
  overflow-y: auto;
}
#module-select-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.mso-logo { font-size: 2.8rem; margin-bottom: .6rem; line-height: 1; }
.mso-title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: .3rem;
}
.mso-subtitle {
  opacity: .78;
  text-align: center;
  margin-bottom: 2rem;
  font-size: .95rem;
  max-width: 44ch;
}
.mso-instruction {
  font-size: .82rem;
  opacity: .65;
  text-align: center;
  margin-bottom: 1.1rem;
}
.mso-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 500px;
  width: 100%;
  margin-bottom: 1.25rem;
}
.mso-card {
  background: rgba(255,255,255,.1);
  border: 2px solid rgba(255,255,255,.22);
  border-radius: 14px;
  padding: 1.4rem 1rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: background .18s, border-color .18s, transform .12s;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.mso-card:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.mso-card.selected-MAV { border-color: #66bb6a; background: rgba(46,125,50,.35); }
.mso-card.selected-BR  { border-color: #64b5f6; background: rgba(21,101,192,.35); }
.mso-card.selected-SBV { border-color: #ce93d8; background: rgba(106,27,154,.35); }
.mso-card.selected-JAV { border-color: #ffb74d; background: rgba(230,81,0,.35); }
.mso-card-check {
  position: absolute;
  top: .55rem;
  right: .7rem;
  font-size: 1rem;
  opacity: 0;
  transition: opacity .15s;
}
.mso-card.selected-MAV .mso-card-check,
.mso-card.selected-BR  .mso-card-check,
.mso-card.selected-SBV .mso-card-check,
.mso-card.selected-JAV .mso-card-check { opacity: 1; }
.mso-icon { font-size: 2.4rem; line-height: 1; margin-bottom: .45rem; }
.mso-abbr { font-size: 1.65rem; font-weight: 800; letter-spacing: .02em; }
.mso-name { font-size: .74rem; opacity: .7; margin-top: .2rem; line-height: 1.3; }

.mso-quick {
  display: flex;
  gap: .65rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.mso-quick-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: .3rem .9rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: .8rem;
  transition: background .15s;
}
.mso-quick-btn:hover { background: rgba(255,255,255,.28); }

.mso-weiter-btn {
  background: #fff;
  color: var(--primary);
  border: none;
  padding: .85rem 3.5rem;
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.mso-weiter-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.mso-weiter-btn:disabled { opacity: .35; cursor: default; }
.mso-hint { font-size: .76rem; opacity: .5; margin-top: .8rem; text-align: center; }

/* ---- Profile Badge (im Header) ---- */
.profile-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .65rem;
}
.profile-tag {
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 12px;
  letter-spacing: .04em;
}
.profile-tag.mav { background: #ddf0e8; border: 1px solid #3a8c68; color: #1a5c3a; }
.profile-tag.br  { background: #dce6f5; border: 1px solid #1e3d73; color: #1e3d73; }
.profile-tag.sbv { background: #ede8f5; border: 1px solid #6b4f9e; color: #6b4f9e; }
.profile-tag.jav { background: #fef3e2; border: 1px solid #c87a20; color: #c87a20; }
.profile-edit-btn {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  font-size: .7rem;
  padding: .22rem .65rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.profile-edit-btn:hover { background: #2a4f8f; color: #fff; }

/* ---- Grundlagen: nicht ausgewählte Module ausblenden ---- */
.card.module-hidden { display: none; }

@media (max-width: 480px) {
  .mso-cards { max-width: 340px; gap: .75rem; }
  .mso-card { padding: 1.1rem .75rem .85rem; }
  .mso-abbr { font-size: 1.35rem; }
  .mso-icon { font-size: 1.9rem; }
  .mso-weiter-btn { padding: .75rem 2.5rem; }
}

/* ---- Print ---- */
@media print {
  header { background: none !important; color: #000 !important; padding: 1rem 0; }
  header h1, header p { color: #000 !important; }
  .theme-toggle, nav, .back-to-top, .print-btn, .page-utils { display: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  main { padding: 0; gap: 1.5rem; }
  .card, .step-card, .faq-item, .link-category, .glossar-item, .fristen-category {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
  .faq-item summary::after, .glossar-item summary::after { display: none; }
  .faq-answer, .glossar-body { display: block !important; }
  .card-header, .fristen-category-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .vergleich-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  footer { background: none !important; color: #666 !important; border-top: 1px solid #ccc; }
  .progress-wrap { display: none; }
}
