/* Überlauf verhindern */
.ed-form, .ed-form * { box-sizing: border-box; }

/* Sicherheit: "hidden" sorgt garantiert für display:none */
.ed-step[hidden]{ display:none !important; }


/* Formular nimmt immer die Breite seines Containers an */
.ed-form{
  width: 100%;
  max-width: 100%;
  --ed-color:#987733;
  background:#fff;
  border-radius:14px;
  padding:24px;
  border:1px solid var(--ed-border, #987733);
  box-shadow:0 6px 18px var(--ed-shadow, rgba(152,119,51,.10));
}

/* Rahmen komplett ausblendbar */
.ed-form.no-border { border:none; box-shadow:none; }

.ed-title{font-size:24px;margin-bottom:4px;color:#111}
.ed-desc{font-size:16px;margin-bottom:16px;color:#333}


/* Standard: Formular-Schritt als einspaltiges Grid, Abstand zwischen Feldern per Variable */
.ed-steps{
  /* Das Formular selbst bleibt ein Blockelement; das Grid liegt auf dem einzelnen Schritt */
  display: block;
}

.ed-step{
  /* Ein einzelner Schritt wird als einspaltiges Grid aufgebaut.
     Die CSS-Variable --ed-gap steuert den Abstand zwischen den Formularfeldern
     (z. B. Name, E-Mail, Button). */
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ed-gap, 12px); /* Abstand zwischen den Feldern im Schritt */
  text-align: left; /* Normale Felder linksbündig */
}

.ed-step label{
  /* Labels bleiben Blockelemente, der vertikale Abstand kommt jetzt vollständig über das Grid-Gap */
  display: block;
  margin: 0;
  font-weight: 500;
  font-size: var(--ed-label-size, 14px); /* Schriftgröße für Labels */
}



/* Inputs füllen die verfügbare Breite, laufen nicht über */
.ed-steps input, .ed-steps textarea{
  width:100%;
  max-width:100%;
  padding:12px 14px;
  border:1px solid #ddd;
  border-radius:10px;
  outline:none;
}
.ed-steps input:focus, .ed-steps textarea:focus{
  border-color:var(--ed-color);
  box-shadow:0 0 0 3px rgba(152,119,51,.15);
}

.ed-checkbox{display:flex;gap:8px;align-items:flex-start}
.ed-checkbox input{width:auto}
.ed-submit, .ed-next{
  border:none;padding:12px 18px;background:var(--ed-color);color:#fff;border-radius:10px;cursor:pointer
}
.ed-btn-rounded{border-radius:999px}
.ed-success{background:#f6fff4;border:1px solid #d9f0d3;color:#224c1a;padding:12px;border-radius:10px;margin-top:10px}

/* Buttons reagieren auf Hover/Klick und senden-Zustand */
.ed-submit, .ed-next{
  transition: transform .03s ease, opacity .15s ease, box-shadow .15s ease;
}
.ed-submit:hover, .ed-next:hover{
  opacity: .95;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.ed-submit:active, .ed-next:active{
  transform: translateY(1px);
}

/* Ladezustand beim Absenden */
.ed-submit.is-loading{
  position: relative;
  pointer-events: none;
  opacity: .8;
}
.ed-submit.is-loading::after{
  content: '…';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
}

/* Choice-Karten (Icon + Text, klickbar) - Flex-Container zentriert sie */
.ed-form .ed-choices{
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;   /* Mittig platziert */
  gap: 16px;                 /* Abstand zwischen Karten */
  text-align: center;        /* Text in den Karten zentriert */
  width: 100%;
}

/* Einzelne Choice-Karte */
.ed-form .ed-choice-wrap{ 
  display: block;            /* Flex-Item, kein inline-block */
  flex-shrink: 0;            /* Verhindert Schrumpfen */
}

.ed-form .ed-choice{
  width: 150px;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease, transform .03s ease;
}
.ed-form .ed-choice img{ width: 56px; height: 56px; object-fit: contain; }
.ed-form .ed-choice span{ font-size: 14px; line-height: 1.3; color: #111; }
.ed-form .ed-choice:hover{ border-color: var(--ed-color); box-shadow: 0 0 0 3px rgba(152,119,51,.10); }
.ed-form .ed-choice:active{ transform: translateY(1px); }

/* Sicherheit: nur aktiver Schritt sichtbar */
.ed-step[hidden]{ display:none !important; }

/* Error-Styling für Client-Validierung */
.ed-form input.ed-error,
.ed-form textarea.ed-error,
.ed-form select.ed-error {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 1px #dc3232;
}

.ed-form input.ed-error:focus,
.ed-form textarea.ed-error:focus,
.ed-form select.ed-error:focus {
    border-color: #dc3232 !important;
    box-shadow: 0 0 0 1px #dc3232, 0 0 2px rgba(220, 50, 50, 0.8);
}

/* Submit-Button Auto-Size */
.ed-submit {
  width: auto !important;
  padding-left: 2em !important;
  padding-right: 2em !important;
  min-width: 120px;
}
