:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #18334f;
  background: #f4f7fb;
}

* { box-sizing: border-box; }

body {
  max-width: 960px;
  margin: 0 auto;
  padding: 42px 24px 70px;
  line-height: 1.55;
}

h1 {
  color: #073763;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.25;
  margin: 0 0 28px;
}

h2 {
  color: #073763;
  font-size: 1.45rem;
  line-height: 1.35;
  margin: 0 0 24px;
}

h3 {
  color: #073763;
  margin: 28px 0 16px;
  font-size: 1.15rem;
}

body > section {
  background: #fff;
  border: 1px solid #e0e8f0;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(19, 49, 79, .07);
  padding: 34px;
}

body > section > section {
  background: transparent;
  padding: 0;
}

#course_dates,
#course_location,
#course_address,
#course_fee {
  color: #073763;
}

body > section > section > p {
  margin: 8px 0;
}

form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
  row-gap: 10px;
  margin-top: 28px;
}

form > label,
form > details,
form > h3,
form > p,
form > button,
form > #professional_term_notices {
  min-width: 0;
}

form > label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #29425c;
  font-size: .94rem;
  font-weight: 600;
}

form > label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: flex-start;
  font-weight: 400;
}

form > label:has(input[type="checkbox"]) input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 3px;
}

input:not([type="hidden"]):not([type="checkbox"]),
select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #bdcddd;
  border-radius: 9px;
  background: #fff;
  color: #18334f;
  padding: 10px 12px;
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid rgba(15, 98, 166, .18);
  border-color: #176ba9;
}

form > label[for="course_id"],
form > #professional_term_notices,
form > h3,
form > details,
form > p,
form > button,
form > label:has(input[type="checkbox"]) {
  grid-column: 1 / -1;
}

form > label[for="course_id"] {
  margin-bottom: 8px;
}

form > #professional_term_notices {
  padding: 18px 22px;
  background: #eff6fc;
  border: 1px solid #d2e4f2;
  border-radius: 12px;
  margin: 4px 0 14px;
}

#professional_term_notices h3 {
  margin-top: 0;
}

form > h3 {
  border-top: 1px solid #e2eaf2;
  padding-top: 24px;
  margin: 22px 0 8px;
}

form > details {
  background: #f6f9fc;
  border: 1px solid #dce6ef;
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 12px;
}

details summary {
  color: #073763;
  font-weight: 700;
  cursor: pointer;
}

details label {
  display: block;
  margin-top: 14px;
  font-size: .94rem;
  font-weight: 600;
}

details label input {
  margin-top: 6px;
}

form > p {
  margin: 16px 0 6px;
}

form > button {
  border: 0;
  border-radius: 10px;
  padding: 15px 24px;
  background: #07518c;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}

form > button:hover {
  background: #073763;
}

form > button:focus-visible {
  outline: 3px solid #80b8e7;
  outline-offset: 3px;
}

a { color: #07518c; }

@media (max-width: 640px) {
  body { padding: 22px 14px 45px; }
  body > section { padding: 22px 18px; }
  form { grid-template-columns: 1fr; gap: 12px; }
  h2 { font-size: 1.25rem; }
}


/* Korrekte Reihenfolge der Formularfelder */
form {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

form > label[for] {
  margin-top: 6px;
}

form > label[for] + input,
form > label[for] + select {
  margin-top: -8px;
  margin-bottom: 8px;
}

form > input:not([type="hidden"]),
form > select {
  width: 100%;
}

form > label:has(input),
form > label:has(select) {
  gap: 8px;
}

form > h3 {
  margin-top: 20px;
}


/* Zusammengehörige Formularfelder */
form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px 22px;
}

form > .form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

form > .form-field label {
  color: #29425c;
  font-size: .94rem;
  font-weight: 600;
}

form > .form-field input,
form > .form-field select {
  width: 100%;
}

form > .form-field:has(#employer_name),
form > .form-field:has(#course_id) {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  form { grid-template-columns: 1fr; }
}


/* DWSA Formular-Korrekturen 2026-11-07 */

/* Das HTML-hidden-Attribut muss Vorrang vor Layoutregeln haben. */
[hidden] {
  display: none !important;
}

/* Kursinformationen über die gesamte Formularbreite. */
form > #professional_term_notices {
  grid-column: 1 / -1;
  width: 100%;
}

/* Datenschutz und Absenden als separate Zeilen. */
form > label:has(input[type="checkbox"]) {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

form > button[type="submit"] {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  min-height: 50px;
  background: #07518c;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}


/* Datenschutz und Abschluss des Formulars */
form > label:has(input[name="privacy"]) {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

form > label:has(input[name="privacy"]) input {
  width: 18px;
  height: 18px;
  margin: 0;
}

form > button[type="submit"] {
  grid-column: 1 / -1;
  width: 100%;
  display: block;
  padding: 15px 20px;
  background: #07518c;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}


/* DWSA Formularabschluss final */

form > .course-selection {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.course-selection label {
  font-size: .94rem;
  font-weight: 600;
  color: #29425c;
}

.course-selection select {
  width: 100%;
  min-height: 46px;
}

form > .privacy-consent {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  font-weight: 400;
}

.privacy-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
}

form > .registration-submit {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 15px 20px;
  margin-top: 10px;
  background: #07518c;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

form > .registration-submit:hover {
  background: #073763;
}


/* Terminpräferenz: Radio-Layout */
form > #professional_term_preference {
  grid-column: 1 / -1;
  width: 100%;
}

#professional_term_preference fieldset {
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #d8e3ee;
  border-radius: 8px;
}

#professional_term_preference legend {
  padding: 0 6px;
  font-weight: 600;
}

#professional_term_preference fieldset label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 9px 0;
  font-weight: 400;
  cursor: pointer;
}

#professional_term_preference input[type="radio"] {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  border: 0;
  accent-color: #176ba9;
}

#professional_term_preference > p {
  margin: 4px 0 10px;
}


/* Terminpräferenz: finales Layout */
form > #professional_term_preference {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  gap: 10px;
}

form > #professional_term_preference fieldset {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  margin: 0;
  border: 1px solid #d8e3ee;
  border-radius: 8px;
}

form > #professional_term_preference fieldset label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 12px;
  padding: 9px 0;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

form > #professional_term_preference input[type="radio"] {
  appearance: auto;
  display: inline-block;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex: 0 0 18px;
  padding: 0;
  margin: 0;
  border: 0;
  accent-color: #176ba9;
}

form > #professional_term_preference > p {
  margin: 0;
}
