/* Lotse – Komponenten-Styles. Farben, Abstände und Radien kommen aus tokens.css (Design-System). */
:root {
  --on-primary: #ffffff;
  --tabbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --on-primary: #0a1724; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--signal-red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 1.25; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
a { color: var(--ink); }
.lead { color: var(--ink-muted); }
.caption { font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ink-muted); }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wordmark { font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em; line-height: 0.85; }

/* Layout */
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-tight { display: flex; flex-direction: column; gap: var(--space-2); }
.row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }

.bar { background: var(--brand-navy); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.bar-inner { max-width: 1100px; margin: 0 auto; min-height: 64px; padding: 0 var(--space-4); display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.lockup { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.lockup .wordmark { font-size: 26px; }
.bar-nav { display: none; gap: var(--space-1); }
.bar-nav a { display: flex; align-items: center; height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-md); color: #e8eef3; text-decoration: none; font-size: 15px; }
.bar-nav a[aria-current='page'] { background: var(--brand-navy-raised); color: #fff; font-weight: 700; }

.page { max-width: 640px; margin: 0 auto; padding: var(--space-6) var(--space-4) calc(var(--tabbar-h) + var(--space-10) + env(safe-area-inset-bottom, 0px)); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar.tabs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 500; color: var(--ink-muted); text-decoration: none; }
.tabbar a[aria-current='page'] { color: var(--ink); font-weight: 700; }

@media (min-width: 760px) {
  .bar-nav { display: flex; }
  .tabbar { display: none; }
  .page { padding: var(--space-10) var(--space-6); }
}

/* Karten und Listen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
@media (min-width: 760px) { .card { padding: var(--space-6); } }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.chip { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; border: 1px solid currentColor; border-radius: var(--radius-sm); padding: 1px 8px; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 14px; font-weight: 600; }
.input {
  width: 100%; height: 48px; padding: 0 12px;
  border: 1px solid var(--ink-muted); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.input[readonly] { background: var(--ground); }
.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--brand-navy); }
.check strong { display: block; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 var(--space-4);
  border: 1px solid var(--ink); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-primary { min-height: 52px; border: 0; background: var(--signal-red); color: var(--on-primary); font-size: 16px; font-weight: 700; }
.btn-danger { border-color: var(--warn); color: var(--warn); }
.btn-link { min-height: 44px; padding: 0; border: 0; background: transparent; text-decoration: underline; }
.btn-small { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { border-color: transparent; background: var(--line); color: var(--ink-muted); cursor: not-allowed; }
.btn-link[disabled] { background: transparent; text-decoration: none; }
.btn-block { width: 100%; }

/* Hinweise */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); background: var(--ground); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.notice svg { flex-shrink: 0; margin-top: 1px; }
.notice-title { display: block; font-weight: 700; margin-bottom: 2px; }
.notice-warn .notice-title, .notice-warn svg { color: var(--warn); }
.notice-ok .notice-title, .notice-ok svg { color: var(--on-course); }
.error { color: var(--warn); font-weight: 600; font-size: 14px; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Anmelden: Markenfläche und Formular */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-brand { position: relative; overflow: hidden; background: var(--brand-navy); color: #fff; padding: calc(var(--space-10) + env(safe-area-inset-top, 0px)) var(--space-6) var(--space-10); }
.auth-brand .arcs { position: absolute; right: 0; bottom: 0; width: 260px; height: 260px; }
.auth-brand-inner { position: relative; display: flex; flex-direction: column; gap: 14px; max-width: 440px; }
.auth-brand .wordmark { font-size: 60px; }
.auth-claim { font-size: 18px; font-weight: 500; color: #a9baca; }
.auth-points { display: none; list-style: none; margin: var(--space-4) 0 0; padding: 0; color: #e8eef3; }
.auth-points li + li { margin-top: 10px; }
.auth-form { flex: 1; padding: var(--space-6) var(--space-4) var(--space-10); }
.auth-inner { max-width: 420px; margin: 0 auto; }
@media (min-width: 900px) {
  .auth { flex-direction: row; }
  .auth-brand { flex: 1; display: flex; align-items: center; padding: var(--space-10) 48px; }
  .auth-brand .arcs { width: 420px; height: 420px; }
  .auth-brand .wordmark { font-size: 88px; }
  .auth-points { display: block; }
  .auth-form { flex: 1; display: flex; align-items: center; }
  .auth-inner { width: 100%; }
}
.invite-banner { display: flex; align-items: center; gap: 12px; padding: var(--space-4); border-radius: var(--radius-md); background: var(--brand-navy); color: #fff; }
.invite-banner .caption { color: #a9baca; }
.avatar { width: 44px; height: 44px; flex-shrink: 0; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: var(--brand-navy-raised); color: #fff; font-weight: 700; font-size: 15px; }

/* Kennzahlen (Startseite) */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: 0; }
.stats > div { display: flex; flex-direction: column-reverse; gap: 2px; padding: 12px; border-radius: var(--radius-sm); background: var(--ground); }
.stats dt { font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.stats dd { margin: 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
