/* ==========================================================================
   ICOM Anmeldung – Frontend
   Orientiert sich an styles/_forms.scss (Elementor-Formulare der Website).
   Checkbox-/Radio-Optik kommt aus dem Theme (globale Regeln), hier nur Layout.
   ========================================================================== */

.icom-anmeldung {
  --icom-anm-primary: #1343a5;
  --icom-anm-secondary: #7390c4;
  --icom-anm-contrast: #cf1976;
  --icom-anm-light: #e5ecf4;
  --icom-anm-box: #f7f8f9;
  --icom-anm-white: #fff;
  --icom-anm-error: #b3261e;
  --icom-anm-radius: 4px;
  --icom-anm-gap: 26px;      /* zwischen Bausteinen */
  --icom-anm-row-gap: 18px;  /* zwischen Feldzeilen */

  color: var(--icom-anm-primary);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}

/* Alle Texte blau – wirklich alles im Formularbereich, auch redaktionelle
   Texte mit eigenen Farben (Theme, Elementor-Kit, Inline-Styles aus dem Editor).
   Daher !important; die wenigen Ausnahmen unten ebenfalls mit !important. */
.icom-anmeldung,
.icom-anmeldung * {
  color: var(--icom-anm-primary) !important;
}
/* Ausnahmen: Eingaben schwarz, Fehler rot, Text auf blauer Fläche weiß */
.icom-anmeldung .icom-anmeldung__input { color: #000 !important; }
.icom-anmeldung .icom-anmeldung__error,
.icom-anmeldung .icom-anmeldung__message:not(.is-info),
.icom-anmeldung .icom-anmeldung__noscript { color: var(--icom-anm-error) !important; }
.icom-anmeldung .icom-anmeldung__button,
.icom-anmeldung .icom-anmeldung__button *,
.icom-anmeldung .is-current .icom-anmeldung__stepper-num { color: var(--icom-anm-white) !important; }
.icom-anmeldung .icom-anmeldung__button:hover,
.icom-anmeldung .icom-anmeldung__button:focus-visible,
.icom-anmeldung .icom-anmeldung__button:hover *,
.icom-anmeldung .icom-anmeldung__button:focus-visible * { color: var(--icom-anm-primary) !important; }

.icom-anmeldung *,
.icom-anmeldung *::before,
.icom-anmeldung *::after { box-sizing: border-box; }

/* hidden-Attribut muss gegen eigene display-Regeln gewinnen */
.icom-anmeldung [hidden] { display: none !important; }

.icom-anmeldung--notice { padding: 12px; background: var(--icom-anm-light); }

/* --- Rahmen ------------------------------------------------------------- */

.icom-anmeldung__intro { margin-bottom: 40px; }

.icom-anmeldung__form,
.icom-anmeldung__closed,
.icom-anmeldung__done {
  background: var(--icom-anm-box);
  padding: 32px 24px;
}
@media (min-width: 768px) {
  .icom-anmeldung__form,
  .icom-anmeldung__closed,
  .icom-anmeldung__done { padding: 48px; }
}

.icom-anmeldung__form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.icom-anmeldung__step > * + * { margin-top: var(--icom-anm-gap); }
.icom-anmeldung__step-title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 27px;
  line-height: 1.2;
  padding: 0;
  margin: 0 0 var(--icom-anm-gap);
}
/* Überschrift gehört zum folgenden Baustein: davor mehr, danach weniger Luft */
/* „Ganz oben“ = erster Baustein im Schritt; die <legend> des Schritttitels zählt nicht mit */
.icom-anmeldung__step > :not(legend) ~ .icom-anmeldung__block--ueberschrift {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 2px solid var(--icom-anm-primary);
}
.icom-anmeldung__step > .icom-anmeldung__block--ueberschrift + * { margin-top: 18px; }

/* --- Schrittleiste ------------------------------------------------------
   Selektoren mit .icom-anmeldung davor: das Elementor-Kit der Website färbt
   global jeden <button> (.elementor-kit-N button), das muss verlieren. */

.icom-anmeldung__steps { margin: 0 0 36px; }

.icom-anmeldung .icom-anmeldung__stepper {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.icom-anmeldung .icom-anmeldung__stepper-item {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.icom-anmeldung .icom-anmeldung__stepper-item::before { content: none; }

.icom-anmeldung .icom-anmeldung__stepper-btn {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 4px solid var(--icom-anm-light);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--icom-anm-primary);
  font: inherit;
  font-size: 16px;
  line-height: 1.3;
  text-align: left;
  cursor: default;
  transition: border-color 200ms, color 200ms;
}
.icom-anmeldung .icom-anmeldung__stepper-num {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.icom-anmeldung .icom-anmeldung__stepper-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icom-anmeldung .is-current > .icom-anmeldung__stepper-btn {
  border-top-color: var(--icom-anm-primary);
  color: var(--icom-anm-primary);
  font-weight: 700;
}
.icom-anmeldung .is-current .icom-anmeldung__stepper-num {
  background: var(--icom-anm-primary);
  border-color: var(--icom-anm-primary);
  color: var(--icom-anm-white);
}
.icom-anmeldung .is-done > .icom-anmeldung__stepper-btn {
  border-top-color: var(--icom-anm-primary);
  color: var(--icom-anm-primary);
  cursor: pointer;
}
.icom-anmeldung .is-done > .icom-anmeldung__stepper-btn:hover .icom-anmeldung__stepper-title,
.icom-anmeldung .is-done > .icom-anmeldung__stepper-btn:focus-visible .icom-anmeldung__stepper-title {
  text-decoration: underline;
}
.icom-anmeldung .icom-anmeldung__stepper-btn:hover,
.icom-anmeldung .icom-anmeldung__stepper-btn:focus { background: transparent; }
.icom-anmeldung .icom-anmeldung__stepper-btn:focus-visible {
  outline: 2px solid var(--icom-anm-primary);
  outline-offset: 4px;
}

/* „Schritt 2 von 3“: auf dem Desktop nur für Screenreader, mobil sichtbar */
.icom-anmeldung__progress {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (max-width: 599px) {
  /* Mobil: nur Balken + Titel des aktuellen Schritts */
  .icom-anmeldung .icom-anmeldung__stepper { gap: 6px; }
  .icom-anmeldung .icom-anmeldung__stepper-btn { padding-top: 0; }
  .icom-anmeldung .icom-anmeldung__stepper-num,
  .icom-anmeldung .icom-anmeldung__stepper-title { display: none; }
  .icom-anmeldung__progress {
    position: static;
    width: auto;
    height: auto;
    margin: 12px 0 0;
    clip: auto;
    font-size: 15px;
    color: var(--icom-anm-primary);
  }
}

.icom-anmeldung__step:focus { outline: none; }

/* --- Bausteine ---------------------------------------------------------- */

.icom-anmeldung__heading {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
}
h2.icom-anmeldung__heading { font-size: 27px; line-height: 1.25; }
h3.icom-anmeldung__heading { font-size: 22px; line-height: 1.3; }

/* Überschriften in redaktionellen Texten: Linie davor, außer ganz oben im Text */
.icom-anmeldung :is(.icom-anmeldung__intro, .icom-anmeldung__text, .icom-anmeldung__outro, .icom-anmeldung__closed, .icom-anmeldung__done) :is(h2, h3):not(:first-child) {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 2px solid var(--icom-anm-primary);
}

.icom-anmeldung__text { line-height: 1.55; }
.icom-anmeldung__text p { margin: 0 0 14px; }
.icom-anmeldung__text p:last-child { margin-bottom: 0; }

.icom-anmeldung__label {
  display: block;
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 8px;
  padding: 0;
}
.icom-anmeldung__req {
  color: var(--icom-anm-primary);
  margin-left: 3px;
}

.icom-anmeldung__input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--icom-anm-radius);
  background: var(--icom-anm-white);
  color: #000;
  font: inherit;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow 200ms;
}
textarea.icom-anmeldung__input { min-height: 130px; resize: vertical; }
.icom-anmeldung__input:focus,
.icom-anmeldung__input:focus-within {
  outline: none;
  box-shadow:
    0 100px 80px 0 rgba(0, 0, 0, 0.07),
    0 41.778px 33.422px 0 rgba(0, 0, 0, 0.05),
    0 22.336px 17.869px 0 rgba(0, 0, 0, 0.04),
    0 12.522px 10.017px 0 rgba(0, 0, 0, 0.04),
    0 6.65px 5.32px 0 rgba(0, 0, 0, 0.03),
    0 2.767px 2.214px 0 rgba(0, 0, 0, 0.02);
}
.icom-anmeldung__input.is-invalid,
.icom-anmeldung__input[aria-invalid="true"] {
  box-shadow: inset 0 0 0 2px var(--icom-anm-error);
}

/* Zeilen im Kontaktdaten-Block */
.icom-anmeldung__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--icom-anm-row-gap) 20px;
}
.icom-anmeldung__row + .icom-anmeldung__row { margin-top: var(--icom-anm-row-gap); }
.icom-anmeldung__col { flex: 1 1 100%; min-width: 0; }
@media (min-width: 600px) {
  .icom-anmeldung__col--full  { flex: 1 1 100%; }
  .icom-anmeldung__col--grow  { flex: 3 1 160px; }
  .icom-anmeldung__col--half  { flex: 1 1 calc(50% - 10px); }
  .icom-anmeldung__col--small { flex: 1 1 110px; max-width: 160px; }
}

/* Optionen (Checkbox / Radio) */
.icom-anmeldung__group { margin: 0; }
.icom-anmeldung__group .icom-anmeldung__label { margin-bottom: 12px; }
.icom-anmeldung__group .icom-anmeldung__option + .icom-anmeldung__option { margin-top: 11px; }

.icom-anmeldung__option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1.45;
}
.icom-anmeldung__option input {
  margin: 3px 0 0;
}
.icom-anmeldung__option-label { flex: 1 1 auto; }
.icom-anmeldung__option-label a { color: inherit; text-decoration: underline; }
.icom-anmeldung__option-hint {
  display: block;
  font-size: 14px;
  color: var(--icom-anm-primary);
  margin-top: 4px;
}

.icom-anmeldung__option.is-full {
  cursor: not-allowed;
}
.icom-anmeldung__option.is-full input { opacity: 0.45; cursor: not-allowed; }
.icom-anmeldung__full {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--icom-anm-light);
  color: var(--icom-anm-primary);
  font-size: 13px;
  white-space: nowrap;
  vertical-align: 1px;
}

/* Fehler */
.icom-anmeldung__error {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--icom-anm-error);
}
.icom-anmeldung .icom-anmeldung__message {
  margin: 36px 0 0;
  padding: 16px 20px;
  line-height: 1.45;
  border-radius: var(--icom-anm-radius);
  background: #fbeaea;
  color: var(--icom-anm-error);
  font-size: 18px;
}
.icom-anmeldung .icom-anmeldung__message.is-info {
  background: var(--icom-anm-light);
  color: var(--icom-anm-primary);
}

/* --- Navigation / Buttons ------------------------------------------------ */

.icom-anmeldung__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 38px;
}
.icom-anmeldung__message:not([hidden]) + .icom-anmeldung__nav {
  margin-top: 28px;
}

.icom-anmeldung .icom-anmeldung__button {
  appearance: none;
  border: 2px solid var(--icom-anm-primary);
  border-radius: var(--icom-anm-radius);
  background: var(--icom-anm-primary);
  color: var(--icom-anm-white);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 18px 32px;
  cursor: pointer;
  transition: background 200ms, color 200ms, opacity 200ms;
}
.icom-anmeldung .icom-anmeldung__button:hover,
.icom-anmeldung .icom-anmeldung__button:focus-visible {
  background: var(--icom-anm-white);
  color: var(--icom-anm-primary);
  outline: none;
}
.icom-anmeldung .icom-anmeldung__button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.icom-anmeldung .icom-anmeldung__next::after {
  content: "→";
  display: inline-block;
  margin-left: 10px;
  transition: transform 200ms;
}
.icom-anmeldung .icom-anmeldung__next:hover::after { transform: translateX(3px); }

/* „Zurück“: bewusst nur Text, damit die Hauptaktion eindeutig bleibt */
.icom-anmeldung .icom-anmeldung__back {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--icom-anm-primary);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 12px 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.icom-anmeldung .icom-anmeldung__back::before {
  content: "←";
  display: inline-block;
  margin-right: 8px;
  text-decoration: none;
}
.icom-anmeldung .icom-anmeldung__back:hover,
.icom-anmeldung .icom-anmeldung__back:focus {
  background: transparent;
  text-decoration-thickness: 2px;
}
.icom-anmeldung .icom-anmeldung__back:focus-visible {
  outline: 2px solid var(--icom-anm-primary);
  outline-offset: 2px;
}
@media (max-width: 479px) {
  .icom-anmeldung .icom-anmeldung__button { width: 100%; text-align: center; }
  .icom-anmeldung .icom-anmeldung__back { margin: 0 auto; }
}

.icom-anmeldung .icom-anmeldung__outro {
  margin: 32px 0 0;
  line-height: 1.55;
}
.icom-anmeldung__outro p { margin: 0 0 14px; }
.icom-anmeldung__outro p:last-child { margin-bottom: 0; }

/* Abstand über Padding am Wrapper – fremde Margin-Resets auf <p> greifen hier nicht */
.icom-anmeldung .icom-anmeldung__hint-wrap {
  margin: 0;
  padding-top: 40px;
}
.icom-anmeldung .icom-anmeldung__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--icom-anm-primary);
}
.icom-anmeldung__hint a { color: inherit; }

/* Honeypot: aus dem Sichtfeld, nicht display:none (Bots prüfen das) */
.icom-anmeldung__hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.icom-anmeldung__noscript {
  padding: 12px 15px;
  background: #fbeaea;
  color: var(--icom-anm-error);
}

/* Bestätigung */
.icom-anmeldung__done h2,
.icom-anmeldung__done h3 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  margin: 0 0 12px;
}
.icom-anmeldung__done p { margin: 0 0 12px; }
.icom-anmeldung__done p:last-child { margin-bottom: 0; }

/* Elementor-Editor: Formular sichtbar, aber nicht bedienbar */
.icom-anmeldung[data-editor] .icom-anmeldung__form { pointer-events: none; }
.icom-anmeldung[data-editor] .icom-anmeldung__submit { opacity: 1; }
