:root {
  --primary: #005a5b;
  --primary-hover: #003e3f;
  --primary-light: #e6f2f2;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --bg-page: #f3f4f6;
  --bg-card: #ffffff;
  --border-color: #d1d5db;
  --border-light: #e5e7eb;
  --nav-bg: #1e40af;
  --nav-text: #e5e7eb;
  --nav-hover: #ffffff;
  --nav-active-bg: #007bff;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}

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

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease-in-out;
}

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

.site-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.header-brand h1 {
  margin: 0 0 6px 0;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.header-brand .subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.header-logo img {
  display: block;
  max-height: 65px;
  width: auto;
  object-fit: contain;
}

/* Navigation */
.navbar {
  background-color: var(--nav-bg);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.navbar a {
  color: var(--nav-text);
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 16px;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.15s, color 0.15s;
}

.navbar a:hover {
  color: var(--nav-hover);
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar a.active,
.navbar a[aria-current="page"] {
  color: #ffffff;
  background-color: var(--nav-active-bg);
  font-weight: 600;
}

/* Main Content */
.main-content {
  flex: 1;
}

/* Cards & Layout */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.35rem;
  color: var(--text-main);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
}

.card h3 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--text-main);
}

.card h4 {
  font-size: 1.05rem;
  margin-top: 20px;
  margin-bottom: 8px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Contact List & Info Table */
.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  width: 170px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.info-value {
  flex: 1;
}

/* Feature Lists */
.card-list {
  padding-left: 20px;
  margin: 0 0 16px 0;
}

.card-list li {
  margin-bottom: 10px;
  line-height: 1.55;
}

.badge {
  display: inline-block;
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}

/* Callouts */
.callout {
  background-color: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0;
}

.callout p {
  margin: 0;
}

.callout-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px !important;
}

/* Template Box (for vertrag.html) */
.template-box {
  background-color: #fafbfc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  margin: 20px 0;
  font-family: inherit;
}

.template-header {
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.template-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.placeholder {
  color: #0b69a3;
  font-style: italic;
}

.template-box ol {
  padding-left: 24px;
}

.template-box ol > li {
  margin-bottom: 18px;
}

.template-box ol > li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-main);
}

.signature-line {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 20px 8px 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--primary);
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Verhindert, dass lange Links oder E-Mail-Adressen das Layout sprengen */
a, p, li, span, .info-value {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
}

@media (max-width: 640px) {
  /* Header-Flexbox für mobile Bildschirme korrigieren */
  .site-header {
    flex-direction: column; /* Normaler Fluss von oben nach unten auf dem Handy */
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  /* Verhindert, dass das Logo auf sehr kleinen Displays zu groß bleibt */
  .header-logo img {
    max-width: 100%;
    height: auto;
  }

  /* Navigation: Text zentrieren für leichtere Daumen-Bedienung */
  .navbar a {
    justify-content: center;
  }

  /* Listen-Abstände auf Mobilgeräten für bessere Lesbarkeit leicht vergrößern */
  .info-item {
    padding: 12px 0;
  }
}


/* Print styles */
@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .site-wrapper {
    max-width: 100%;
    padding: 0;
  }

  .navbar {
    display: none;
  }

  .site-header {
    border: none;
    box-shadow: none;
    padding: 0 0 16px 0;
    border-bottom: 2px solid #000000;
  }

  .card, .template-box {
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 20px;
  }
}
