:root {
  --color-bg: #ffffff;
  --color-text: #1f2328;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-primary: #1d4ed8;
  --color-primary-dark: #1e3a8a;
  --color-surface: #f8fafc;
  --alert-error-bg: #fee2e2;
  --alert-error-text: #991b1b;
  --alert-success-bg: #dcfce7;
  --alert-success-text: #166534;
  --max-width: 960px;
  --radius: 8px;
  color-scheme: light;
  font-size: 16px;
}

/* Dunkles Farbschema: greift automatisch nach Systemeinstellung, sofern der
   Umschalter in der Kopfzeile nicht ausdrücklich "hell" gewählt hat. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #14161a;
    --color-text: #e8eaed;
    --color-muted: #9aa0a8;
    --color-border: #2c2f36;
    --color-primary: #6ea8fe;
    --color-primary-dark: #9cc2ff;
    --color-surface: #1c1f26;
    --alert-error-bg: #3a1c1c;
    --alert-error-text: #fca5a5;
    --alert-success-bg: #1a3327;
    --alert-success-text: #86efac;
    color-scheme: dark;
  }
}
/* Manuelle Wahl über den Umschalter überstimmt in beide Richtungen die
   Systemeinstellung. */
:root[data-theme="dark"] {
  --color-bg: #14161a;
  --color-text: #e8eaed;
  --color-muted: #9aa0a8;
  --color-border: #2c2f36;
  --color-primary: #6ea8fe;
  --color-primary-dark: #9cc2ff;
  --color-surface: #1c1f26;
  --alert-error-bg: #3a1c1c;
  --alert-error-text: #fca5a5;
  --alert-success-bg: #1a3327;
  --alert-success-text: #86efac;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

img { max-width: 100%; height: auto; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

h1, h2, h3, h4 { line-height: 1.25; margin-top: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

/* Header / Nav */
.site-header {
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand__logo { height: 40px; width: auto; }

.site-header__nav-group {
  display: flex;
  align-items: center;
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
}
.lang-switch__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-muted);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}
.lang-switch__flag { border-radius: 2px; flex-shrink: 0; }
.lang-switch__item.is-active { color: var(--color-text); background: var(--color-surface); }
.lang-switch__item:hover { color: var(--color-text); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: none;
  color: var(--color-text);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--color-surface); }
.theme-toggle__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: block; }
:root[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon--sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__icon--moon { display: none; }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px; height: 40px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-text);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
}
.main-nav a:hover { color: var(--color-primary); }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
  }
  .main-nav a { display: block; padding: 0.6rem 0; }
}

/* Seiten-Banner (optionales Header-Bild mit Titel) */
.page-banner {
  background-size: cover;
  background-position: center;
  min-height: 427px;
  display: flex;
  align-items: flex-end;
}
.page-banner__overlay {
  width: 100%;
  /* Dunkler Verlauf sorgt unabhängig vom Bildinhalt für genug Kontrast. */
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
  padding: 3rem 0 1.75rem;
}
.page-banner__title {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

/* Hero / Home */
.hero {
  padding: 3.5rem 0;
  background: var(--color-surface);
}
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.25rem); margin-bottom: 1rem; }
.hero__content { font-size: 1.1rem; max-width: 42rem; }

/* Page */
.page { padding: 3rem 0; }
.page--with-banner { padding-top: 2rem; }
.page h1 { font-size: 1.9rem; margin-bottom: 1.25rem; }

.rich-text p { margin: 0 0 1rem; }
.rich-text img { border-radius: var(--radius); margin: 0.5rem 0; }
.rich-text a { text-decoration: underline; }
.rich-text table { border-collapse: collapse; margin: 0 0 1rem; }
.rich-text td, .rich-text th { border: 1px solid var(--color-border); padding: 0.4rem 0.6rem; }
@media (max-width: 600px) {
  .rich-text { overflow-x: auto; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  padding: 1.75rem 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer__links a { color: var(--color-muted); text-decoration: none; }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__credit a { color: var(--color-muted); }

/* Formulare (z.B. Mitglied werden) */
.stack-form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 38rem; }
.stack-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.stack-form input, .stack-form textarea, .stack-form select {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-weight: normal;
  background: var(--color-bg);
  color: var(--color-text);
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.stack-form fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.stack-form fieldset fieldset { border-color: #eef0f2; }
.stack-form legend { font-weight: 700; padding: 0 0.4rem; }
.radio-label, .checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: normal;
}
.radio-label input, .checkbox-label input { margin-top: 0.2rem; }

.fee-info {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.fee-info h2 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.fee-info__list { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0.75rem 0 0; }
.fee-info__list dt { font-weight: 600; }
.fee-info__list dd { margin: 0; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.btn--primary { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); color: #fff; }

.main-nav a.main-nav__cta {
  background: var(--color-primary);
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
}
.main-nav a.main-nav__cta:hover { background: var(--color-primary-dark); color: #fff; }

.alert { padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.92rem; margin: 0 0 1rem; list-style: none; }
.alert--error { background: var(--alert-error-bg); color: var(--alert-error-text); }
.alert--success { background: var(--alert-success-bg); color: var(--alert-success-text); }
