/* SBF Easy – clean black & white */
:root {
  --ink: #0a0a0a;
  --ink-2: #262626;
  --muted: #737373;
  --line: #e7e7e7;
  --soft: #f5f5f5;
  --bg: #ffffff;
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; }
.sm-only { display: none; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.main { flex: 1; padding-top: 32px; padding-bottom: 64px; }

/* Topbar */
.topbar { padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.03em; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 18px; }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav a { text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 14px; border-radius: 999px; color: var(--muted); transition: background .15s, color .15s; }
.topnav a:hover { color: var(--ink); background: var(--soft); }
.topnav a.active { color: #fff; background: var(--ink); }
.btn-ghost-sm { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); background: none; border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; cursor: pointer; margin-left: 8px; }
.btn-ghost-sm:hover { color: var(--ink); border-color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px;
  color: #fff; background: var(--ink);
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 13px 24px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .15s, opacity .15s;
}
.btn:hover { background: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn:focus:not(:focus-visible), .answer:focus:not(:focus-visible), .dot:focus:not(:focus-visible) { outline: none; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 16px 34px; font-size: 16px; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: var(--soft); border-color: var(--ink); }
.link-btn { font: inherit; font-size: 14px; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-top: 16px; }
.link-btn:hover { color: var(--bad); }
.back { display: inline-block; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.back:hover { color: var(--ink); }

/* Hero */
.hero { text-align: center; padding: 48px 0 56px; max-width: 720px; margin: 0 auto; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); margin-bottom: 28px; }
.hero-title { font-size: clamp(30px, 8.6vw, 68px); overflow-wrap: break-word; hyphens: manual; font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; }
.hero-title .muted { color: #a3a3a3; }
.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--muted); margin: 24px auto 40px; max-width: 560px; }
.login-card { max-width: 520px; margin: 0 auto; }
.login-row { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.login-row:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.login-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; border: 0; outline: 0; background: transparent; padding: 10px 18px; color: var(--ink); }
.hint { font-size: 14px; color: var(--muted); margin-top: 14px; }
.form-error { font-size: 14px; color: var(--bad); margin-top: 12px; font-weight: 500; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.feature-num { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 18px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15px; }

/* Center card */
.center-card { max-width: 460px; margin: 48px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.center-card .btn { margin-top: 12px; }
.icon-circle { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 700; margin-bottom: 10px; }
.badge .ico { width: 13px; height: 13px; margin-right: 4px; }

/* Page head */
.page-head { margin-bottom: 28px; }
.page-head p { margin-top: 8px; }

/* Dashboard */
.exam-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.exam-card { position: relative; display: flex; flex-direction: column; gap: 28px; text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; background: #fff; transition: border-color .15s, transform .15s, box-shadow .15s; }
.exam-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.exam-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.exam-card-top p { margin-top: 4px; }
.exam-card-meta { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.exam-card-meta strong { color: var(--ink); }
.exam-card-arrow { position: absolute; right: 26px; bottom: 22px; font-size: 20px; transition: transform .15s; }
.exam-card:hover .exam-card-arrow { transform: translateX(4px); }

.ring { --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none; background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--soft) 0); display: grid; place-items: center; }
.ring span { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }

/* Banner */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-radius: var(--r); background: var(--soft); text-decoration: none; margin-bottom: 20px; border: 1px solid var(--line); }
.banner > div { display: flex; flex-direction: column; gap: 2px; }
.banner:hover { border-color: var(--ink); }

/* Sheets */
.sheet-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.sheet-card { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #fff; transition: border-color .15s; }
.sheet-card:hover { border-color: #bdbdbd; }
.sheet-card.is-passed { border-color: var(--ink); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-no { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.sheet-actions { display: flex; gap: 8px; margin-top: 2px; }
.sheet-actions .btn { flex: 1; }

.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); white-space: nowrap; }
.badge-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge-light { background: #fff; color: var(--muted); }

.bar { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width .35s ease; }
.bar-lg { height: 8px; }

.info-box { margin-top: 40px; padding: 26px; border-radius: var(--r-lg); background: var(--soft); }
.info-box h3 { margin-bottom: 8px; }

/* Quiz */
.quiz { max-width: 760px; margin: 0 auto; }
.quiz-head { margin-bottom: 26px; }
.quiz-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.quiz-title-row h1 { font-size: clamp(24px, 3.5vw, 32px); }

.dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.dot { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 0; transition: all .12s; }
.dot:hover { border-color: var(--ink); color: var(--ink); }
.dot.answered { background: var(--soft); color: var(--ink); }
.dot.current { border-color: var(--ink); background: var(--ink); color: #fff; }
.dot.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.dot.bad { background: var(--bad); border-color: var(--bad); color: #fff; }

.q-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 4vw, 34px); background: #fff; box-shadow: var(--shadow); animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.q-meta { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.q-text { font-size: clamp(18px, 2.4vw, 21px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.4; }
.q-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.q-images img { background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; max-height: 220px; min-height: 44px; width: auto; max-width: 100%; object-fit: contain; }

.answers { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.answer {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left;
  font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r);
  padding: 15px 16px; cursor: pointer; transition: border-color .12s, background .12s, transform .1s;
}
.answer:hover:not(:disabled) { border-color: var(--ink); }
.answer:active:not(:disabled) { transform: scale(.995); }
.answer:disabled { cursor: default; }
.answer .key { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--soft); font-size: 13px; font-weight: 700; text-transform: uppercase; transition: all .12s; }
.answer .a-body { flex: 1; padding-top: 2px; }
.answer .a-body img { display: block; margin-top: 8px; max-height: 120px; width: auto; }
.answer.selected { border-color: var(--ink); background: var(--soft); }
.answer.selected .key { background: var(--ink); color: #fff; }
.answer.correct { border-color: var(--ok); background: var(--ok-soft); }
.answer.correct .key { background: var(--ok); color: #fff; }
.answer.wrong { border-color: var(--bad); background: var(--bad-soft); }
.answer.wrong .key { background: var(--bad); color: #fff; }
.answer.dim { opacity: .5; }

.q-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.q-feedback { font-weight: 600; font-size: 15px; white-space: nowrap; }
.q-feedback.ok { color: var(--ok); }
.q-feedback.bad { color: var(--bad); }
.kbd-hint { font-size: 13px; color: #a3a3a3; text-align: center; margin-top: 18px; }

/* Result */
.result { text-align: center; padding: clamp(28px, 5vw, 44px) 24px; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .3s ease; }
.result.passed { background: var(--ink); color: #fff; border-color: var(--ink); }
.result.passed .muted { color: #a3a3a3; }
.result-score { font-size: clamp(56px, 10vw, 84px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; margin: 10px 0 6px; }
.result-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.result-split { display: flex; justify-content: center; gap: 12px; margin: 26px 0 30px; flex-wrap: wrap; }
.result-split > div { padding: 12px 18px; border-radius: var(--r); background: var(--soft); flex: 1 1 150px; max-width: 200px; }
.result.passed .result-split > div { background: #1f1f1f; }
.result-split strong { display: block; font-size: 22px; letter-spacing: -0.03em; }
.result-split span { font-size: 13px; }
.result-split .fail strong { color: var(--bad); }
.result.passed .btn { background: #fff; color: var(--ink); border-color: #fff; }
.result.passed .btn-outline { background: transparent; color: #fff; border-color: #444; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.review { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; }
.review h2 { margin-bottom: 4px; }
.review-item { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.review-item.bad { border-color: #fecaca; }
.review-item .q-text { font-size: 16px; }
.review-ans { font-size: 15px; margin-top: 10px; display: flex; gap: 8px; }
.review-ans.ok { color: var(--ok); }
.review-ans.bad { color: var(--bad); }

/* Prose */
.prose { max-width: 680px; }
.prose h1 { margin-bottom: 24px; }
.prose h2 { font-size: 18px; margin: 28px 0 8px; }
.prose p { color: var(--ink-2); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 24px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .exam-grid, .features { grid-template-columns: 1fr; }
}
/* Konto & Rechtliches */
.legal-hint { font-size: 12.5px; margin-top: 6px; color: #a3a3a3; }
.legal-hint a { color: var(--muted); }
a.btn-ghost-sm { text-decoration: none; }
.btn-ghost-sm.active { color: var(--ink); border-color: var(--ink); }
.account-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.account-grid .info-box { margin-top: 0; display: flex; flex-direction: column; gap: 10px; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.danger-box { background: #fff; border: 1px solid #fecaca; }
.delete-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.delete-form input { font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); outline: 0; }
.delete-form input:focus { border-color: var(--bad); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #b91c1c; }
.prose ul { padding-left: 20px; color: var(--ink-2); }
.prose li { margin: 4px 0; }
.prose p + p { margin-top: 10px; }
.prose code { font-size: 14px; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.footer-links { flex-wrap: wrap; }
@media (max-width: 860px) { .account-grid { grid-template-columns: 1fr; } }

/* Login-Code */
.code-form { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.code-form input { font: inherit; font-size: 30px; font-weight: 800; letter-spacing: .35em; text-align: center; padding: 14px 10px 14px calc(10px + .35em); border: 1.5px solid var(--line); border-radius: var(--r); outline: 0; width: 100%; font-variant-numeric: tabular-nums; }
.code-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.code-form input::placeholder { color: #d4d4d4; }

/* Tab-Bar (nur Smartphone) */
.tabbar { display: none; }

@media (max-width: 560px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .main { padding-top: 22px; padding-bottom: 40px; }
  .topbar-inner { height: 56px; }
  .topnav { display: none; }
  .btn-ghost-sm { padding: 8px; border: 0; font-size: 22px; margin: 0 -8px 0 0; }
  .btn-ghost-sm.active { color: var(--ink); }
  .account-actions .btn, .account-actions form, .account-actions form .btn { flex: 1; width: 100%; }
  .lg-only { display: none; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255,255,255,.97);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; text-decoration: none; color: #a3a3a3; font-size: 10.5px; font-weight: 600; border-radius: 12px; }
  .tabbar a .ico { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--ink); }
  body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

  .hero { padding: 20px 0 36px; }
  .hero-sub { margin: 18px auto 28px; }
  .pill { margin-bottom: 20px; }
  .login-row { flex-direction: column; border-radius: var(--r); padding: 8px; }
  .login-row input { padding: 12px; text-align: center; }
  .login-row .btn { width: 100%; }
  .feature { padding: 22px; }

  .exam-card { padding: 20px; gap: 18px; border-radius: var(--r); }
  .banner { flex-direction: column; align-items: stretch; }
  .banner .btn { width: 100%; }

  /* Bögen als kompakte Liste */
  .sheet-grid { grid-template-columns: 1fr; gap: 10px; }
  .sheet-card {
    display: grid; grid-template-columns: 40px 1fr auto;
    grid-template-areas: "no badge actions" "no bar actions" "no meta actions";
    column-gap: 12px; row-gap: 6px; align-items: center; padding: 14px;
  }
  .sheet-head { display: contents; }
  .sheet-no { grid-area: no; font-size: 26px; text-align: center; }
  .sheet-card .badge { grid-area: badge; justify-self: start; font-size: 11px; padding: 3px 8px; }
  .sheet-card .bar { grid-area: bar; }
  .sheet-meta { grid-area: meta; font-size: 12.5px; }
  .sheet-actions { grid-area: actions; flex-direction: column; gap: 6px; margin: 0; }
  .sheet-actions .btn { padding: 8px 14px; font-size: 13px; min-width: 86px; }
  .info-box { padding: 20px; border-radius: var(--r); }

  /* Quiz */
  .quiz-head { margin-bottom: 18px; }
  .quiz-title-row { margin-bottom: 12px; }
  .dots { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 12px -16px 0; padding: 2px 16px 4px; scroll-padding: 0 16px; }
  .dots::-webkit-scrollbar { display: none; }
  .dot { flex: none; width: 34px; height: 34px; }
  .q-card { padding: 20px 16px; border-radius: var(--r); box-shadow: none; }
  .answers { margin-top: 20px; }
  .answer { padding: 14px 12px; min-height: 52px; }
  .q-footer { position: sticky; bottom: 0; background: #fff; margin: 16px -16px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
  .q-footer .btn { flex: 1; }
  .q-nav { flex: 1; display: flex; justify-content: flex-end; }
  .q-nav > div { width: 100%; }
  .result-split > div { padding: 10px 12px; }
  .review-item { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Touch-Geräte: keine klebenden Hover-Zustände, dafür Tap-Feedback */
@media (hover: none) {
  .topnav a:hover { color: var(--muted); background: none; }
  .btn:hover { background: var(--ink); }
  .btn-outline:hover { background: #fff; border-color: var(--line); }
  .exam-card:hover { border-color: var(--line); transform: none; box-shadow: none; }
  .exam-card:active { transform: scale(.985); }
  .exam-card:hover .exam-card-arrow { transform: none; }
  .sheet-card:hover, .banner:hover { border-color: var(--line); }
  .sheet-card.is-passed:hover { border-color: var(--ink); }
  .answer:hover:not(:disabled) { border-color: var(--line); }
  .answer.selected:hover { border-color: var(--ink); }
  .answer:active:not(:disabled) { background: var(--soft); }
  .dot:hover { border-color: var(--line); color: var(--muted); }
  .dot.current:hover { border-color: var(--ink); color: #fff; }
  .kbd-hint { display: none; }
}
