/* DeutschKlar — course-page styles. Builds on landing.css (cosmic theme).
   Powers all 10 course pages + quiz + worksheet, consistently. */

/* ---- Course hero ---- */
.course-hero { padding: clamp(40px,7vw,80px) 0 clamp(28px,4vw,48px); position: relative; }
.ch-rail { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 20px; flex-wrap: wrap; }
.ch-rail a { color: var(--muted); } .ch-rail a:hover { color: var(--ink); }
.ch-rail .sep { opacity: 0.5; }
.ch-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ch-code { font-family: var(--font-head); font-weight: 700; font-size: 19px; color: #fff; padding: 7px 15px; border-radius: 12px; background: var(--grad-brand); box-shadow: 0 8px 22px -6px rgba(122,90,255,0.55), inset 0 1px 0 rgba(255,255,255,0.3); }
.ch-cefr { font-family: var(--font-head); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--line-2); padding: 6px 13px; border-radius: 999px; }
.course-hero h1 { font-size: clamp(34px,5vw,58px); line-height: 1.04; letter-spacing: -0.03em; }
.course-hero .lead { margin-top: 18px; }
.ch-meta { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 26px; }
.ch-meta .m { display: flex; flex-direction: column; gap: 3px; }
.ch-meta .m b { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: #fff; }
.ch-meta .m span { font-size: 12.5px; color: var(--muted); }

/* ---- Two-column shell: content + sticky sidebar ---- */
.course-shell { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.course-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 16px; }
.side-card { padding: 22px; border-radius: var(--r-lg); }
.side-card h4 { font-family: var(--font-head); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.side-prog .meter { height: 8px; background: rgba(255,255,255,0.07); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.side-prog .meter > i { display: block; height: 100%; background: var(--grad-cool); border-radius: 999px; width: 0%; transition: width .5s ease; }
.side-toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-toc a { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; color: var(--ink-soft); padding: 7px 9px; border-radius: 9px; transition: background .15s, color .15s; }
.side-toc a:hover { background: rgba(255,255,255,0.04); color: #fff; }
.side-toc a .n { font-family: var(--font-head); font-size: 11px; color: var(--muted); width: 16px; flex-shrink: 0; }

/* ---- Objectives / checklist ---- */
.obj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px; }
.obj-item { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink-soft); }
.obj-item .ck { width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(140deg, rgba(79,125,255,0.25), rgba(154,92,255,0.15)); border: 1px solid var(--line-2); color: var(--cyan); font-size: 13px; margin-top: 1px; }

/* ---- Lesson block ---- */
.lesson { border-radius: var(--r-lg); margin-bottom: 16px; overflow: hidden; }
.lesson__head { width: 100%; text-align: left; cursor: pointer; background: none; border: none; font-family: var(--font-body);
  display: flex; align-items: center; gap: 16px; padding: 22px 24px; color: var(--ink); }
.lesson__num { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: #fff; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(255,255,255,0.04); }
.lesson.is-open .lesson__num { background: var(--grad-brand); border-color: transparent; }
.lesson__t { flex: 1; }
.lesson__t b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 18px; color: #fff; }
.lesson__t span { font-size: 13.5px; color: var(--muted); }
.lesson__chev { color: var(--muted); font-size: 22px; transition: transform .3s ease; }
.lesson.is-open .lesson__chev { transform: rotate(180deg); }
.lesson__body { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.lesson__inner { padding: 4px 24px 26px; }

/* ---- Locked lesson (freemium preview) ---- */
.lesson--locked .lesson__head { cursor: pointer; }
.lesson--locked .lesson__body { max-height: 230px !important; position: relative; }
.lesson--locked .lesson__inner { filter: blur(5px); opacity: .6; pointer-events: none; user-select: none; }
.lesson-lock-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px 24px;
  background: linear-gradient(180deg, rgba(10,12,26,0) 0%, rgba(10,12,26,.78) 38%, rgba(10,12,26,.94) 100%); }
.lesson-lock-overlay .lockic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: rgba(255,255,255,0.07); border: 1px solid var(--line-2); }
.lesson-lock-overlay p { font-size: 13.5px; color: var(--ink-soft); max-width: 320px; margin: 0; }

.block-label { font-family: var(--font-head); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); margin: 24px 0 12px; display: flex; align-items: center; gap: 9px; }
.block-label::before { content: ""; width: 18px; height: 1px; background: var(--cyan); opacity: 0.6; }
.block-label .playall { text-transform: none; letter-spacing: 0; }

/* Grammar examples */
.gram-ex { display: flex; flex-direction: column; gap: 10px; }
.gram-ex .ex { padding: 14px 16px; border-radius: var(--r-md); background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.gram-ex .ex .de { font-family: var(--font-head); font-size: 16px; color: #fff; }
.gram-ex .ex .de mark { background: var(--grad-brand); color: #fff; padding: 0 6px; border-radius: 5px; }
.gram-ex .ex .en { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.gram-note { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; }
.gram-note b { color: #fff; }

/* Vocab table */
.vocab { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.vocab th, .vocab td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.vocab thead th { font-family: var(--font-head); font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: rgba(255,255,255,0.02); }
.vocab tbody tr:last-child td { border-bottom: none; }
.vocab .de { font-family: var(--font-head); font-weight: 600; color: #fff; white-space: nowrap; }
.vocab .en { color: var(--ink-soft); }
.vocab .tip { color: var(--muted); font-size: 13px; font-style: italic; }
.vocab tbody tr:nth-child(even) { background: rgba(255,255,255,0.015); }

/* Dialogue */
.dlg { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r-md); background: rgba(79,125,255,0.05); border: 1px solid var(--line); }
.dlg__line { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: baseline; }
.dlg__sp { font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--cyan); }
.dlg__de { font-size: 15.5px; color: #fff; }
.dlg__en { font-size: 13px; color: var(--muted); }

/* ---- Interactive exercises ---- */
.ex-card { padding: 26px; border-radius: var(--r-lg); }
.ex-q { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.ex-q:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.ex-q__p { font-size: 16px; color: #fff; margin-bottom: 14px; }
.ex-q__p .num { font-family: var(--font-head); color: var(--muted); margin-right: 8px; }
.ex-q__p .blank { border-bottom: 2px solid var(--cyan); padding: 0 22px; }
.ex-opts { display: flex; flex-wrap: wrap; gap: 10px; }
.ex-opt { font-family: var(--font-body); font-size: 15px; cursor: pointer; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--ink); transition: all .15s ease; }
.ex-opt:hover { border-color: rgba(120,160,255,0.6); }
.ex-opt.correct { background: rgba(46,160,110,0.18); border-color: #2ea06e; color: #8ff0c0; }
.ex-opt.wrong { background: rgba(226,70,55,0.16); border-color: #e24637; color: #ffb3aa; }
.ex-opt:disabled { cursor: default; }
.ex-input { font-family: var(--font-body); font-size: 15px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 14px; color: #fff; width: 170px; }
.ex-input:focus { outline: none; border-color: rgba(120,160,255,0.7); }
.ex-input.correct { border-color: #2ea06e; } .ex-input.wrong { border-color: #e24637; }
.ex-fb { font-size: 13.5px; margin-top: 10px; display: none; }
.ex-fb.show { display: block; } .ex-fb.ok { color: #8ff0c0; } .ex-fb.no { color: #ffb3aa; }
.ex-check { margin-top: 8px; }

/* Matching */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.match__col { display: flex; flex-direction: column; gap: 10px; }
.match__item { font-family: var(--font-body); text-align: left; cursor: pointer; padding: 12px 15px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--ink); font-size: 15px; transition: all .15s; }
.match__item:hover { border-color: rgba(120,160,255,0.6); }
.match__item.sel { background: linear-gradient(140deg, rgba(79,125,255,0.2), rgba(154,92,255,0.1)); border-color: rgba(120,160,255,0.7); }
.match__item.done { opacity: 0.45; pointer-events: none; border-color: #2ea06e; }

/* ---- Worksheet ---- */
.ws { padding: 30px; border-radius: var(--r-lg); }
.ws__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ws ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 13px; }
.ws ol li { font-size: 15px; color: var(--ink-soft); line-height: 1.6; }
.ws ol li .wsblank { display: inline-block; min-width: 90px; border-bottom: 1.5px solid var(--line-2); }
.ws__key { margin-top: 18px; padding: 18px 20px; border-radius: var(--r-md); background: rgba(255,255,255,0.03); border: 1px dashed var(--line-2); display: none; }
.ws__key.show { display: block; }
.ws__key h5 { font-family: var(--font-head); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.ws__key ol { padding-left: 22px; gap: 7px; }
.ws__key li { font-size: 14px; color: var(--ink); }

/* ---- Quiz ---- */
.quiz-band { padding: clamp(28px,4vw,42px); border-radius: var(--r-xl); position: relative; overflow: hidden; }
.quiz-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 120% at 50% 0%, rgba(154,92,255,0.18), transparent 60%), linear-gradient(180deg, rgba(20,18,48,0.6), rgba(10,12,30,0.4)); }
.quiz-intro { text-align: center; max-width: 560px; margin: 0 auto; }
.quiz-meta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 22px 0 26px; }
.quiz-stage { display: none; max-width: 640px; margin: 0 auto; }
.quiz-stage.on { display: block; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.quiz-prog { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 26px; }
.quiz-prog > i { display: block; height: 100%; background: var(--grad-cool); width: 0%; transition: width .3s ease; }
.quiz-qp { font-family: var(--font-head); font-size: clamp(19px,2.4vw,24px); color: #fff; margin-bottom: 20px; line-height: 1.35; }
.quiz-qp .blank { border-bottom: 2px solid var(--cyan); padding: 0 20px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { font-family: var(--font-body); text-align: left; cursor: pointer; padding: 15px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.03); color: var(--ink); font-size: 16px; transition: all .15s; }
.quiz-opt:hover { border-color: rgba(120,160,255,0.6); background: rgba(79,125,255,0.06); }
.quiz-opt.sel { background: linear-gradient(140deg, rgba(79,125,255,0.2), rgba(154,92,255,0.1)); border-color: rgba(120,160,255,0.8); }
.quiz-opt.correct { background: rgba(46,160,110,0.18); border-color: #2ea06e; color: #8ff0c0; }
.quiz-opt.wrong { background: rgba(226,70,55,0.16); border-color: #e24637; color: #ffb3aa; }
.quiz-opt:disabled { cursor: default; }
.quiz-fb { margin-top: 16px; padding: 13px 16px; border-radius: 10px; font-size: 14px; display: none; }
.quiz-fb.show { display: block; } .quiz-fb.ok { background: rgba(46,160,110,0.12); color: #8ff0c0; border: 1px solid rgba(46,160,110,0.4); } .quiz-fb.no { background: rgba(226,70,55,0.1); color: #ffb3aa; border: 1px solid rgba(226,70,55,0.35); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.quiz-input { font-family: var(--font-body); font-size: 17px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); border-radius: 10px; padding: 13px 16px; color: #fff; width: 240px; }
.quiz-input:focus { outline: none; border-color: rgba(120,160,255,0.7); }

.quiz-result { display: none; text-align: center; max-width: 520px; margin: 0 auto; }
.quiz-result.on { display: block; }
.qr-ring { position: relative; width: 160px; height: 160px; margin: 0 auto 18px; }
.qr-ring svg { transform: rotate(-90deg); }
.qr-ring .t { stroke: rgba(255,255,255,0.08); } .qr-ring .b { stroke: var(--cyan); transition: stroke-dashoffset 1s ease; filter: drop-shadow(0 0 6px rgba(56,224,232,0.5)); }
.qr-ring .lbl { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qr-ring .lbl b { font-family: var(--font-head); font-size: 40px; color: #fff; line-height: 1; }
.qr-ring .lbl span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.qr-badge { display: inline-flex; align-items: center; gap: 9px; padding: 9px 18px; border-radius: 999px; font-family: var(--font-head); font-size: 14px; margin-bottom: 8px; }
.qr-badge.pass { background: rgba(46,160,110,0.18); color: #8ff0c0; border: 1px solid rgba(46,160,110,0.45); }
.qr-badge.fail { background: rgba(226,70,55,0.14); color: #ffb3aa; border: 1px solid rgba(226,70,55,0.4); }

/* ---- Next level ---- */
.next-band { padding: clamp(28px,4vw,40px); border-radius: var(--r-xl); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; background: linear-gradient(120deg, rgba(79,125,255,0.12), rgba(154,92,255,0.06)); }
.next-band.locked { opacity: 0.7; }
.next-band__lock { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 6px; }

@media (max-width: 920px) {
  .course-shell { grid-template-columns: 1fr; }
  .course-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .course-side .side-card { flex: 1; min-width: 240px; }
}
@media (max-width: 620px) {
  .obj-grid, .match { grid-template-columns: 1fr; }
  .vocab .tip { display: none; }
  .dlg__line { grid-template-columns: 60px 1fr; }
}
@media print {
  .nav, .footer, .course-side, .quiz-band, .ex-card, .next-band, .flag-stripe, #stars, .cosmos, .lesson__chev { display: none !important; }
  body { background: #fff; color: #000; }
  .ws__key { display: block !important; }
  .lesson__body { max-height: none !important; }
}
