/* ════════════════════════════════════════════════════════════════
   Mitgliederbereich /kurs/ — eigenes Stylesheet (kein style.css-Konflikt)
   Design-System der Hauptseite: Smaragd/Champagner, DM Serif Display +
   Source Sans 3 (werden über /assets/css/fonts.css geladen).
   ════════════════════════════════════════════════════════════════ */

:root {
    --petrol: #1F4D3D;
    --petrol-deep: #143527;
    --petrol-light: #E4EFEA;
    --amber: #BE9E63;
    --amber-warm: #D2B884;
    --amber-light: #F4EEDF;
    --cream: #FAF7F0;
    --bg: #FCFAF4;
    --text: #1C2A24;
    --text-light: #5d6f66;
    --green: #2e8b66;
    --red: #b3402a;
    --line: #E4E2D4;
    --radius: 12px;
    --radius-lg: 22px;
    --serif: 'DM Serif Display', Georgia, serif;
    --sans: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}
a { color: var(--petrol); }
img, video { max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ─── Buttons ─── */
.btn-primary, .btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 999px; padding: 12px 24px;
    font-weight: 700; font-size: 16px; text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .12s ease;
}
.btn-primary { background: var(--amber); color: #fff; border: 1.5px solid var(--amber); }
.btn-primary:hover { background: #ad8e53; border-color: #ad8e53; transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: default; transform: none; }
.btn-ghost { background: transparent; color: var(--petrol); border: 1.5px solid var(--petrol); }
.btn-ghost:hover { background: var(--petrol-light); }
.btn-small { padding: 8px 16px; font-size: 14.5px; }

/* ─── Status-/Hinweisboxen ─── */
.status-box { display: none; margin-top: 14px; padding: 12px 16px; border-radius: var(--radius); font-size: 15px; }
.status-box.ok  { display: block; background: var(--petrol-light); color: var(--petrol-deep); }
.status-box.err { display: block; background: #F8E7E2; color: var(--red); }
.hint-box {
    background: var(--amber-light); border: 1px solid var(--amber-warm);
    border-radius: var(--radius); padding: 14px 18px; font-size: 15px; margin-bottom: 18px;
}

/* ════════════ Auth-Seiten (Login / Danke / Gate) ════════════ */
.auth-wrap {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 28px 18px;
}
.auth-brand { text-align: center; margin-bottom: 26px; text-decoration: none; display: block; }
.auth-brand .b1 { font-family: var(--serif); font-size: 26px; color: var(--petrol); }
.auth-brand .b1 span { color: var(--amber); }
.auth-brand .b2 {
    display: block; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-light); margin-top: 2px; font-weight: 600;
}
.auth-card {
    width: 100%; max-width: 460px; background: #fff;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 36px 34px; box-shadow: 0 12px 40px rgba(31, 77, 61, .07);
}
.auth-card.wide { max-width: 620px; }
.auth-card h1 { font-family: var(--serif); font-weight: 400; font-size: 27px; color: var(--petrol); margin-bottom: 8px; }
.auth-card .lead { color: var(--text-light); font-size: 15.5px; margin-bottom: 22px; }
.auth-foot { margin-top: 22px; font-size: 14px; color: var(--text-light); text-align: center; }
.auth-links { margin-top: 26px; font-size: 13.5px; color: var(--text-light); text-align: center; }
.auth-links a { color: var(--text-light); margin: 0 7px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field input[type="email"], .field input[type="password"], .field input[type="text"] {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
    font: inherit; background: var(--cream); color: var(--text);
}
.field input:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber); }

.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 15px; }
.check-row input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--petrol); flex: none; }

/* ─── Danke-Seite ─── */
.danke-icon {
    width: 64px; height: 64px; border-radius: 50%; background: var(--petrol-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--green); font-size: 30px; margin: 0 auto 18px;
}
.danke-icon.wait { background: var(--amber-light); color: var(--amber); }
.danke-center { text-align: center; }
.danke-steps { text-align: left; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; }
.danke-steps h2 { font-size: 16px; color: var(--petrol); margin-bottom: 10px; }
.danke-steps ol { padding-left: 20px; }
.danke-steps li { margin-bottom: 6px; font-size: 15px; }
.spinner {
    width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 16px;
    border: 3px solid var(--line); border-top-color: var(--amber);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

/* ════════════ Player-App ════════════ */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.app[hidden] { display: none; }

.app-bar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: var(--petrol); color: #fff; padding: 10px 18px;
}
.app-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.app-brand .mark { color: var(--amber); font-size: 20px; }
.app-brand .t1 { font-family: var(--serif); font-size: 17px; line-height: 1.15; }
.app-brand small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.menu-toggle {
    display: none; background: none; border: 1.5px solid rgba(255,255,255,.35);
    color: #fff; border-radius: 8px; padding: 5px 10px; font-size: 17px;
}
.progress-wrap { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,.85); }
.progress-wrap .bar { width: 130px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; }
.progress-wrap .bar i { display: block; height: 100%; width: 0; background: var(--amber); border-radius: 99px; transition: width .3s ease; }
.logout-btn {
    background: none; border: 1.5px solid rgba(255,255,255,.35); color: #fff;
    border-radius: 999px; padding: 6px 14px; font-size: 13.5px; font-weight: 600;
}
.logout-btn:hover { background: rgba(255,255,255,.12); }

.app-body { display: flex; flex: 1; min-height: 0; }

/* ─── Sidebar ─── */
.side {
    width: 320px; flex: none; background: #fff; border-right: 1px solid var(--line);
    padding: 20px 0 40px; overflow-y: auto;
}
.side .t {
    font-size: 12.5px; letter-spacing: .13em; text-transform: uppercase;
    color: var(--text-light); font-weight: 700; padding: 0 20px 12px;
}
.s-module { border-top: 1px solid var(--line); }
.s-module .h {
    display: flex; align-items: center; gap: 10px; padding: 13px 20px;
    font-weight: 700; font-size: 15px; color: var(--petrol); cursor: pointer;
}
.s-module .h .n {
    width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--petrol-light);
    color: var(--petrol); display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700;
}
.s-module .h .chev { margin-left: auto; transition: transform .18s ease; color: var(--text-light); }
.s-module.open .h .chev { transform: rotate(180deg); }
.s-lessons { display: none; padding-bottom: 8px; }
.s-module.open .s-lessons { display: block; }
.s-lesson {
    display: flex; align-items: center; gap: 10px; padding: 9px 20px 9px 30px;
    font-size: 14.5px; cursor: pointer; color: var(--text);
}
.s-lesson:hover { background: var(--cream); }
.s-lesson.active { background: var(--petrol-light); font-weight: 600; }
.s-lesson .tick {
    width: 18px; height: 18px; flex: none; border-radius: 50%;
    border: 1.5px solid var(--line); color: transparent;
    display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.s-lesson.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.s-lesson .nm { flex: 1; }
.s-lesson .dr { font-size: 12.5px; color: var(--text-light); flex: none; }
.s-lesson.locked { opacity: .6; }
.s-lesson .soon { flex: none; font-size: 11px; background: var(--amber-light); color: #8a6f3c; border-radius: 99px; padding: 1px 8px; font-weight: 700; }

/* ─── Hauptbereich ─── */
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 30px 60px; }
.crumb { font-size: 13.5px; color: var(--text-light); margin-bottom: 4px; }
.crumb b { color: var(--petrol); }
.lesson-title { font-family: var(--serif); font-weight: 400; font-size: 28px; color: var(--petrol); margin-bottom: 6px; }
.lesson-intro { color: var(--text-light); max-width: 720px; margin-bottom: 18px; }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.video-shell {
    background: var(--petrol-deep); border-radius: var(--radius);
    overflow: hidden; aspect-ratio: 16 / 9;
}
.video-shell video { width: 100%; height: 100%; display: block; background: #000; }
.video-missing {
    aspect-ratio: 16 / 9; border-radius: var(--radius);
    background: var(--petrol-light); border: 1.5px dashed var(--petrol);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; text-align: center; padding: 24px; color: var(--petrol);
}
.video-missing .ico { font-size: 34px; }
.video-missing p { font-weight: 600; max-width: 380px; }

.video-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.nav-btns { display: flex; gap: 10px; }

.points {
    margin-top: 22px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 22px;
}
.points h3 { font-size: 15.5px; color: var(--petrol); margin-bottom: 10px; }
.points ul { padding-left: 20px; }
.points li { margin-bottom: 6px; font-size: 15px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel .ph {
    display: flex; align-items: center; gap: 8px; padding: 13px 16px;
    font-weight: 700; font-size: 14.5px; color: var(--petrol);
    border-bottom: 1px solid var(--line); background: var(--cream);
}
.panel .badge { background: var(--petrol-light); color: var(--petrol); border-radius: 99px; padding: 1px 9px; font-size: 12px; }
.chapters { max-height: 480px; overflow-y: auto; }
.chapter { display: flex; gap: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.chapter:hover { background: var(--cream); }
.chapter.active { background: var(--petrol-light); font-weight: 600; }
.chapter .ts { flex: none; color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; }
.chapters-empty { padding: 16px; font-size: 14px; color: var(--text-light); }

/* ─── Responsiv ─── */
@media (max-width: 1020px) {
    .stage { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .menu-toggle { display: inline-flex; }
    .progress-wrap span { display: none; }
    .app-body { position: relative; }
    .side {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
        transform: translateX(-104%); transition: transform .22s ease;
        box-shadow: 0 0 60px rgba(0,0,0,.25); width: min(320px, 86vw);
        padding-top: 16px;
    }
    .side.show { transform: translateX(0); }
    .main { padding: 20px 16px 60px; }
    .lesson-title { font-size: 23px; }
}

/* ─── Dezenter Rechts-Footer unter dem Player-Content ─── */
.legal-foot {
    margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
    font-size: 12.5px; color: var(--text-light); text-align: center;
}
.legal-foot a { color: var(--text-light); text-decoration: none; }
.legal-foot a:hover { color: var(--petrol); text-decoration: underline; }
.foot-hints {
    margin-top: 42px; padding: 14px 18px; border-radius: var(--radius);
    background: var(--cream); border: 1px solid var(--line);
    font-size: 13px; color: var(--text-light); text-align: center; line-height: 1.6;
}

/* ─── Plan-Badge in der App-Bar ─── */
.plan-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
    color: #fff; border-radius: 999px; padding: 3px 12px;
    font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
}
.plan-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }

/* ─── Lektions-Status-Chips ─── */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 700;
    background: var(--cream); border: 1.5px solid var(--line); color: var(--text-light);
}
.chip.on { background: var(--petrol-light); border-color: var(--green); color: var(--petrol-deep); }

/* ─── Sidebar: Reihenfolge-Sperre ─── */
.s-lesson.lockseq { opacity: .55; cursor: not-allowed; }
.s-lesson.lockseq .tick { border-style: dashed; }
.s-lesson .lockico { flex: none; font-size: 12px; color: var(--text-light); }

/* ─── Selbst-Check (Quiz) ─── */
.quiz {
    margin-top: 22px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 22px;
}
.quiz h3 { font-size: 15.5px; color: var(--petrol); margin-bottom: 4px; }
.quiz .quiz-sub { font-size: 13.5px; color: var(--text-light); margin-bottom: 14px; }
.quiz-q { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.quiz-q .qq { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.quiz-opt {
    display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px;
    border-radius: 8px; cursor: pointer; font-size: 14.5px;
}
.quiz-opt:hover { background: var(--cream); }
.quiz-opt input { margin-top: 3px; accent-color: var(--petrol); flex: none; }
.q-feedback { display: none; margin: 8px 0 6px; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.q-feedback.ok  { display: block; background: var(--petrol-light); color: var(--petrol-deep); }
.q-feedback.err { display: block; background: #F8E7E2; color: var(--red); }
.quiz-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.quiz-result { display: none; margin-top: 14px; padding: 13px 16px; border-radius: 10px; font-size: 14.5px; }
.quiz-result.ok  { display: block; background: var(--petrol-light); color: var(--petrol-deep); }
.quiz-result.err { display: block; background: var(--amber-light); color: #7a6234; }
.quiz-passed-note {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--petrol-light); border-radius: 10px; padding: 12px 16px; font-size: 14.5px;
    color: var(--petrol-deep); font-weight: 600;
}

/* ─── Extra-Sektionen unter dem Player (Karten) ─── */
.xsection { margin-top: 34px; }
.xsection > h2 {
    font-family: var(--serif); font-weight: 400; font-size: 22px;
    color: var(--petrol); margin-bottom: 14px;
}
.xgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.xcard {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 22px;
}
.xcard h3 { font-size: 16px; color: var(--petrol); margin-bottom: 8px; }
.xcard p { font-size: 14.5px; color: var(--text); margin-bottom: 12px; }
.xcard .muted { color: var(--text-light); }
.xcard .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-list { list-style: none; }
.dl-list li { border-top: 1px solid var(--line); }
.dl-list li:first-child { border-top: none; }
.dl-list a {
    display: flex; align-items: center; gap: 10px; padding: 10px 4px;
    text-decoration: none; font-size: 14.5px; font-weight: 600; color: var(--petrol);
}
.dl-list a:hover { background: var(--cream); }

/* ─── Prüfungsbereich (nur Fernkurs) ─── */
.exam-details { padding: 0; overflow: hidden; }
.exam-details > summary {
    list-style: none; cursor: pointer; padding: 18px 22px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-weight: 700; font-size: 16px; color: var(--petrol);
}
.exam-details > summary::-webkit-details-marker { display: none; }
.exam-details > summary .chev { margin-left: auto; transition: transform .18s ease; color: var(--text-light); }
.exam-details[open] > summary .chev { transform: rotate(180deg); }
.exam-body { padding: 0 22px 22px; border-top: 1px solid var(--line); }
.status-pill {
    display: inline-block; border-radius: 999px; padding: 2px 12px;
    font-size: 12.5px; font-weight: 700;
}
.status-pill.offen { background: var(--cream); color: var(--text-light); border: 1px solid var(--line); }
.status-pill.eingereicht { background: var(--amber-light); color: #7a6234; }
.status-pill.bestanden { background: var(--petrol-light); color: var(--petrol-deep); }
.status-pill.nachbesserung { background: #F8E7E2; color: var(--red); }
.exam-q { margin-top: 20px; }
.exam-q .qn { font-weight: 700; color: var(--petrol); font-size: 15px; margin-bottom: 6px; }
.exam-part { margin: 10px 0 14px; }
.exam-part label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
.exam-part textarea {
    width: 100%; min-height: 88px; resize: vertical; padding: 10px 12px;
    border: 1.5px solid var(--line); border-radius: 10px; font: inherit;
    font-size: 14.5px; background: var(--cream); color: var(--text);
}
.exam-part textarea:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber); }
.exam-part textarea[readonly] { background: #f3f2ec; color: var(--text-light); }
.exam-actions { margin-top: 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.autosave-note { font-size: 13px; color: var(--text-light); }
.exam-req { margin-top: 10px; font-size: 13.5px; color: var(--text-light); }
.exam-req .miss { color: var(--red); }

/* ─── Upload (Behandlungsvideo) ─── */
.upload-progress { display: none; margin-top: 12px; }
.upload-progress .track { height: 9px; border-radius: 99px; background: var(--cream); border: 1px solid var(--line); overflow: hidden; }
.upload-progress .fill { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s ease; }
.upload-progress .pct { font-size: 13px; color: var(--text-light); margin-top: 5px; }

/* ─── Zertifikate ─── */
.cert-list { list-style: none; }
.cert-list li { border-top: 1px solid var(--line); }
.cert-list li:first-child { border-top: none; }
.cert-list a {
    display: flex; align-items: center; gap: 10px; padding: 11px 4px;
    text-decoration: none; font-size: 14.5px; font-weight: 600; color: var(--petrol);
}
.cert-list a:hover { background: var(--cream); }

/* ─── Toast (Reihenfolge-Hinweis) ─── */
.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
    background: var(--petrol-deep); color: #fff; border-radius: 10px;
    padding: 11px 18px; font-size: 14px; z-index: 100; opacity: 0;
    pointer-events: none; transition: opacity .2s ease, transform .2s ease;
    max-width: min(90vw, 460px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 820px) {
    .plan-badge { display: none; }
}
