/* ===== Variablen ===== */
:root {
  --c-primary:        #1e6b45;
  --c-primary-dark:   #155234;
  --c-primary-light:  #d6ede1;
  --c-accent:         #e07b2a;
  --c-bg:             #f3f7f3;
  --c-surface:        #ffffff;
  --c-text:           #1a2b1a;
  --c-text-muted:     #5a7060;
  --c-border:         #c5d8c8;
  --c-error:          #c0392b;
  --c-error-bg:       #fdf2f0;
  --c-error-border:   #e8a09a;
  --radius:           6px;
  --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
  --shadow:           0 2px 8px rgba(0,0,0,.10);
  --transition:       .18s ease;
  --max-w:            760px;
}

/* ===== Reset & Basis ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: auto; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--c-primary);
  color: #fff;
  padding: .9rem 0;
  box-shadow: var(--shadow);
}

.site-title-link {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
}
.site-title-link:hover { text-decoration: none; opacity: .9; }

/* ===== Main ===== */
.site-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--c-primary-dark);
  color: #d4e8da;
  padding: 1rem 0;
  font-size: .875rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  align-items: center;
}

.footer-nav a { color: #d4e8da; }
.footer-nav a:hover { color: #fff; }

/* ===== Zurück-Link ===== */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  color: var(--c-text-muted);
}
.back-link:hover { color: var(--c-primary); }

/* ===== Prosa-Blöcke ===== */
.prose { max-width: 100%; }
.prose h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; color: var(--c-primary-dark); }
.prose h2 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 .5rem; color: var(--c-primary-dark); }
.prose h3 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 .4rem; }
.prose p  { margin-bottom: .9rem; }
.prose ul, .prose ol { margin: .5rem 0 .9rem 1.4rem; }
.prose li { margin-bottom: .25rem; }

/* ===== Störungshinweis ===== */
.notice-box {
  background: #fff3cd;
  border: 2px solid #e6a817;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .95rem;
  color: #5a3e00;
  box-shadow: var(--shadow-sm);
}
.notice-box a { color: #5a3e00; text-decoration: underline; }
.notice-box a:hover { color: #3a2700; }

/* ===== Startseite ===== */
body.page-index {
  background-image: url('../../foto_hintergrund.jpg');
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: top center;
}

body.page-index .home-hero {
  background: rgba(30, 107, 69, 0.80);
}

body.page-index .home-section {
  background: rgba(255, 255, 255, 0.82);
}

.home-hero {
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.home-hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: .5rem; }
.home-hero p  { opacity: .9; font-size: 1.05rem; }

.home-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.home-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: .75rem; color: var(--c-primary-dark); }

.btn {
  display: inline-block;
  padding: .7rem 1.6rem;
  background: var(--c-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.btn:hover { background: #c46a22; text-decoration: none; color: #fff; }
.btn:disabled { background: #555; opacity: 1; text-decoration: none; cursor: not-allowed; }
.btn:disabled:hover { background: #555; }
.btn-primary {
  background: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-dark); }

/* ===== Formular-Seite ===== */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-primary-dark);
  margin-bottom: 1.25rem;
}

.info-box {
  background: var(--c-primary-light);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .9rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: .95rem;
  color: var(--c-primary-dark);
}

/* ===== Formular ===== */
.registration-form { margin-top: .5rem; }

/* Honeypot-Feld: visuell versteckt, im DOM vorhanden (Bots füllen es aus) */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

.form-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-primary-dark);
  margin-bottom: 1.5rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--c-primary-light);
}

.form-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-primary-dark);
  margin-bottom: 1.1rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--c-border);
}

.form-section-note {
  font-size: .875rem;
  color: var(--c-text-muted);
  margin-bottom: 1rem;
  background: var(--c-bg);
  padding: .6rem .8rem;
  border-radius: var(--radius);
}

.field-group {
  margin-bottom: 1rem;
}

.field-group label {
  display: block;
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: .3rem;
  color: var(--c-text);
}

.required {
  color: var(--c-error);
  margin-left: .2em;
  font-weight: 700;
}

.field-group input[type="text"],
.field-group input[type="date"],
.field-group textarea {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(30,107,69,.12);
}

.field-group input.has-error,
.field-group textarea.has-error {
  border-color: var(--c-error);
  background: var(--c-error-bg);
}
.field-group input.has-error:focus,
.field-group textarea.has-error:focus {
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}

.field-error-msg {
  display: block;
  margin-top: .3rem;
  font-size: .83rem;
  color: var(--c-error);
}

/* Checkboxen */
.checkbox-group {
  margin-bottom: .85rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  cursor: pointer;
  font-size: .95rem;
}

.checkbox-label input[type="checkbox"] {
  margin-top: .2rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: var(--c-primary);
  cursor: pointer;
}

.checkbox-label.has-error { color: var(--c-error); }

.checkbox-sub-field {
  margin-top: .5rem;
  margin-left: 1.6rem;
}

.checkbox-sub-field textarea {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.checkbox-sub-field textarea:disabled {
  background: #f0f0f0;
  color: #aaa;
  border-color: #ddd;
  cursor: not-allowed;
}

.checkbox-sub-field textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(30,107,69,.12);
}

.checkbox-sub-field textarea.has-error {
  border-color: var(--c-error);
  background: var(--c-error-bg);
}

/* Submit-Bereich */
.form-submit-area {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}

.form-submit-area .submit-error-msg {
  flex-basis: 100%;
}

.btn-submit {
  padding: .8rem 2rem;
  font-size: 1.05rem;
  background: var(--c-primary);
}
.btn-submit:hover { background: var(--c-primary-dark); }
.btn-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn-cancel {
  padding: .8rem 1.6rem;
  font-size: 1.05rem;
  background: transparent;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}
.btn-cancel:hover {
  background: var(--c-bg);
  color: var(--c-text);
  border-color: var(--c-text-muted);
  text-decoration: none;
}

.submit-error-msg {
  font-size: .875rem;
  color: var(--c-error);
  display: none;
}
.submit-error-msg.visible { display: block; }

/* Einwilligung */
.consent-intro {
  font-size: .9rem;
  margin-bottom: .75rem;
}
.consent-revoke {
  font-size: 1rem;
  color: var(--c-text-muted);
  margin-top: .5rem;
  font-style: italic;
}

/* ===== Bestätigungs-Seiten ===== */
.status-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.status-card.success { border-left: 4px solid var(--c-primary); }
.status-card.error   { border-left: 4px solid var(--c-error); }

.status-card h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: .5rem; }
.status-card.success h2 { color: var(--c-primary-dark); }
.status-card.error h2   { color: var(--c-error); }

/* ===== Impressum / Datenschutz ===== */
.legal-content {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm);
}

/* ===== Lade-Indikator ===== */
.btn-submit.loading::after {
  content: '';
  display: inline-block;
  width: .9em;
  height: .9em;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: .6rem;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Admin-Seite ===== */
body.page-admin .container {
  max-width: 100%;
}

.admin-table {
  border-collapse: collapse;
  font-size: .8rem;
  background: var(--c-surface);
  white-space: nowrap;
}

.admin-table th {
  background: var(--c-primary);
  color: #fff;
  padding: .45rem .6rem;
  text-align: left;
  font-weight: 600;
}

.admin-table th a {
  color: #fff;
  text-decoration: none;
  display: block;
}
.admin-table th a:hover { text-decoration: underline; }

.admin-table td {
  padding: .35rem .6rem;
  border-bottom: 1px solid var(--c-border);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.admin-table tbody tr:nth-child(even) { background: var(--c-bg); }
.admin-table tbody tr:hover { background: var(--c-primary-light); }

.badge-ja {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 3px;
  background: var(--c-primary-light);
  color: var(--c-primary-dark);
  font-size: .75rem;
  font-weight: 600;
}
.badge-nein {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 3px;
  background: #eee;
  color: #999;
  font-size: .75rem;
}

/* ===== Responsive ===== */
@media (max-width: 500px) {
  .home-hero { padding: 1.75rem 1.25rem; }
  .home-hero h1 { font-size: 1.5rem; }
  .form-section { padding: 1.1rem; }
}
