/*
 * Kurs-Portal – Oberfläche.
 * Farben und Schriften kommen aus tokens.css. Orientierung an
 * francesfruehauf.com (weißer Kopf, Flieder-Knöpfe) und an den
 * Anwendungsbeispielen von Mindt Studio (Subheadline über Headline,
 * Moos als Textakzent, Mint als ruhige Fläche).
 */

* { box-sizing: border-box; }
html, body { margin: 0; }
img { max-width: 100%; height: auto; }
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .2em; }
a:hover { color: var(--fh-moos); text-decoration-color: currentColor; }

/* ---------- Kopf ---------- */
.kopf {
  background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem clamp(1.25rem, 5vw, 4rem);
  border-bottom: 1px solid var(--fh-mint);
}
.kopf__marke { display: block; line-height: 0; }
.kopf__marke img { height: 44px; width: auto; }
.kopf__nav { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); font-weight: 400; font-size: .95rem; }
.kopf__nav a { text-decoration: none; }
.kopf__nav a[aria-current="page"] { color: var(--fh-moos); text-decoration: underline; text-decoration-thickness: 1px; }

.vorschau-hinweis {
  background: var(--fh-flieder);
  padding: .65rem clamp(1.25rem, 5vw, 4rem);
  font-size: var(--fh-text-s);
}
.vorschau-hinweis a { margin-left: .5rem; }

/* ---------- Inhalt ---------- */
.inhalt { width: 100%; max-width: var(--fh-breite); margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 4rem) 5rem; }
h1 { font-size: var(--fh-titel-l); margin: 0 0 .7rem; color: var(--fh-tinte); }
h2 { font-size: var(--fh-titel-m); margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
.leise { color: var(--fh-text-leise); }
.klein { font-size: var(--fh-text-s); }
.fh-label { color: var(--fh-moos); margin: 0 0 .8rem; }
.seitenkopf { margin-bottom: clamp(1.75rem, 4vw, 3rem); }

.karte > .bs:last-child { margin-bottom: 0; }
.karte {
  background: #fff;
  border-radius: var(--fh-radius);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  margin-bottom: 1.5rem;
}

/* Knöpfe wie auf der Hauptseite: Flieder mit dunkler Schrift */
button, .knopf {
  font: inherit; font-weight: 400; font-size: .95rem;
  cursor: pointer; padding: 1rem 1.75rem;
  border: 0; border-radius: var(--fh-radius);
  background: var(--fh-flieder); color: var(--fh-tinte);
  transition: background-color .2s;
}
button:hover, .knopf:hover { background: color-mix(in srgb, var(--fh-flieder) 82%, var(--fh-tinte)); color: var(--fh-tinte); }

/* ---------- Anmeldung ---------- */
.seite-login .kopf { display: none; }
.seite-login main { display: flex; align-items: center; }
.anmeldung { width: 100%; max-width: 27rem; margin: 0 auto; }
.anmeldung__marke { text-align: center; margin-bottom: clamp(2rem, 5vw, 3rem); }
.anmeldung__marke img { height: 110px; width: auto; display: block; margin: 0 auto 1.1rem; }
.anmeldung__marke .fh-label { margin: 0; letter-spacing: .12em; }
.anmeldung h1 { font-size: 2.1rem; }

form { display: grid; gap: .75rem; margin: 1.75rem 0 1.25rem; }
label { font-weight: 400; font-size: var(--fh-text-s); letter-spacing: var(--fh-spur-label); text-transform: uppercase; color: var(--fh-moos); }
input {
  font: inherit; font-weight: 300; padding: .95rem 1rem; width: 100%;
  border: 1px solid var(--fh-mint); border-radius: var(--fh-radius);
  background: var(--fh-creme); color: var(--fh-text);
}
input:focus { outline: 2px solid var(--fh-oliv); outline-offset: 1px; border-color: var(--fh-oliv); background: #fff; }
.code-feld { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.fehler {
  background: color-mix(in srgb, var(--fh-pfirsich) 40%, #fff);
  border-left: 3px solid var(--fh-pfirsich);
  padding: .8rem 1rem; margin: 0;
}

/* ---------- Kursübersicht ---------- */
.kursliste { display: grid; gap: clamp(1.25rem, 3vw, 2rem); grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.kurskachel {
  text-decoration: none; background: #fff; border-radius: var(--fh-radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.kurskachel:hover { color: inherit; transform: translateY(-3px); box-shadow: 0 14px 30px -18px color-mix(in srgb, var(--fh-moos) 55%, transparent); }
.kurskachel img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; display: block; background: var(--fh-mint); }
.kurskachel__text { padding: 1.5rem 1.5rem 1.35rem; }
.kurskachel h2 { font-size: 1.85rem; margin-bottom: .45rem; }

/* Empfehlungen */
.empfehlungen { margin-top: clamp(3rem, 7vw, 5rem); padding-top: clamp(2rem, 5vw, 3rem); border-top: 1px solid var(--fh-mint); }
.empfehlungen > h2 { font-size: var(--fh-titel-l); margin-bottom: 1.5rem; }
.kurskachel--empfehlung { transform: none; }
.kurskachel--empfehlung:hover { transform: none; box-shadow: none; }
.kurskachel h3 { font-family: var(--fh-font-display); font-weight: 300; font-size: 1.85rem; letter-spacing: var(--fh-spur-titel); line-height: 1.05; margin: 0 0 .45rem; }
.kurskachel__knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.kurskachel__knoepfe form { display: block; margin: 0; }
.knopf { display: inline-block; text-decoration: none; }
.knopf--leise { background: transparent; border: 1px solid var(--fh-flieder); }
.knopf--leise:hover { background: var(--fh-flieder); }
.empfehlungen__hinweis { margin-top: 1.25rem; }

/* ---------- Kursseite ---------- */
.kursbild { display: block; margin: 0 0 clamp(2rem, 5vw, 3rem); border-radius: var(--fh-radius); overflow: hidden; background: var(--fh-mint); }
.kursbild img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
@media (min-width: 40rem) { .kursbild img { aspect-ratio: 8 / 3; } }

.kurskopf { margin-bottom: clamp(2rem, 5vw, 3.25rem); max-width: 46rem; }
.kurskopf h1 { font-size: var(--fh-titel-xl); }

/* Klassenbox in Mint mit Moos-Text, wie in den Anwendungsbeispielen */
.klasse {
  background: var(--fh-mint); color: var(--fh-moos);
  border-radius: var(--fh-radius);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  margin-bottom: clamp(2.25rem, 5vw, 3.5rem);
}
.klasse h2 { color: var(--fh-moos); font-size: 2.2rem; }
.klasse a { color: var(--fh-moos); }
.klasse .player { margin: 1.25rem 0 1.5rem; }

.modul { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.modul > .fh-label { margin-bottom: .45rem; }
.lektionen { list-style: none; margin: 1.1rem 0 0; padding: 0; border-top: 1px solid var(--fh-mint); }
.lektion { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--fh-mint); }
.lektion > a, .lektion > span:first-child { flex: 1; display: flex; align-items: center; gap: .9rem; padding: 1rem .25rem; text-decoration: none; }
.lektion__marke {
  flex: none; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  display: grid; place-items: center; font-size: .75rem; line-height: 1;
  border: 1px solid var(--fh-oliv); color: var(--fh-creme);
}
.lektion--erledigt .lektion__marke { background: var(--fh-oliv); border-color: var(--fh-oliv); color: var(--fh-moos); font-weight: 400; }
.lektion--gesperrt .lektion__marke { border-color: var(--fh-mint); }
.lektion__titel { flex: 1; }
.lektion__nr { display: block; font-size: var(--fh-text-s); color: var(--fh-moos); letter-spacing: var(--fh-spur-label); text-transform: uppercase; margin-bottom: .15rem; }
.lektion > a:hover .lektion__titel { text-decoration: underline; text-decoration-thickness: 1px; }
.lektion--gesperrt { color: var(--fh-text-leise); }
.lektion__dauer { font-size: var(--fh-text-s); color: var(--fh-text-leise); white-space: nowrap; padding: 1rem .25rem; }
.modul__hinweis { background: var(--fh-flieder); padding: .7rem 1rem; border-radius: var(--fh-radius); margin: .75rem 0 0; }

/* Fortschritt */
.fortschritt { margin-top: 1.5rem; max-width: 28rem; }
.fortschritt--klein { margin-top: .9rem; }
.fortschritt__balken { height: 6px; background: var(--fh-mint); border-radius: 3px; overflow: hidden; margin-bottom: .45rem; }
.fortschritt__balken span { display: block; height: 100%; background: var(--fh-oliv); }
.fortschritt p { margin: 0; }

.player--begruessung { margin: 0 0 clamp(2rem, 5vw, 3rem); }

/* Aufzeichnungen */
.aufzeichnung { border-bottom: 1px solid var(--fh-mint); }
.aufzeichnung:first-of-type { border-top: 1px solid var(--fh-mint); margin-top: 1.1rem; }
.aufzeichnung summary { cursor: pointer; padding: 1rem .25rem; }
.aufzeichnung[open] summary { color: var(--fh-moos); }
.aufzeichnung .player { margin: 0 0 1.25rem; }

/* ---------- Lektion: Seitenspalte + Inhalt ---------- */
.seite-lektion .inhalt { max-width: 90rem; }
.lektionsrahmen { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
.lektionsseite { min-width: 0; }

/* Kursübersicht links */
.kursnav { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; background: #fff; border-radius: var(--fh-radius); font-size: .92rem; }
.kursnav__schalter, .kursnav__knopf { display: none; }
.kursnav__kopf { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--fh-mint); }
.kursnav__kurs { font-family: var(--fh-font-display); font-weight: 500; font-size: 1.5rem; text-decoration: none; line-height: 1.1; }
.kursnav .fortschritt { margin-top: .8rem; }
.kursnav__modul { border-bottom: 1px solid var(--fh-mint); }
.kursnav__modul > summary { list-style: none; cursor: pointer; padding: .85rem 1.25rem .85rem 2.2rem; position: relative; line-height: 1.3; }
.kursnav__modul > summary::-webkit-details-marker { display: none; }
.kursnav__modul > summary::before { content: ""; position: absolute; left: 1.1rem; top: 1.2rem; border: 5px solid transparent; border-left-color: var(--fh-moos); transition: transform .15s; transform-origin: 2px 5px; }
.kursnav__modul[open] > summary::before { transform: rotate(90deg); }
.kursnav__modul[open] > summary { background: color-mix(in srgb, var(--fh-mint) 45%, #fff); }
.kursnav__modulnr { display: block; font-size: var(--fh-text-s); letter-spacing: var(--fh-spur-label); text-transform: uppercase; color: var(--fh-moos); font-weight: 400; }
.kursnav__modultitel { font-weight: 400; }
.kursnav__modulfertig { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: 1.1rem; color: var(--fh-moos); }
.kursnav__liste { list-style: none; margin: 0; padding: 0 0 .5rem; }
.kursnav__liste--lose { border-bottom: 1px solid var(--fh-mint); padding-top: .5rem; }
.kursnav__lektion > a, .kursnav__lektion > span { display: flex; gap: .75rem; align-items: flex-start; padding: .55rem 1.25rem .55rem 2.2rem; text-decoration: none; line-height: 1.35; }
.kursnav__lektion > a:hover { background: color-mix(in srgb, var(--fh-mint) 35%, #fff); color: inherit; }
.kursnav__marke {
  flex: none; width: 1.1rem; height: 1.1rem; margin-top: .15rem; border-radius: 50%;
  border: 1.5px solid var(--fh-oliv); display: grid; place-items: center; background: #fff;
}
.kursnav__marke svg { width: .7rem; height: .7rem; stroke-width: 3; }
.kursnav__titel { display: flex; gap: .4rem; align-items: baseline; }
.kursnav__nr { flex: none; color: var(--fh-moos); font-size: var(--fh-text-s); font-variant-numeric: tabular-nums; }
.ist-erledigt > a .kursnav__marke { background: var(--fh-oliv); border-color: var(--fh-oliv); color: var(--fh-moos); }
.ist-gesperrt { color: var(--fh-text-leise); }
.ist-gesperrt .kursnav__marke { border-color: var(--fh-mint); }
.ist-aktuell > a { background: var(--fh-flieder); font-weight: 400; }

/* Kopf der Lektion: Banner in Flieder wie bei Ablefy */
.lektion__banner { background: var(--fh-flieder); border-radius: var(--fh-radius); padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem); text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.lektion__banner .fh-label { margin-bottom: .6rem; }
.lektion__banner h1 { margin: 0; font-size: var(--fh-titel-l); }

.lektionstext { margin: 0 0 clamp(2.5rem, 5vw, 3.5rem); }
/* Fließtext schmal für gute Lesbarkeit, Bausteine in voller Breite */
.lektionstext > :not(.bs) { max-width: 46rem; margin-left: auto; margin-right: auto; }
.lektionstext > h2, .lektionstext > h3 { margin-top: 0; }
.lektionstext > * + h2 { margin-top: clamp(2rem, 4vw, 3rem); }
.lektion__laenge { display: flex; justify-content: center; align-items: center; gap: .5rem; margin: 0 0 1rem; font-size: var(--fh-text-s); }
.lektion__laenge svg { width: 1.2rem; height: 1.2rem; }
.player { margin: 0 0 clamp(2.5rem, 5vw, 4rem); background: var(--fh-tinte); border-radius: var(--fh-radius); overflow: hidden; }

/* Material in Mint, wie die Download-Zeilen bei Ablefy */
.material { margin: 0 0 clamp(2.5rem, 5vw, 3.5rem); }
.material > .fh-label { margin-bottom: .9rem; }
.material__liste { display: grid; gap: .75rem; }
.material__datei { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fff; border-radius: var(--fh-radius); padding: 1.1rem 1.25rem; }
.material__symbol { width: 1.5rem; flex: none; color: var(--fh-moos); }
.material__name { flex: 1; display: grid; gap: .15rem; min-width: 12rem; }
.material__name strong { font-weight: 400; font-size: 1.1rem; }
.knopf--dunkel { background: var(--fh-tinte); color: #fff; text-transform: uppercase; letter-spacing: .06em; min-width: 11rem; text-align: center; }
.knopf--dunkel:hover { background: #000; color: #fff; }

.erledigt { display: flex; justify-content: center; margin: 0 0 clamp(2.5rem, 5vw, 4rem); }

/* „Weiter geht's!" mit senkrechtem Strich wie bei Ablefy */
.weiter { text-align: center; margin-bottom: 3rem; }
.weiter__strich { display: block; width: 1px; height: 5rem; background: var(--fh-tinte); margin: 0 auto 2rem; }
.weiter__link { display: inline-grid; gap: .35rem; text-decoration: none; }
.weiter__titel { font-family: var(--fh-font-display); font-weight: 500; font-size: var(--fh-titel-l); line-height: 1.05; letter-spacing: var(--fh-spur-titel); }
.weiter__link:hover .weiter__titel { color: var(--fh-moos); }

.lektionsnav { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--fh-mint); font-size: var(--fh-text-s); }
.lektionsnav a { text-decoration: none; color: var(--fh-moos); }

@media (max-width: 62rem) {
  .lektionsrahmen { grid-template-columns: 1fr; }
  .kursnav { position: static; max-height: none; }
  .kursnav__knopf { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 1rem 1.25rem; font-weight: 400; }
  .kursnav__knopf::after { content: "▾"; color: var(--fh-moos); }
  .kursnav__inhalt { display: none; border-top: 1px solid var(--fh-mint); }
  .kursnav__schalter:checked ~ .kursnav__inhalt { display: block; }
  .kursnav__schalter:checked + .kursnav__knopf::after { content: "▴"; }
}

/* ---------- Bausteine ---------- */
.bs { margin: 0 0 clamp(2.5rem, 5vw, 3.5rem); }
.bs--flieder { background: var(--fh-flieder); }
.bs--mint { background: var(--fh-mint); }
.bs--pfirsich { background: var(--fh-pfirsich); }
.bs--creme { background: var(--fh-creme); }

.bs-banner { border-radius: var(--fh-radius); padding: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 3rem); text-align: center; }
.bs-banner h2 { margin: 0; font-size: var(--fh-titel-l); }
.bs-banner .fh-label { margin-bottom: .6rem; }

.bs-kacheln { border-radius: var(--fh-radius); padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem); text-align: center; }
.bs-kacheln > h2 { font-size: var(--fh-titel-l); margin: 0 0 clamp(2rem, 4vw, 3rem); }
.bs-kacheln__raster { display: grid; gap: clamp(1.75rem, 4vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
@media (min-width: 48rem) {
  .bs-kacheln__raster--3 { grid-template-columns: repeat(3, 1fr); }
  .bs-kacheln__raster--4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 48rem) and (max-width: 75rem) {
  .lektionsseite .bs-kacheln__raster--4 { grid-template-columns: repeat(2, 1fr); }
}
.bs-kachel__symbol { display: inline-block; width: 4.25rem; height: 4.25rem; color: #fff; margin-bottom: .9rem; }
.bs-kachel__symbol svg { width: 100%; height: 100%; stroke-width: 1.6; }
.bs-kachel h3 { font-family: var(--fh-font-text); font-weight: 400; font-size: 1.3rem; letter-spacing: 0; margin: 0 0 .4rem; }
.bs-kachel p { margin: 0; }

.bs-bildtext { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.bs-bildtext--rechts { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.bs-bildtext--rechts .bs-bildtext__bild { order: 2; }
.bs-bildtext--ohne-bild { grid-template-columns: 1fr; }
.bs-bildtext__bild { margin: 0; }
.bs-bildtext__bild img { display: block; width: 100%; height: auto; border-radius: var(--fh-radius); }
.bs-bildtext__text > :last-child { margin-bottom: 0; }

.bs-symbolliste { border-radius: var(--fh-radius); }
.bs-symbolliste.bs--mint { padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 2.25rem); }
.bs-symbolliste h2 { margin-top: 0; }
.bs-symbolliste ul { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .7rem; }
.bs-symbolliste li { display: flex; gap: .8rem; align-items: flex-start; }
.bs-symbolliste__symbol { flex: none; width: 1.3rem; height: 1.3rem; margin-top: .15rem; color: var(--fh-moos); }
.bs-symbolliste__symbol svg { width: 100%; height: 100%; }

.bs-knopf--mitte { text-align: center; }
.kurstext { max-width: 64rem; margin: 0 0 clamp(2.5rem, 5vw, 4rem); }
.kurstext > .bs:last-child { margin-bottom: 0; }


@media (max-width: 45rem) {
  .bs-bildtext, .bs-bildtext--rechts { grid-template-columns: 1fr; }
  .bs-bildtext--rechts .bs-bildtext__bild { order: 0; }
}

/* ---------- Fuß in Mint ---------- */
.fuss { background: var(--fh-mint); color: var(--fh-moos); }
.fuss__innen { max-width: var(--fh-breite); margin: 0 auto; padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 5vw, 4rem); }
.fuss .fh-label { margin-bottom: .4rem; }
.fuss a { color: var(--fh-moos); }
.fuss__links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; font-size: var(--fh-text-s); }

@media (max-width: 34rem) {
  .kopf__marke img { height: 38px; }
  .kopf__nav { font-size: .9rem; }
}

/* Fehlerseite */
.fehlerseite { max-width: 34rem; padding: clamp(1rem, 5vw, 3rem) 0; }
.fehlerseite .knopf { margin-top: .5rem; }
