/* LEGAL GUARD – Wiederverwendbare Komponenten (Header, Buttons, Chips, Karten, FAQ, Tabelle, Formular, Footer) */

/* Header: Mobile = Logo + CTA, Navigation als scrollbare Zeile darunter (ohne JS bedienbar) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__bar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand cta" "nav nav";
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-3);
}
.brand { grid-area: brand; justify-self: start; display: inline-flex; padding: var(--space-1) 0; }
.brand__logo { height: 26px; width: auto; }
.site-header .btn { grid-area: cta; }
.site-nav { grid-area: nav; overflow-x: auto; scrollbar-width: none; padding: 6px 4px; margin: -6px -4px; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul { display: flex; gap: var(--space-1); white-space: nowrap; }
.site-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  color: var(--c-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--c-lavender-light); color: var(--c-purple-text); }
.site-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 0.3em; }

@media (min-width: 52rem) {
  .site-header__bar { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav cta"; gap: var(--space-5); }
  .brand__logo { height: 30px; }
  .site-nav { justify-self: center; overflow: visible; padding: 0; margin: 0; }
  .site-nav a { font-size: var(--fs-body); }
}

/* Buttons: Pill-Form, Primär/Sekundär laut Brandbook */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.85em 1.6em;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur-fast), color var(--dur-fast);
}
.btn--primary { background: var(--c-purple); color: var(--c-white); box-shadow: 0 6px 16px rgb(138 71 235 / 0.28); }
.btn--primary:hover { background: var(--c-purple-hover); color: var(--c-white); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn--primary:active { transform: translateY(0); }
.btn--secondary { background: var(--c-white); border-color: var(--c-purple); color: var(--c-purple); }
.btn--secondary:hover { background: var(--c-lavender-wash); color: var(--c-purple-hover); transform: translateY(-2px); }
.btn--light { background: var(--c-white); color: var(--c-ink); }
.btn--light:hover { background: var(--c-lavender-light); color: var(--c-ink); transform: translateY(-2px); }
.btn--sm { padding: 0.6em 1.15em; font-size: var(--fs-sm); }
.btn--lg { padding: 1em 2em; font-size: 1.0625rem; }

/* Typografische Bausteine */
.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-4);
  color: var(--c-purple-text);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section--night .eyebrow { color: var(--c-lavender-light); }
.lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--c-grey); }
.section--night .lead { color: rgb(255 255 255 / 0.78); }
.section-head { max-width: 44rem; margin-bottom: var(--space-7); }
.section-head .lead { margin-top: var(--space-4); }
.section-head--center { margin-inline: auto; text-align: center; }
.fineprint { font-size: var(--fs-xs); color: var(--c-grey); line-height: 1.5; }

/* Chips */
.chip {
  display: inline-block;
  padding: 0.2em 0.75em;
  border-radius: var(--radius-pill);
  background: var(--c-lavender-light);
  color: var(--c-purple-text);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.chip--ok { background: var(--c-ok-bg); color: var(--c-ok); }
.chip--solid { background: var(--c-purple); color: var(--c-white); }

/* Karten: Radius und Tiefe nach Rolle */
.card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-m);
  padding: var(--space-5);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--c-lavender); }

/* FAQ-Akkordeon (natives details/summary) */
.faq details { border-bottom: 1px solid var(--c-border); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+" / "";
  flex: none;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c-lavender-light);
  color: var(--c-purple-text);
  font-size: 1.4rem;
  transition: transform var(--dur) var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__body { padding: 0 0 var(--space-5); max-width: 42rem; color: var(--c-grey); }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--radius-m); }
.table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: var(--space-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--c-border); }
.table thead th { background: var(--c-purple); color: var(--c-white); font-weight: 600; }
.table tbody th { font-weight: 600; background: var(--c-soft); width: 11rem; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table .is-lg { background: var(--c-lavender-wash); }

/* Formular */
.form { display: grid; gap: var(--space-4); }
.form__row { display: grid; gap: var(--space-4); }
@media (min-width: 40rem) { .form__row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; margin-bottom: var(--space-1); font-size: var(--fs-sm); font-weight: 600; }
.field .opt { font-weight: 400; color: var(--c-grey); }
.field input, .field textarea {
  width: 100%;
  padding: 0.8em 1em;
  border: 1.5px solid var(--c-field-border);
  border-radius: var(--radius-s);
  background: var(--c-white);
  color: var(--c-ink);
  font: inherit;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--c-lavender); }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid transparent; border-color: var(--c-purple); box-shadow: 0 0 0 4px var(--c-lavender-light); }
.field [aria-invalid="true"] { border-color: #B3261E; }
.field__error { margin-top: var(--space-1); color: #B3261E; font-size: var(--fs-sm); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { padding: var(--space-4); border-radius: var(--radius-s); font-weight: 500; }
.form__status:empty { padding: 0; margin: 0; min-height: 0; }
.form__status.is-ok { background: var(--c-ok-bg); color: var(--c-ok); }
.form__status.is-error { background: #FCE9E8; color: #8C1D18; }

/* Footer */
.site-footer { background: var(--c-ink); color: rgb(255 255 255 / 0.78); padding-block: var(--space-7) var(--space-6); font-size: var(--fs-sm); }
.site-footer a { color: var(--c-white); text-decoration: none; }
.site-footer a:hover { color: var(--c-lavender-light); text-decoration: underline; }
.site-footer__grid { display: grid; gap: var(--space-6); }
@media (min-width: 48rem) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { margin-bottom: var(--space-3); color: var(--c-white); font-size: var(--fs-body); letter-spacing: 0; }
.site-footer li + li { margin-top: var(--space-2); }
.site-footer__logo { display: inline-block; padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); background: var(--c-white); border-radius: var(--radius-s); }
.site-footer__logo img { height: 24px; width: auto; }
.site-footer__legal { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid rgb(255 255 255 / 0.16); font-size: var(--fs-xs); }

/* Rechtsseiten (Impressum, Datenschutz) */
.legal { padding-block: var(--space-7) var(--space-section); }
.legal h1 { font-size: var(--fs-h2); margin-bottom: var(--space-5); }
.legal h2 { margin: var(--space-7) 0 var(--space-3); font-size: var(--fs-h3); }
.legal p, .legal li { margin-bottom: var(--space-3); }
.legal ul { padding-left: 1.2rem; list-style: disc; }
.legal address { font-style: normal; }
.ph { padding: 0.1em 0.45em; border-radius: 4px; background: #FFF3C4; color: #5C4600; font-weight: 600; }
.legal-todo { padding: var(--space-4) var(--space-5); border-left: 4px solid #D9A400; background: #FFF9E0; border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: var(--fs-sm); }

/* Scroll-Einblendung nur mit aktivem JS und ohne Reduced-Motion */
@keyframes revealFallback { to { opacity: 1; transform: none; } }
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(56px) scale(0.98);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
    animation: revealFallback 0.01s 5s forwards; /* nur wirksam, wenn das Skript nicht läuft */
  }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* Hilfsklassen statt Inline-Styles (CSP-tauglich) */
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.ink { color: var(--c-ink); }
.section--wash .lead { color: #4A4A50; }

/* Windows-Kontrastmodus: Verlaufstext und Fokus bleiben sichtbar */
@media (forced-colors: active) {
  .text-grad { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; }
}

/* Niedrige Viewports (z. B. 400 % Zoom): Header nicht mitscrollen */
@media (max-height: 30rem) {
  .site-header { position: static; }
  html { scroll-padding-top: 0; }
}

/* Kontakt */
.contact { display: grid; gap: var(--space-6); }
@media (min-width: 60rem) { .contact { grid-template-columns: 1fr 1.2fr; align-items: start; } }
.contact__form { padding: var(--space-6); background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius-l); box-shadow: var(--shadow-card); }
.contact h1 { font-size: var(--fs-h2); }

.h1-page { font-size: var(--fs-h2); }
