:root {
  --orange: #e85d0a;
  --orange-dark: #b94300;
  --orange-soft: #fff0e6;
  --ink: #111111;
  --muted: #625e58;
  --paper: #f7f6f2;
  --white: #ffffff;
  --line: #e3dfd7;
  --green: #21764b;
  --green-soft: #eaf6ef;
  --red: #a52e2e;
  --red-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(17, 17, 17, 0.08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.shell { width: min(100% - 32px, 1080px); margin: 0 auto; padding: 24px 0 56px; }
.shell.narrow { width: min(100% - 32px, 760px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.wordmark { text-decoration: none; font-weight: 900; font-size: clamp(22px, 4vw, 30px); letter-spacing: -1.2px; }
.wordmark span { color: var(--orange); }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.privacy-note { color: var(--muted); font-size: 13px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.login-card { max-width: 480px; margin: 8vh auto 0; }
.eyebrow { margin: 0 0 8px; color: var(--orange-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .09em; font-size: 12px; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.03em; }
h1 { font-size: clamp(30px, 6vw, 48px); }
h2 { font-size: clamp(24px, 4vw, 34px); }
h3 { font-size: 19px; }
p { line-height: 1.55; }
.lede { color: var(--muted); font-size: 17px; margin: 12px 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field-gap-sm { margin-top: 14px; }
.form-gap { margin-top: 18px; }
.section-gap { margin-bottom: 16px; }
.btn-full { width: 100%; }
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.actions-top { margin-bottom: 16px; }
.full-btn { width: 100%; }
label, legend { font-weight: 750; font-size: 14px; }
input, select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white);
  color: var(--ink); padding: 12px 13px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(232, 93, 10, .12); }
textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.code-input { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; }
.check input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }

.btn {
  border: 0; border-radius: 12px; padding: 12px 17px; background: var(--orange); color: var(--white);
  font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: var(--orange-dark); }
.btn:focus-visible { outline: 3px solid rgba(232, 93, 10, .35); outline-offset: 2px; }
.btn.secondary { background: var(--ink); }
.btn.secondary:hover { background: #353535; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #efede7; }
.btn.danger { background: var(--red); }
.btn.small-btn { padding: 8px 11px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: wait; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.notice { border-radius: 12px; padding: 12px 14px; margin-top: 14px; background: var(--orange-soft); color: #713100; }
.notice.error { background: var(--red-soft); color: var(--red); }
.notice.success { background: var(--green-soft); color: var(--green); }
.notice:empty { display: none; }

.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; }
.profile-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.topic-choice { grid-column: 1 / -1; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.topic-choice .small { margin: 0 0 12px; font-weight: 700; color: var(--ink); }
.topic-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.topic-button { width: 100%; min-height: 72px; text-align: left; justify-content: flex-start; line-height: 1.25; background: var(--white); }


.pill { border: 1px solid var(--line); background: #f1efe9; border-radius: 999px; padding: 7px 11px; font-size: 13px; font-weight: 700; }
.pill.orange { background: var(--orange-soft); border-color: #ffd2b7; color: var(--orange-dark); }
.progress-line { height: 6px; border-radius: 999px; background: #ebe8e1; overflow: hidden; margin: 20px 0 4px; }
.progress-line span { display: block; height: 100%; background: var(--orange); transition: width .25s ease; }
.progress-start { width: 20%; }

.step { scroll-margin-top: 20px; }
.step-number { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--orange); color: white; font-weight: 900; margin-bottom: 12px; }
.vocab-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.vocab-card { min-height: 104px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); text-align: left; }
.vocab-card strong, .vocab-card span { display: block; }
.vocab-card strong { font-size: 17px; }
.vocab-card span { color: var(--orange-dark); margin-top: 8px; opacity: 0; }
.vocab-card.open span { opacity: 1; }
.reading-box { margin-top: 18px; border-left: 5px solid var(--orange); background: #fbfaf7; padding: 20px; border-radius: 0 14px 14px 0; }
.reading-box p { white-space: pre-line; font-size: 17px; }
.listening-box { text-align: center; padding: 30px 18px; background: var(--orange-soft); border-radius: 14px; margin-top: 18px; }
.question { border: 0; margin: 22px 0 0; padding: 0; }
.options { display: grid; gap: 9px; margin-top: 11px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; font-weight: 500; }
.option:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.option input { width: 17px; height: 17px; margin-top: 2px; }
.counter { text-align: right; color: var(--muted); font-size: 13px; margin-top: 7px; }

.feedback-grid { display: grid; gap: 10px; margin-top: 18px; }
.criterion { display: grid; grid-template-columns: 140px 95px 1fr; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.rating { border-radius: 999px; padding: 4px 8px; text-align: center; font-size: 12px; font-weight: 850; }
.rating.stark { color: var(--green); background: var(--green-soft); }
.rating.solide { color: #443600; background: #fff4c9; }
.rating.im_aufbau { color: var(--orange-dark); background: var(--orange-soft); }
.improvement { border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-top: 10px; }
.section-heading { margin-top: 24px; }
.before { text-decoration: line-through; color: var(--red); }
.after { color: var(--green); font-weight: 750; }

.history-list, .pupil-list { display: grid; gap: 12px; margin-top: 18px; }
.history-item, .pupil-item { border: 1px solid var(--line); border-radius: 13px; padding: 15px; background: #fbfaf7; }
.pupil-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.pupil-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.flag { color: var(--red); font-weight: 850; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.stat { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.stat strong { display: block; font-size: 28px; }
.stat span { color: var(--muted); font-size: 13px; }
.admin-layout { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.sticky { position: sticky; top: 18px; }
.submission { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.submission pre { white-space: pre-wrap; font: inherit; background: var(--paper); border-radius: 10px; padding: 12px; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(92vw, 520px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(17, 17, 17, .55); }
.dialog-body { padding: 26px; }
.credential { font-size: 22px; font-weight: 900; letter-spacing: .08em; background: var(--paper); border-radius: 10px; padding: 12px; margin: 8px 0 16px; }

.footer { margin-top: 28px; text-align: center; color: var(--muted); font-size: 13px; }
.footer a { margin: 0 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 1080px); padding-top: 14px; }
  .topbar { align-items: flex-start; }
  .hero, .admin-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .form-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .vocab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-buttons { grid-template-columns: 1fr; }
  .criterion { grid-template-columns: 1fr auto; }
  .criterion p { grid-column: 1 / -1; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
