/* Widerrufsbutton · Basis-Stylesheet (neutral, Mandanten-fähig).
   Dunkle Basis, helle Variante kommt aus partials/theme.php ([data-theme="light"]). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background: #0F1115;
  color: #E6E8EB;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4 { line-height: 1.25; color: #fff; letter-spacing: -0.01em; }
a { color: var(--accent-light, #94A3B8); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---- Header / Nav ---- */
nav.nav {
  background: rgba(15, 17, 21, 0.9);
  border-bottom: 1px solid #20242E;
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 32px);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { display: block; width: auto; }
.brand-text { font-weight: 700; font-size: 1.1rem; color: inherit; }
.nav-actions { display: inline-flex; align-items: center; gap: 10px; }

/* ---- Main ---- */
main { flex: 1 0 auto; width: 100%; padding: clamp(18px, 4vw, 40px) 0; }
.hero { text-align: center; margin-bottom: 24px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 10px; }
.hero p { margin: 0 auto; max-width: 56ch; color: #AEB4BE; }
[data-theme="light"] .hero p { color: #475569; }

/* ---- Karte / Formular ---- */
.form-card, .legal-content {
  background: #161A21;
  border: 1px solid #232833;
  border-radius: 16px;
  padding: clamp(22px, 4vw, 36px);
}
.form-card { margin-top: 8px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.field .req { color: var(--accent-bright, #ef4444); }
.field .hint { display: block; font-size: 0.82rem; color: #8B92A0; margin-top: 4px; }
[data-theme="light"] .field .hint { color: #64748B; }

.input, .textarea {
  width: 100%; font: inherit; color: inherit;
  background: #0F1115; border: 1px solid #303642; border-radius: 10px;
  padding: 11px 14px; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
[data-theme="light"] .input,
[data-theme="light"] .textarea { background: #fff; color: #0F172A; border-color: #CBD5E1; }
.input:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg, rgba(100,116,139,0.25));
}
.textarea { resize: vertical; min-height: 96px; }
.input:invalid:not(:placeholder-shown) { border-color: var(--accent-bright); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

/* Honeypot: visuell + für Screenreader weg, aber im DOM */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Datenschutzhinweis am Button */
.privacy-note { font-size: 0.86rem; color: #8B92A0; margin: 6px 0 18px; }
[data-theme="light"] .privacy-note { color: #64748B; }
.privacy-note a { text-decoration: underline; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 14px 24px; border-radius: 10px; border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; width: 100%; font-size: 1.02rem; }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); text-decoration: none; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---- Meldungen ---- */
.alert { border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; font-size: 0.95rem; }
.alert-error { background: rgba(220, 38, 38, 0.12); border: 1px solid rgba(220, 38, 38, 0.4); color: #FCA5A5; }
[data-theme="light"] .alert-error { color: #B91C1C; }

/* ---- Danke / Erfolg ---- */
.success-icon {
  width: 64px; height: 64px; border-radius: 999px; margin: 0 auto 18px;
  display: grid; place-items: center;
  background: rgba(16, 185, 129, 0.14); color: #34D399;
}
.success-icon svg { width: 32px; height: 32px; }
.receipt {
  margin: 18px 0; padding: 16px 18px; border-radius: 10px;
  background: #0F1115; border: 1px solid #232833;
}
[data-theme="light"] .receipt { background: #F8FAFC; border-color: #E2E8F0; }
.receipt dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: #8B92A0; }
.receipt dd { margin: 2px 0 12px; font-weight: 600; }
.receipt dd:last-child { margin-bottom: 0; }

/* ---- Legal ---- */
.legal-content { margin-top: 8px; }
.legal-content h1 { font-size: 1.6rem; margin-top: 0; }
.legal-content h2 { font-size: 1.15rem; margin-top: 1.6em; }
.legal-content p, .legal-content li { color: #C5CAD3; }
[data-theme="light"] .legal-content p,
[data-theme="light"] .legal-content li { color: #334155; }

/* ---- Footer ---- */
.site-footer { flex-shrink: 0; margin-top: 32px; padding: 22px 0; border-top: 1px solid #20242E; color: #8B92A0; }
.foot-grid { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-nav { display: inline-flex; gap: 18px; flex-wrap: wrap; }
.foot-meta {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #20242E;
  font-size: 0.82rem; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.foot-meta .theme-toggle { flex: 0 0 auto; }

/* ============================================================
   Barrierefreiheit (WCAG 2.1 AA) - Ergänzungen Single-Variante
   ============================================================ */

/* Sichtbarer Tastatur-Fokus auf allen interaktiven Elementen */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.theme-toggle:focus-visible {
  outline: 3px solid var(--accent-bright, #3B82F6);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Maus-Fokus (nicht :focus-visible) ohne Outline, Inputs behalten ihren Ring */
.input:focus-visible, .textarea:focus-visible {
  outline: 3px solid var(--accent-bright, #3B82F6);
  outline-offset: 1px;
}

/* Nur für Screenreader sichtbar */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Pflichtfeld-Hinweis über dem Formular */
.form-req-note { font-size: 0.85rem; color: #8B92A0; margin: 0 0 18px; }
[data-theme="light"] .form-req-note { color: #475569; }

/* Feldbezogene Fehlermeldung unter dem Eingabefeld */
.field-error {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 6px;
  color: #FCA5A5;
}
[data-theme="light"] .field-error { color: #B91C1C; }

/* Feld mit Fehler hervorheben (Rahmen, nicht nur Farbe -> auch ohne Farbsehen erkennbar) */
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: #DC2626;
  box-shadow: 0 0 0 1px #DC2626;
}

/* Fehler-Zusammenfassung: Links gut sichtbar */
.alert-error a { color: inherit; text-decoration: underline; font-weight: 600; }
.alert-error ul { margin: 8px 0 0; padding-left: 20px; }

/* Bewegung reduzieren, wenn vom System gewünscht */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
