:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef4fa;
  --ink: #0b1729;
  --muted: #526173;
  --line: #dce5ee;
  --brand: #0d658f;
  --brand-strong: #084a6b;
  --accent: #30b9e7;
  --accent-soft: #dff6ff;
  --success: #14764f;
  --warning: #8a5a00;
  --danger: #a32929;
  --shadow: 0 18px 50px rgba(8, 38, 58, 0.10);
  --shadow-sm: 0 8px 24px rgba(8, 38, 58, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--ink); }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 9999;
  transform: translateY(-180%); background: var(--ink); color: #fff;
  padding: .7rem 1rem; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 820px); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(220,229,238,.85);
  background: rgba(244,247,251,.90);
  backdrop-filter: blur(18px);
}
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 780; letter-spacing: -.02em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(145deg, var(--brand-strong), var(--accent)); box-shadow: var(--shadow-sm);
  font-size: .83rem; letter-spacing: -.04em;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy small { margin-top: 3px; color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .03em; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { content: ""; display: block; width: 19px; height: 2px; margin: 4px auto; background: var(--ink); border-radius: 999px; }
.site-nav ul { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .62rem .78rem; color: var(--muted); font-size: .94rem; font-weight: 650; text-decoration: none; border-radius: 10px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.site-nav .nav-cta { color: #fff; background: var(--brand); }
.site-nav .nav-cta:hover { color: #fff; background: var(--brand-strong); }

.hero { position: relative; overflow: hidden; padding: clamp(72px, 10vw, 128px) 0 86px; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 20%, rgba(48,185,231,.17), transparent 31%),
    radial-gradient(circle at 89% 10%, rgba(13,101,143,.12), transparent 28%),
    linear-gradient(rgba(255,255,255,.76), rgba(244,247,251,.1));
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: center; gap: clamp(44px, 8vw, 96px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--brand-strong); font-size: .82rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { margin: 0; max-width: 900px; font-size: clamp(2.65rem, 6vw, 5.2rem); }
h2 { margin: 0 0 18px; font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { margin: 0 0 9px; font-size: 1.2rem; }
.lead { max-width: 720px; margin: 24px 0 0; color: var(--muted); font-size: clamp(1.07rem, 2vw, 1.3rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: .78rem 1.05rem; border: 1px solid transparent; border-radius: 13px; font-weight: 750; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 10px 26px rgba(13,101,143,.20); }
.button-primary:hover { background: var(--brand-strong); }
.button-secondary { background: var(--surface); border-color: var(--line); }
.button-ghost { padding-inline: 0; color: var(--brand-strong); }

.hero-panel { position: relative; min-height: 420px; border: 1px solid rgba(255,255,255,.75); border-radius: 34px; background: linear-gradient(150deg, #0a2238 0%, #0c587b 62%, #2fb7e4 130%); box-shadow: var(--shadow); overflow: hidden; }
.hero-panel::before { content: ""; position: absolute; inset: -100px -60px auto auto; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; }
.hero-panel::after { content: ""; position: absolute; left: -80px; bottom: -120px; width: 300px; height: 300px; border: 70px solid rgba(255,255,255,.07); border-radius: 50%; }
.panel-content { position: absolute; inset: auto 28px 28px 28px; z-index: 2; color: #fff; }
.panel-label { color: rgba(255,255,255,.72); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.panel-title { margin: 7px 0 14px; font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 780; letter-spacing: -.04em; line-height: 1.08; }
.panel-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-chip { padding: .38rem .62rem; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.09); font-size: .78rem; backdrop-filter: blur(10px); }
.flow-lines { position: absolute; inset: 35px 30px 105px 30px; opacity: .94; }
.flow-lines svg { width: 100%; height: 100%; }

.section { padding: 88px 0; }
.section-tight { padding: 58px 0; }
.section-white { background: var(--surface); }
.section-dark { color: #fff; background: #0a1728; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 480px); gap: 36px; align-items: end; margin-bottom: 34px; }
.section-heading p { margin: 0; color: var(--muted); }
.section-dark .section-heading p { color: #aebccc; }

.grid { display: grid; gap: 20px; }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { position: relative; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 1px 0 rgba(8,38,58,.02); }
.card:hover { box-shadow: var(--shadow-sm); }
.card-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 13px; color: var(--brand-strong); background: var(--accent-soft); font-weight: 850; }
.card p { margin: 0 0 20px; color: var(--muted); }
.card-link { display: inline-flex; align-items: center; gap: 7px; color: var(--brand-strong); font-weight: 780; text-decoration: none; }
.card-link::after { content: "→"; transition: transform .18s ease; }
.card-link:hover::after { transform: translateX(3px); }
.lock-badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 13px; padding: .32rem .56rem; border-radius: 999px; background: #f1f4f7; color: #536274; font-size: .73rem; font-weight: 800; letter-spacing: .025em; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 50px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--line); }
.stat { padding: 24px; background: var(--surface); }
.stat strong { display: block; font-size: 1.55rem; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .9rem; }

.page-hero { padding: 68px 0 48px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, rgba(255,255,255,.1)); }
.page-hero h1 { max-width: 850px; font-size: clamp(2.4rem, 5vw, 4.6rem); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 24px; color: var(--muted); font-size: .86rem; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs span::before { content: "/"; margin-right: 8px; color: #8b98a6; }

.prose { font-size: 1.04rem; }
.prose p { color: #354355; }
.prose h2 { margin-top: 1.7em; font-size: clamp(1.75rem, 3vw, 2.45rem); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: .55rem; }
.callout { margin: 28px 0; padding: 22px 24px; border-left: 4px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--accent-soft); }
.callout p { margin: 0; color: #274052; }

.material-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
.material-toolbar p { margin: 0; color: var(--muted); }
.file-list { display: grid; gap: 12px; }
.file-row { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.file-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.file-icon { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--brand-strong); font-size: .78rem; font-weight: 900; }
.file-title { min-width: 0; }
.file-title strong { display: block; }
.file-title small { display: block; margin-top: 2px; color: var(--muted); }
.file-actions { display: flex; gap: 8px; }
.file-actions a { padding: .56rem .78rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .86rem; font-weight: 750; text-decoration: none; }
.file-actions a:hover { border-color: #b7c8d8; }
.file-actions .disabled { color: #82909e; background: #f3f6f8; pointer-events: none; }
.notice { padding: 18px 20px; border: 1px solid #f0d9a3; border-radius: 14px; background: #fff8e8; color: #664a0c; }
.notice strong { color: #563c00; }

.exam-list { counter-reset: exam; display: grid; gap: 12px; padding: 0; list-style: none; }
.exam-list li { position: relative; padding: 18px 18px 18px 58px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.exam-list li::before { counter-increment: exam; content: counter(exam); position: absolute; left: 17px; top: 17px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--brand-strong); font-size: .8rem; font-weight: 850; }

.site-footer { padding: 46px 0; border-top: 1px solid var(--line); background: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 38px; }
.footer-title { margin: 0 0 10px; font-weight: 800; }
.site-footer p, .site-footer a { color: var(--muted); font-size: .9rem; }
.site-footer a { text-decoration: none; }
.footer-nav { display: grid; gap: 7px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background: radial-gradient(circle at 10% 10%, rgba(48,185,231,.16), transparent 34%), var(--bg); }
.auth-card { width: min(100%, 480px); padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2rem; }
.auth-card p { color: var(--muted); }
.field { display: grid; gap: 7px; margin: 22px 0 14px; }
.field label { font-size: .88rem; font-weight: 750; }
.field input { width: 100%; min-height: 50px; padding: .78rem .9rem; border: 1px solid #bfcbd7; border-radius: 12px; background: #fff; color: var(--ink); outline: none; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(48,185,231,.13); }
.auth-error { padding: .78rem .9rem; border-radius: 10px; background: #fff0f0; color: var(--danger); font-size: .9rem; font-weight: 650; }
.auth-meta { margin-top: 18px; font-size: .8rem; color: #73808d; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { min-height: 340px; }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
  .section-heading { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .container, .narrow { width: min(calc(100% - 28px), var(--max)); }
  .header-inner { min-height: 68px; }
  .brand-copy small { display: none; }
  .nav-toggle { display: block; }
  .site-nav[data-nav] { position: absolute; top: calc(100% + 8px); left: 14px; right: 14px; display: none; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
  .site-nav[data-nav][data-open="true"] { display: block; }
  .site-nav[data-nav] ul { align-items: stretch; flex-direction: column; }
  .site-nav a { padding: .8rem .9rem; }
  .hero { padding-top: 62px; }
  .hero-panel { min-height: 300px; }
  .panel-content { inset: auto 22px 22px 22px; }
  .section { padding: 68px 0; }
  .cards-4, .stats { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 1fr; }
  .file-actions { padding-left: 56px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
}

@media (max-width: 480px) {
  .hero-actions .button { width: 100%; }
  .hero-panel { min-height: 270px; border-radius: 24px; }
  .flow-lines { inset: 24px 18px 100px; }
  .card { padding: 20px; }
  .file-actions { padding-left: 0; flex-direction: column; }
  .file-actions a { text-align: center; }
}

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

/* Geschützte Seiten: Footer am unteren Fensterrand + dezenter Zwischenbereich */
body.protected-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.protected-page main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 16% 72%, rgba(48, 185, 231, .055), transparent 24rem),
    radial-gradient(circle at 84% 88%, rgba(13, 101, 143, .045), transparent 25rem),
    var(--bg);
}

body.protected-page main::after {
  content: "";
  flex: 1 1 auto;
  min-height: clamp(88px, 13vh, 190px);
  border-top: 1px solid rgba(220, 229, 238, .52);
  background:
    radial-gradient(circle at 28% 55%, rgba(48, 185, 231, .065), transparent 18rem),
    radial-gradient(circle at 72% 48%, rgba(13, 101, 143, .05), transparent 20rem),
    linear-gradient(180deg, rgba(244, 247, 251, .28), rgba(244, 247, 251, .88));
}

body.protected-page .site-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

/* Passwort anzeigen / verbergen */
.auth-eyebrow {
  margin-top: 28px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 104px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  min-height: 36px;
  padding: .42rem .7rem;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--brand-strong);
  font-size: .78rem;
  font-weight: 800;
}

.password-toggle:hover {
  background: var(--accent-soft);
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(48, 185, 231, .28);
  outline-offset: 2px;
}

/* Sichtbarer Sitzungs-Countdown */
.session-timer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 154px;
  padding: 10px 13px;
  border: 1px solid rgba(8, 38, 58, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .97);
  color: var(--ink);
  box-shadow: 0 14px 36px rgba(8, 38, 58, .18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-decoration: none;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease;
}

.session-timer:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 101, 143, .25);
  box-shadow: 0 17px 40px rgba(8, 38, 58, .22);
}

.session-timer-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #27a66f;
  box-shadow: 0 0 0 4px rgba(39, 166, 111, .13);
}

.session-timer-copy {
  display: block;
}

.session-timer small,
.session-timer strong {
  display: block;
  line-height: 1.14;
}

.session-timer small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 750;
}

.session-timer strong {
  font-variant-numeric: tabular-nums;
  font-size: .92rem;
  letter-spacing: .025em;
}

.session-timer.is-ending {
  border-color: rgba(212, 139, 23, .35);
}

.session-timer.is-ending .session-timer-dot {
  background: #d48b17;
  box-shadow: 0 0 0 4px rgba(212, 139, 23, .14);
}

@media (max-width: 480px) {
  .session-timer {
    right: 10px;
    bottom: 10px;
    min-width: 140px;
    padding: 9px 11px;
  }

  .password-field input {
    padding-right: 96px;
  }

  .password-toggle {
    right: 6px;
    padding-inline: .6rem;
  }
}
