/* Grundlayout – an Jotform angelehnt */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: #d6ebff; /* zartes Blau */
  margin: 0;
  padding: 2rem 1rem;
  color: #111827;
}

.form-wrapper {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  padding: 2.5rem 2rem;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid #c7ddff;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
  color: #000091;
}

h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  color: #111827;
}

.intro {
  margin: 0 0 1.5rem;
  color: #4b5563;
  font-size: 0.95rem;
}

/* Abschnittsüberschriften mit blauem Balken, wie bei Jotform */
.section-header {
  margin: 1.8rem -2rem 1rem;
  padding: 0.75rem 2rem;
  background: #e5f0ff;
  border-radius: 10px;
  border: 1px solid #c7ddff;
  font-size: 1rem;
  font-weight: 700;
  color: #000091;
}

.form-wrapper > .section-header:first-of-type {
  margin-top: 1.2rem;
}

label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #111827;
}

small {
  font-weight: 400;
  color: #6b7280;
}

/* Inputs – alle gleich groß & gut lesbar */
input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 1rem;
  background: #f9fafb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-height: 2.6rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #000091;
  box-shadow: 0 0 0 2px rgba(0, 0, 145, 0.18);
  background: #ffffff;
}

/* Grid wie bei Jotform */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* kleine optische Trennung */
.section-divider {
  margin: 2rem 0 1.5rem;
  border-top: 1px solid #cbd5e1;
}

/* Themen + Stärken in einer Zeile (80/20) */
.topic-row {
  display: grid;
  grid-template-columns: 4fr 1fr;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.topic-row label {
  margin-top: 0;
}

/* Hinweise */
.hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Passwort-Bereich */
.pwd-custom {
  margin-top: 0.5rem;
}

/* Button */
button[type="submit"],
button {
  margin-top: 1.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  background: #000091;
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button:hover {
  background: #1e1ea8;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.25);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.18);
}

/* Statusmeldungen */
#msg,
#m,
#pwm {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.ok {
  color: #15803d;
}

.err {
  color: #b91c1c;
}

/* Mobile-Optimierung */
@media (max-width: 600px) {
  .form-wrapper {
    padding: 1.75rem 1.25rem;
    border-radius: 0.75rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .section-header {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .topic-row {
    grid-template-columns: 1fr; /* untereinander auf Handy */
  }
}

/* Rotes Highlight für ungültige Felder */
.field-error {
  border-color: #b30000 !important;
  box-shadow: 0 0 0 2px rgba(179, 0, 0, 0.15);
}

/* Label dazu ebenfalls rot */
.field-error-label {
  color: #b30000;
  font-weight: 600;
}

/* --- Optionale Felder dezent zurücknehmen --- */

/* Labels in optionalen Bereichen etwas heller / softer */
.optional label {
  color: #4b5563;        /* wie .intro-Text */
  font-weight: 500;
}

/* Eingabefelder in optionalen Bereichen mit leicht hellerem Rahmen */
.optional input,
.optional select,
.optional textarea {
  border-color: #e5e7eb;
  background: #f9fafb;
}

/* Sitzungs-ID unsichtbar, bleibt aber im Formular */
.hidden-field {
  display: none;
}