/* Grundlayout: mobil zuerst, Breakpoints 640 px und 1024 px */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  text-align: left;
  overflow-x: hidden;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text-stark);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }

p {
  margin: 0 0 1rem;
  max-width: 65ch;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--cognac);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.gedaempft {
  color: var(--text-gedaempft);
  font-size: 0.875rem;
}

:focus-visible {
  outline: 3px solid var(--cognac);
  outline-offset: 2px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.button--primaer {
  background: var(--aktion);
  color: var(--aktion-text);
  border: 2px solid var(--aktion);
}

.button--sekundaer {
  background: transparent;
  color: var(--text-stark);
  border: 2px solid var(--kontur);
}

.button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* App-Rahmen */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 16px;
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.kopf h1 {
  margin: 0;
  font-size: 1.5rem;
}

.inhalt {
  flex: 1;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 1rem 16px 6rem;
}

.karte {
  background: var(--flaeche);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.karte h2 {
  margin-bottom: 0.25rem;
}

.karte p:last-child {
  margin-bottom: 0;
}

/* Untere Tab-Leiste */

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--flaeche);
  padding-bottom: env(safe-area-inset-bottom);
  margin: 0;
  list-style: none;
}

.tabs a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-height: 56px;
  padding: 0.375rem 0.25rem;
  color: var(--text-stark);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border-top: 3px solid transparent;
}

.tabs a[aria-current="page"] {
  border-top-color: var(--cognac);
}

.tabs svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Login */

.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 16px;
  background: var(--nachtblau);
  color: var(--creme);
}

.login__box {
  width: 100%;
  max-width: 360px;
}

.login h1 {
  color: var(--creme);
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.login__linie {
  width: 48px;
  height: 3px;
  background: var(--cognac);
  border: 0;
  margin: 0 0 2rem;
}

.login label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.login input {
  width: 100%;
  min-height: 48px;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  border: 2px solid var(--stahlgrau);
  background: var(--tiefblau);
  color: var(--creme);
  font-family: var(--font-sans);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.login input:focus-visible {
  border-color: var(--cognac);
}

.login .button {
  width: 100%;
}

.login__fehler {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: var(--creme);
}

/* Breakpoints */

@media (min-width: 640px) {
  .kopf,
  .inhalt {
    padding-left: 24px;
    padding-right: 24px;
  }

  h1 { font-size: 2rem; }
}

@media (min-width: 1024px) {
  .tabs {
    position: sticky;
    top: 0;
    order: -1;
    max-width: 640px;
    margin: 0 auto;
    background: transparent;
  }

  .tabs a {
    flex-direction: row;
    gap: 0.5rem;
    font-size: 0.9375rem;
    border-top: 0;
    border-bottom: 3px solid transparent;
  }

  .tabs a[aria-current="page"] {
    border-bottom-color: var(--cognac);
  }

  .inhalt {
    padding-bottom: 2rem;
  }
}
