:root {
  --r4g-blue: #235385;
  --r4g-red: #cc412f;
  --bg: #f5f5f7;
  --text: #111;
  --muted: #555;
  --radius-lg: 18px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 80px;
}

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

/* WICHTIG: Kein horizontales Scrollen */
html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Medien nie breiter als Container */
img,
video,
iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Default: mobile-first */
.mobile-only {
  display: inline-flex;
}

.desktop-only {
  display: none;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #0f172a;
  color: #e5e7eb;
  padding: 0.75rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 4px 0 18px rgba(0, 0, 0, 0.35);
  z-index: 20;
  transform: translateX(-100%);
  transition: transform 0.25s ease, width 0.25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.25rem 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.logo-text-main {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e5e7eb;
}

.sidebar-toggle {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Desktop-Toggle seitlich raus */
.sidebar-toggle.desktop-only {
  position: absolute;
  top: 50%;
  right: -16px;
  transform: translateY(-50%);
  background: #0f172a;
  border: 2px solid #e5e7eb;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.sidebar-toggle.desktop-only:hover {
  background: #111827;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem;
  border-radius: 999px;
  text-decoration: none;
  color: #e5e7eb;
  font-size: 0.9rem;
  transition: background 0.15s ease, transform 0.1s ease;
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.18);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--r4g-blue), var(--r4g-red));
  color: #fff;
}

.nav-icon {
  font-size: 1.1rem;
  width: 1.4rem;
  text-align: center;
}

.nav-label {
  white-space: nowrap;
}

.nav-separator {
  margin: 0.4rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
}

/* === SIDEBAR SUBMENU === */
.nav-item.has-submenu {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: 18px;
}

.nav-item.has-submenu:hover {
  transform: none;
  background: rgba(148, 163, 184, 0.18);
}

.submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  color: #e5e7eb;
  font-size: 0.9rem;
  padding: 0.45rem 0.5rem;
  gap: 0.65rem;
  text-align: left;
}

.submenu-caret {
  font-size: 0.7rem;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.has-submenu .submenu {
  display: none;
  flex-direction: column;
  padding: 0.2rem 0.25rem 0.4rem 2.2rem;
}

.has-submenu.open .submenu {
  display: flex;
}

.has-submenu.open .submenu-caret {
  transform: rotate(180deg);
}

.sub-item {
  color: #d1d5db;
  font-size: 0.85rem;
  padding: 0.3rem 0.25rem;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: all 0.15s ease;
  text-align: left;
}

.sub-item:hover {
  color: #ffffff;
  border-left-color: var(--r4g-blue);
}

.sub-item.active {
  color: #ffffff;
  border-left-color: var(--r4g-blue);
  font-weight: 600;
}

/* ===================== MAIN WRAPPER & TOPBAR ===================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 0;
  transition: margin-left 0.25s ease;
  width: 100%;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent; /* kein Balken */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, .2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.8rem;
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #374151;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

/* Inhalt */
.site-main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

/* === Social Media Icons im Header === */

.social-links {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: auto;
}

.social-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.social-icon svg {
  width: 100%;
  height: 100%;
  fill: #374151;
  transition: fill 0.2s ease;
}

.social-icon:hover svg {
  fill: var(--r4g-blue);
  transform: scale(1.1);
}

.social-icon.instagram:hover svg {
  fill: #E1306C;
}

.social-icon.youtube:hover svg {
  fill: #FF0000;
}

.social-icon.facebook:hover svg {
  fill: #1877F2;
}

@media (max-width: 799px) {
  .social-links {
    margin-top: 0.3rem;
  }
}

/* ===================== HERO ===================== */
.hero {
  background: linear-gradient(135deg, #e5f0ff, #ffeceb);
  border-radius: 26px;
  padding: 1.8rem 1.5rem;
  margin-top: 1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* === HERO LOGO – Glow nur beim Hover === */
.hero-left {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo {
  position: relative;
  border-radius: 50%;
  padding: 0.9rem;
  background: transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-logo::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(35, 83, 133, 0.0),
    rgba(204, 65, 47, 0.0),
    rgba(35, 83, 133, 0.0)
  );
  opacity: 0;
  z-index: -1;
  filter: blur(3px);
  transition: opacity 0.4s ease, background 0.3s ease;
}

.hero-logo:hover::before {
  opacity: 0.9;
  background: conic-gradient(
    from 0deg,
    rgba(35, 83, 133, 0.75),
    rgba(204, 65, 47, 0.75),
    rgba(35, 83, 133, 0.75)
  );
}

.hero-logo:hover {
  transform: scale(1.04);
}

.hero-logo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.15);
  background: #fff;
}

/* Rechte Seite */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.hero-kicker-pill {
  align-self: flex-start;
  background: #ffffff;
  border-radius: 999px;
  padding: 0.25rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid #e5e7eb;
}

.hero-title {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.3;
  color: #111827;
}

.hero-title span {
  color: var(--r4g-blue);
}

.hero-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

/* HERO-STATS */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 1rem;
}

.hero-stat-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 0.9rem 0.6rem;
  border: 1px solid #d1d5db;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.hero-stat-value {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--r4g-blue);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* HERO BUTTONS */
.hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--r4g-blue), var(--r4g-red));
  color: #fff;
}

.btn.ghost {
  background: transparent;
  color: var(--r4g-blue);
  border: 1px solid var(--r4g-blue);
}

/* INFO-BOXEN */
.info-boxes {
  margin-top: 2rem;
}

.info-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.info-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.info-card h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--r4g-blue);
}

.info-card p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* FOOTER */
.site-footer {
  border-top: 1px solid #ddd;
  background: #ffffff;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.footer-brand img {
  max-width: 220px;
  height: auto;
}

.footer-claim {
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.footer-bottom {
  border-top: 1px solid #e5e7eb;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  background: #f9fafb;
}

/* OVERLAY */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
}

body.sidebar-mobile-open .sidebar-overlay {
  opacity: 1;
  pointer-events: all;
}

/* ===================== MOBILE (<= 799px) ===================== */
@media (max-width: 799px) {
  body {
    overflow-x: hidden;
  }

  body.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .desktop-only {
    display: none !important;
  }

  .hero-logo img {
    width: 180px;
    height: 180px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
  }

  .topbar-ticker {
    width: 100%;
  }
}

/* ===================== DESKTOP (>= 800px) ===================== */
@media (min-width: 800px) {
  .sidebar {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: var(--sidebar-width);
  }

  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: inline-flex !important;
  }

  body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
  }

  body.sidebar-collapsed .logo-text-main {
    display: none;
  }

  body.sidebar-collapsed .nav-label {
    display: none;
  }

  body.sidebar-collapsed .nav-item {
    justify-content: center;
  }

  body.sidebar-collapsed .has-submenu .submenu {
    display: none !important;
  }

  body.sidebar-collapsed .sidebar-toggle.desktop-only {
    transform: translateY(-50%) rotate(180deg);
  }

  .hero-inner {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
  }

  .hero-left {
    flex: 0 0 320px;
    justify-content: flex-start;
  }

  .hero-logo img {
    width: 240px;
    height: 240px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .footer-contact {
    align-items: flex-end;
  }
}

/* === MODERN LOGIN DESIGN (für member.php) === */

.auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(35, 83, 133, 0.08), rgba(204, 65, 47, 0.05));
}

.auth-container {
  max-width: 420px;
  width: 100%;
}

.auth-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 22px;
  padding: 2rem 1.8rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 0.5rem;
}

.auth-header h2 {
  margin: 0;
  color: var(--r4g-blue);
  font-size: 1.4rem;
}

.auth-header p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.3rem 0 0;
}

/* Input Styles */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-row label {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.25rem;
}

.input-icon {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.45rem 0.8rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-icon span {
  font-size: 1rem;
  margin-right: 0.5rem;
  color: #6b7280;
}

.input-icon input {
  border: none;
  outline: none;
  flex: 1;
  background: transparent;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  color: #111827;
}

.input-icon:focus-within {
  border-color: var(--r4g-blue);
  box-shadow: 0 0 0 2px rgba(35, 83, 133, 0.15);
}

/* Login Button */

.btn-login {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--r4g-blue), var(--r4g-red));
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(35, 83, 133, 0.25);
}

/* Fehleranzeigen */

.form-errors {
  margin-bottom: 0.75rem;
}

.form-error-item {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  text-align: center;
}

/* Responsive Login */

@media (max-width: 500px) {
  .auth-card {
    padding: 1.5rem;
  }
}

/* Passwort Toggle */

.password-toggle-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 0.7rem;
  background: none;
  border: none;
  color: #6b7280;
  font-size: 1.1rem;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.toggle-password:hover {
  color: var(--r4g-blue);
  transform: scale(1.1);
}

/* --- Ticker rechts --- */
.topbar-ticker {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

/* --- Lauftext ohne Hintergrund --- */
.site-ticker {
  background: none;
  border: none;
  overflow: hidden;
}

.site-ticker-list {
  display: inline-flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: ticker-scroll 35s linear infinite;
}

.site-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  color: var(--r4g-blue, #235385);
}

.site-ticker-link {
  color: inherit;
  text-decoration: none;
}

.site-ticker:hover .site-ticker-list { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}