@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,520;9..144,600&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --ink: #0b1f3a;
  --ink-2: #143054;
  --paper: #f6f1e8;
  --canvas: #fbfaf7;
  --surface: #ffffff;
  --fg: #122033;
  --muted: #5a6a7a;
  --subtle: #8a97a5;
  --line: #e6ddd0;
  --line-strong: #d3c7b6;
  --primary: #1b6fd4;
  --primary-hover: #155bb0;
  --accent: #e56b0a;
  --accent-hover: #c85c08;
  --success: #1f7a4d;
  --success-soft: #e7f4ec;
  --danger: #c23b2e;
  --danger-soft: #fbeceb;
  --warn: #b45309;
  --warn-soft: #faf0e4;
  --teacher: #1b6fd4;
  --tutor: #0f766e;
  --admin: #0b1f3a;
  --student: #e56b0a;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(11 31 58 / 0.04), 0 12px 32px rgb(11 31 58 / 0.06);
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
}

html, body { height: 100%; }
body {
  background: var(--canvas);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 520;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 520;
}
.brand img { width: 36px; height: 36px; object-fit: contain; }
.brand.inverted { color: var(--paper); }

.btn, .form-control, .form-select, .form-check-input {
  border-radius: 8px;
}
.btn {
  font-weight: 600;
  padding: 0.5rem 1rem;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline-ink {
  border: 1px solid var(--line-strong);
  color: var(--fg);
  background: transparent;
}
.btn-outline-ink:hover { background: var(--paper); color: var(--fg); }
.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--muted);
}
.btn-ghost:hover { background: rgb(11 31 58 / 0.05); color: var(--fg); }

.card-sf {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card-sf:hover { border-color: var(--line-strong); }
.card-link { color: inherit; display: block; height: 100%; }
.card-link:hover { color: inherit; }

.badge-sf {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}
.badge-published, .badge-success { background: var(--success-soft); color: var(--success); }
.badge-draft, .badge-muted { background: #eef1f4; color: var(--muted); }
.badge-archived { background: var(--warn-soft); color: var(--warn); }
.badge-admin { background: var(--ink); color: var(--paper); }
.badge-teacher { background: #e7f0fb; color: var(--teacher); }
.badge-tutor { background: #e6f4f2; color: var(--tutor); }
.badge-student { background: #fdecdc; color: var(--student); }
.badge-visitor { background: #eef1f4; color: var(--muted); }
.badge-primary { background: #e7f0fb; color: var(--primary); }
.badge-accent { background: #fdecdc; color: var(--accent); }

.flash {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash-ok { background: var(--success-soft); color: var(--success); }
.flash-err { background: var(--danger-soft); color: var(--danger); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(246 241 232 / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(230 221 208 / 0.8);
}
.site-header .inner {
  max-width: 72rem;
  margin: 0 auto;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.site-nav { display: flex; gap: 1.5rem; font-size: 0.9rem; color: var(--muted); }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--fg); }

.hero {
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  position: relative;
}
.hero-grid {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4rem 1rem;
  display: grid;
  gap: 3rem;
}
@media (min-width: 992px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; padding: 6rem 1rem; }
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 1rem 0 0;
}
.hero h1 span { display: block; margin-top: 0.35rem; color: rgb(246 241 232 / 0.7); }
.hero p.lead { max-width: 36rem; color: rgb(246 241 232 / 0.7); margin-top: 1.5rem; }
.preview-card {
  background: var(--ink-2);
  border: 1px solid rgb(246 241 232 / 0.1);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
}
.preview-bar {
  height: 6px;
  background: rgb(246 241 232 / 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.preview-bar > span { display: block; height: 100%; background: var(--primary); }
.deco {
  position: absolute;
  pointer-events: none;
  border-radius: 2rem;
  border: 14px solid rgb(229 107 10 / 0.5);
}

.section { max-width: 72rem; margin: 0 auto; padding: 5rem 1rem; }
.section-alt { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--canvas); }

.app-shell { min-height: 100vh; background: var(--canvas); }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 15rem;
  background: var(--ink);
  color: var(--paper);
  padding: 1rem;
  display: none;
  flex-direction: column;
}
@media (min-width: 992px) {
  .app-sidebar { display: flex; }
  .app-main { margin-left: 15rem; }
}
.app-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 8px;
  color: rgb(246 241 232 / 0.65);
  font-size: 0.9rem;
}
.app-nav a:hover, .app-nav a.active {
  background: rgb(246 241 232 / 0.1);
  color: var(--paper);
}
.app-user {
  margin-top: auto;
  border-top: 1px solid rgb(246 241 232 / 0.1);
  padding-top: 1rem;
}
.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgb(246 241 232 / 0.1);
  font-size: 0.75rem;
  font-weight: 600;
}
.app-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 3.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  background: rgb(251 250 247 / 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
}
@media (min-width: 992px) { .app-top { display: none; } }
.app-content { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem; }

.stat { padding: 1rem; }
.stat .label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--font-display); font-size: 2rem; margin-top: 0.4rem; }

.list-sf { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.list-sf .row-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  color: inherit;
}
.list-sf .row-item:first-child { border-top: 0; }
.list-sf a.row-item:hover { background: var(--paper); color: inherit; }

.lesson + .lesson { border-top: 1px solid var(--line); padding-top: 1.25rem; margin-top: 1.25rem; }
.lesson-body { white-space: pre-wrap; color: var(--muted); line-height: 1.6; font-size: 0.95rem; }

.msg-bubble {
  max-width: 36rem;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}
.msg-me { background: var(--ink); color: var(--paper); margin-left: auto; }
.msg-them { background: var(--surface); border: 1px solid var(--line); }

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
}

.auth-split { min-height: 100vh; display: grid; }
@media (min-width: 992px) { .auth-split { grid-template-columns: 1fr 1fr; } }
.auth-panel {
  display: none;
  background: var(--ink);
  color: var(--paper);
  padding: 3rem;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
}
@media (min-width: 992px) { .auth-panel { display: flex; } }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 3rem 1.25rem; }
.auth-form .inner { max-width: 24rem; margin: 0 auto; width: 100%; }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--subtle);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.oauth-divider::before, .oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.btn-oauth {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
}
.btn-oauth:hover { background: var(--paper); color: var(--fg); }

.progress { height: 6px; background: var(--line); }
.progress-bar { background: var(--primary); }

.form-label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.form-control, .form-select {
  border-color: var(--line-strong);
  background: var(--surface);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgb(27 111 212 / 0.15);
}

footer.site-foot {
  border-top: 1px solid var(--line);
  padding: 2rem 1rem;
  color: var(--subtle);
  font-size: 0.85rem;
}
footer.site-foot .inner { max-width: 72rem; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.impressum { max-width: 40rem; }
.impressum h2 { font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }

.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; color: var(--danger); }
.field-validation-error { color: var(--danger); font-size: 0.8rem; }
