/* ============================================================
   Newsletter – Grundgestaltung (angelehnt an die Veranstaltungsanmeldung)
   ============================================================ */
@font-face {
  font-family: 'Playfair Display';
  src: url('PlayfairDisplay-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary:    #f4f3f0;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-input:      #edece8;
  --bg-overlay:    rgba(244,243,240,0.88);

  --text-primary:  #1a1918;
  --text-secondary:#44403c;
  --text-muted:    #6b655f;

  --border:        #ddd9d4;
  --border-focus:  #525252;

  --accent-1:      #525252;
  --accent-2:      #404040;
  --accent-light:  rgba(82,82,82,.1);
  --accent-lighter:rgba(82,82,82,.05);

  --success:       #15803d;
  --success-bg:    #dcfce7;
  --error:         #b91c1c;
  --error-bg:      #fee2e2;
  --warning:       #92400e;
  --warning-bg:    #fef3c7;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.07);
  --shadow-md:     0 4px 16px rgba(0,0,0,.09);

  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-full:   9999px;

  --transition:    0.2s ease;
  --font-heading:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:     ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-primary:    #181716;
  --bg-secondary:  #1f1e1d;
  --bg-card:       #242321;
  --bg-input:      #2a2927;
  --bg-overlay:    rgba(24,23,22,0.92);
  --text-primary:  #fafaf9;
  --text-secondary:#d6d3d1;
  --text-muted:    #a8a29e;
  --border:        #3a3835;
  --border-focus:  #a8a29e;
  --accent-1:      #a8a29e;
  --accent-2:      #d6d3d1;
  --accent-light:  rgba(168,162,158,.14);
  --accent-lighter:rgba(168,162,158,.07);
  --success:       #4ade80;
  --success-bg:    rgba(74,222,128,.12);
  --error:         #f87171;
  --error-bg:      rgba(248,113,113,.12);
  --warning:       #fbbf24;
  --warning-bg:    rgba(251,191,36,.12);
  --shadow-sm:     0 1px 3px rgba(0,0,0,.4);
  --shadow-md:     0 4px 16px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* Ohne JavaScript: Systemeinstellung übernehmen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-primary:    #181716;
    --bg-secondary:  #1f1e1d;
    --bg-card:       #242321;
    --bg-input:      #2a2927;
    --bg-overlay:    rgba(24,23,22,0.92);
    --text-primary:  #fafaf9;
    --text-secondary:#d6d3d1;
    --text-muted:    #a8a29e;
    --border:        #3a3835;
    --border-focus:  #a8a29e;
    --accent-1:      #a8a29e;
    --accent-2:      #d6d3d1;
    --accent-light:  rgba(168,162,158,.14);
    --accent-lighter:rgba(168,162,158,.07);
    --success:       #4ade80;
    --success-bg:    rgba(74,222,128,.12);
    --error:         #f87171;
    --error-bg:      rgba(248,113,113,.12);
    --warning:       #fbbf24;
    --warning-bg:    rgba(251,191,36,.12);
    --shadow-sm:     0 1px 3px rgba(0,0,0,.4);
    --shadow-md:     0 4px 16px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

@media (prefers-contrast: more) {
  :root { --border: #000; --text-muted: #333; }
  [data-theme="dark"] { --border: #fff; --text-muted: #ddd; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================ Basis */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--text-primary); text-underline-offset: 2px; }
a:hover { color: var(--accent-1); }
img, svg { max-width: 100%; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--bg-input); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
strong { font-weight: 650; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 8px; background: var(--accent-1); color: #fff; padding: 8px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; z-index: 1000; }
.skip-link:focus { top: 8px; color: #fff; }
:focus-visible { outline: 3px solid var(--accent-1); outline-offset: 3px; border-radius: 4px; }

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.text-error { color: var(--error); }

/* Honigtopf für Bots: unsichtbar, aber nicht display:none */
.hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ============================================================ Kopf */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}
.header-inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.site-logo { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: var(--text-primary); text-decoration: none; letter-spacing: -.02em; line-height: 1.25; }
.header-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-icon {
  width: 42px; height: 42px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; transition: border-color var(--transition), background var(--transition);
}
.btn-icon:hover { border-color: var(--accent-1); background: var(--accent-light); }
.theme-toggle { display: none; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================================ Layout */
.app-wrapper { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px 64px; flex: 1; }

.hero { text-align: center; padding: 44px 0 28px; }
.hero-tag {
  display: inline-block; background: var(--accent-light); color: var(--accent-1);
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--radius-full); margin-bottom: 16px;
}
.hero h1 { font-family: var(--font-heading); font-size: clamp(28px, 6vw, 40px); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 14px; }
.hero-text { color: var(--text-secondary); font-size: 17px; max-width: 560px; margin: 0 auto; }
.hero-text p + p { margin-top: 10px; }
.hero-text h2, .hero-text h3 { font-family: var(--font-heading); margin: 12px 0 6px; }
.hero-text ul { text-align: left; display: inline-block; margin: 6px 0 0 20px; }

.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 28px; margin-bottom: 20px;
}
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.card-title { font-family: var(--font-heading); font-size: 24px; font-weight: 700; margin-bottom: 14px; letter-spacing: -.01em; }
.card > p + p { margin-top: 10px; }
.card > p.muted { margin-bottom: 14px; }
.danger-zone .checkbox-label { margin-top: 12px; }
.narrow { margin-top: 40px; }
.form-card { margin-top: 4px; }

@media (max-width: 480px) {
  .card { padding: 20px 18px; border-radius: var(--radius-md); }
  .hero { padding: 32px 0 20px; }
  .site-logo { font-size: 16px; }
  .header-inner { gap: 8px; }
  .header-controls { gap: 6px; }
  .header-controls .btn-sm { padding: 8px 11px; font-size: 12.5px; }
  .btn-icon { width: 38px; height: 38px; font-size: 16px; }
}

/* ============================================================ Formulare */
fieldset { border: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.topics { margin-bottom: 22px; }
.topic-option {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-secondary); margin-bottom: 10px;
  transition: border-color var(--transition), background var(--transition);
}
/* Anmeldeformular: zwei Spalten, auf schmalen Bildschirmen eine */
.topic-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
.topic-grid .topic-option { margin-bottom: 0; }
@media (min-width: 640px) {
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topic-grid > .topic-option:only-child { grid-column: 1 / -1; }
}
.topic-option:hover { border-color: var(--accent-1); }
.topic-option:has(input:checked) { border-color: var(--accent-1); background: var(--accent-lighter); }
.topic-option input { margin-top: 3px; }
.topic-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.topic-desc { font-size: 14px; color: var(--text-muted); }
.topics.has-error .topic-option { border-color: var(--error); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.form-field { margin-bottom: 16px; min-width: 0; }
.form-field label, .label-like { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.required { color: var(--error); margin-left: 2px; }
.optional { color: var(--text-muted); font-weight: 400; }

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea {
  width: 100%; background: var(--bg-input); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font-body); font-size: 16px; padding: 11px 14px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none; appearance: none;
}
.form-field input[type="file"] { padding: 9px 12px; font-size: 14px; }
.form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px;
}
.form-field textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--accent-light); background: var(--bg-secondary);
}
.form-field input.error:not([type="checkbox"]):not([type="radio"]), .form-field textarea.error, .form-field select.error { border-color: var(--error); box-shadow: 0 0 0 3px rgba(185,28,28,.12); }
.field-error { color: var(--error); font-size: 13px; margin-top: 5px; }
.help { color: var(--text-muted); font-size: 13px; margin-top: 5px; }

input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; width: 19px; height: 19px; min-width: 19px;
  border: 2px solid var(--text-muted); border-radius: 5px; background: var(--bg-input);
  cursor: pointer; display: inline-block; vertical-align: middle; position: relative; flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--accent-1); border-color: var(--accent-1); }
input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: 2px solid var(--bg-card); border-top: none; border-left: none; transform: rotate(45deg);
}
input[type="radio"]:checked::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg-card); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 3px solid var(--accent-1); outline-offset: 2px; }

.checkbox-label, .radio-label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px;
}
.checkbox-label input, .radio-label input { margin-top: 1px; }
.checkbox-label.small { font-size: 13px; }
.consent {
  padding: 14px 16px; background: var(--bg-input); border-radius: var(--radius-md); margin-top: 4px;
  font-size: 14px; color: var(--text-secondary); line-height: 1.5;
}
.radio-group { margin-bottom: 16px; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.form-hint { margin-top: 14px; font-size: 13.5px; color: var(--text-muted); }

/* ============================================================ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1.1;
  padding: 13px 24px; border-radius: var(--radius-full); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: all var(--transition);
  min-height: 44px; -webkit-tap-highlight-color: transparent; text-align: center;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); color: var(--bg-card); box-shadow: 0 4px 14px var(--accent-light); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.2); color: var(--bg-card); }
.btn-secondary { background: var(--bg-input); color: var(--text-secondary); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-1); color: var(--accent-1); background: var(--accent-lighter); }
.btn-danger { background: var(--error-bg); color: var(--error); }
.btn-danger:hover:not(:disabled) { background: var(--error); color: #fff; }
.btn-sm { font-size: 13px; padding: 8px 16px; min-height: 36px; }
.btn-full { width: 100%; }
.actions-inline { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

/* ============================================================ Hinweise */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius-md); font-size: 14.5px; line-height: 1.5; margin-bottom: 16px; }
.alert-icon { font-weight: 700; flex-shrink: 0; min-width: 18px; text-align: center; }
.alert a { color: inherit; font-weight: 600; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error   { background: var(--error-bg); color: var(--error); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info    { background: var(--accent-light); color: var(--text-secondary); }
.alert ul { margin: 6px 0 6px 18px; }

.message { text-align: center; }
.message h1 { font-family: var(--font-heading); font-size: 26px; margin-bottom: 12px; }
.message p { margin-bottom: 12px; }
.message-icon {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; background: var(--accent-light); color: var(--accent-1);
}
.message-success .message-icon { background: var(--success-bg); color: var(--success); }
.message-error .message-icon { background: var(--error-bg); color: var(--error); }
.topic-list { list-style: none; margin: 10px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.topic-list li { background: var(--accent-light); border-radius: var(--radius-full); padding: 5px 14px; font-weight: 600; font-size: 14px; }
.card:not(.message) .topic-list { justify-content: flex-start; }

.empty-state { text-align: center; padding: 44px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 44px; margin-bottom: 12px; }
.empty-state h2 { font-size: 19px; margin-bottom: 8px; color: var(--text-secondary); }

.danger-zone { border-color: var(--error-bg); }
.danger-zone .card-title { font-size: 20px; }

/* ============================================================ Textseiten */
.prose { line-height: 1.7; margin-top: 32px; }
.prose h1 { font-family: var(--font-heading); font-size: 30px; margin-bottom: 16px; letter-spacing: -.01em; }
.prose h2 { font-family: var(--font-heading); font-size: 21px; margin: 28px 0 10px; }
.prose h3 { font-size: 16px; margin: 18px 0 6px; }
.prose p { margin-bottom: 12px; }
.prose ul { margin: 0 0 14px 22px; }
.prose li { margin-bottom: 4px; }
.prose a { overflow-wrap: anywhere; }
.prose .lead { font-size: 16.5px; color: var(--text-secondary); }

/* ============================================================ Fuß */
.site-footer { text-align: center; padding: 28px 16px; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); }
.site-footer p + p { margin-top: 4px; }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
