:root {
  --gold: #b8975a;
  --gold-dark: #9c7d42;
  --dark: #1c1c1c;
  --grey: #5f5f5f;
  --line: #e3ddd0;
  --bg: #faf8f4;
  --white: #ffffff;
  --error: #b00020;
  --radius: 8px;
  --maxw: 880px;
}

* { box-sizing: border-box; }

/* hidden-Attribut zuverlässig durchsetzen (auch für .field mit display:flex) */
[hidden] { display: none !important; }

/* Honeypot-Feld: für Menschen unsichtbar, nur Bots füllen es aus */
.hp-field {
  position: absolute;
  left: -5000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--dark);
  background: var(--bg);
  line-height: 1.55;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--gold);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 20px;
}
.logo { height: 70px; width: auto; display: block; }

/* Container */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.intro h1 {
  font-size: 2rem;
  margin: 0 0 12px;
  letter-spacing: 0.5px;
}
.intro p { color: var(--grey); margin: 0 0 12px; }
.emergency-note {
  background: #fff6f6;
  border-left: 4px solid var(--error);
  padding: 12px 14px;
  border-radius: 4px;
  color: #4a1418 !important;
}

.req-star { color: #c0392b; font-weight: 800; font-size: 1.1em; }

/* Legendenhinweis oben im Formular */
.required-legend {
  display: inline-block;
  background: #fff6f6;
  border: 1px solid #e7b8b8;
  color: #8a2b2b;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  margin: 0 0 18px;
}

/* Pflichtfelder (außer Radio/Checkbox) deutlich hervorheben */
input:not([type="radio"]):not([type="checkbox"]):required,
select:required,
textarea:required {
  border: 2px solid #c0392b;
  background: #fff5f4;
  box-shadow: inset 3px 0 0 0 #c0392b;
}
input:not([type="radio"]):not([type="checkbox"]):required:focus,
select:required:focus,
textarea:required:focus {
  border-color: #c0392b;
  box-shadow: inset 3px 0 0 0 #c0392b, 0 0 0 3px rgba(192, 57, 43, 0.18);
}
/* Pflichtfeld-Label kräftiger und dunkler */
.field label:has(.req-star) { color: #1c1c1c; font-weight: 700; }

/* Hinweis-Box innerhalb eines Abschnitts */
.section-note {
  background: #fbf7ee;
  border-left: 4px solid var(--gold);
  color: #4a3c1e;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: 4px;
  margin: 4px 0 18px;
}

/* Optionale Felder klar als solche kennzeichnen */
.optional-tag {
  color: var(--grey);
  font-weight: 400;
  font-style: italic;
}

/* Fieldsets */
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  margin: 0 0 22px;
  padding: 22px 24px 26px;
}
legend {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
  padding: 4px 12px;
  background: var(--dark);
  color: var(--white);
  border-radius: 4px;
}

/* Grid layout */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 20px;
  margin-top: 10px;
}
.field { display: flex; flex-direction: column; }
.field-wide { grid-column: span 1; }
.field-full { grid-column: 1 / -1; }

label {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
input[type="month"],
input[type="number"],
select,
textarea {
  font: inherit;
  font-size: 1.02rem;
  padding: 13px 14px;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--dark);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: auto; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 151, 90, 0.18);
}
textarea { resize: vertical; }

input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #e0a0a0;
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: var(--error); }
/* Auch Beschriftung rot, damit Ja/Nein-Auswahl und Pflicht-Häkchen sichtbar markiert sind */
.field.invalid > label,
.field.invalid .radio,
.field.invalid .checkbox { color: var(--error); }
.field.invalid { scroll-margin-top: 90px; }

/* Radios / checkboxes – größere Tippflächen für ungeübte Nutzer */
.radio-row { display: flex; gap: 12px 22px; flex-wrap: wrap; padding-top: 6px; }
.radio, .checkbox {
  font-weight: 500;
  font-size: 1.02rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.radio { padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.checkbox { margin-bottom: 14px; align-items: flex-start; }
.checkbox input { margin-top: 2px; }
.radio input, .checkbox input { width: auto; accent-color: var(--gold-dark); transform: scale(1.4); transform-origin: left center; }

.hint { color: var(--grey); font-size: 0.78rem; margin-top: 5px; font-weight: 400; }
.hint.hint-warn { color: var(--error); font-weight: 600; }

/* Übernommene (gesperrte) Felder dezent kennzeichnen */
input[readonly] { background: #f3f0ea; color: #555; cursor: not-allowed; }

/* File list */
.file-list { list-style: none; padding: 0; margin: 10px 0 0; }
.file-list li {
  font-size: 0.82rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

/* Errors */
.form-error {
  background: #fff6f6;
  border: 1px solid #e0a0a0;
  color: var(--error);
  padding: 14px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}
.form-error .error-list { margin: 8px 0 0; padding-left: 22px; }
.form-error .error-list li { margin-bottom: 4px; }
.form-error .error-list a { color: var(--error); font-weight: 600; }
.form-error .error-list a:hover { text-decoration: none; }

/* Actions */
.actions { text-align: center; margin-top: 8px; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  border: none;
  padding: 15px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 14px rgba(184, 151, 90, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(184, 151, 90, 0.45); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.privacy-hint { color: var(--grey); font-size: 0.78rem; margin-top: 12px; }

.btn-secondary {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--gold);
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 16px;
}
.btn-secondary:hover { background: var(--bg); }

/* Success */
.success-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
}
.success-icon {
  width: 64px; height: 64px; line-height: 64px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 2rem;
  margin: 0 auto 16px;
}
.success-box h2 { margin: 0 0 12px; }
.reference {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: 1px;
  margin: 6px 0 18px;
}

/* Footer */
.site-footer {
  text-align: center;
  color: var(--grey);
  font-size: 0.8rem;
  padding: 24px 20px 40px;
}
.footer-links { margin-top: 6px; }
.footer-links a {
  color: var(--gold-dark);
  text-decoration: none;
  font-weight: 600;
}
.footer-links a:hover { text-decoration: underline; }

/* Rechtsseiten (Impressum / Datenschutz) */
.legal { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px 40px; margin-top: 24px; }
.legal h1 { margin: 8px 0 20px; }
.legal h2 { font-size: 1.05rem; margin: 26px 0 6px; color: var(--dark); }
.legal p, .legal li { color: #333; }
.legal ul { padding-left: 20px; margin: 6px 0; }
.legal li { margin-bottom: 4px; }
.legal a { color: var(--gold-dark); }
.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold-dark);
  text-decoration: none;
  font-weight: 600;
}
.back-link:hover { text-decoration: underline; }
.legal-hint {
  margin-top: 24px;
  font-size: 0.82rem;
  color: var(--grey);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

@media (max-width: 640px) {
  .legal { padding: 22px 18px 28px; }
}

/* Responsive */
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .logo { height: 52px; }
  .intro h1 { font-size: 1.6rem; }
  fieldset { padding: 18px 16px 20px; }
}
