/* Ü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:0; /* Kein padding am Formular selbst */
  border:1px solid var(--ed-border, #987733);
  box-shadow:0 6px 18px var(--ed-shadow, rgba(152,119,51,.10));
}

/* Innerer Container für Inhalte mit Padding */
.ed-form-inner {
  padding: 24px; /* Standardabstand zum Rand */
}

/* Padding über Custom Property steuerbar */
.ed-form[style*="--ed-padding"] .ed-form-inner {
  padding: var(--ed-padding, 24px);
}

/* 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 */
.ed-steps{
  display: block;
}

.ed-step{
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ed-gap, 12px);
  text-align: left;
}

.ed-step label{
  display: block;
  margin: 0;
  font-weight: 500;
  font-size: var(--ed-label-size, 14px);
}

/* Inputs */
.ed-steps input, .ed-steps textarea{
  width:100%;
  max-width:100%;
  padding:12px 14px;
  border:1px solid #ddd;
  border-radius:10px;
  outline:none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: var(--ed-label-size, 14px); /* Schriftgröße aus Formulareinstellungen */
  font-family: var(--ed-font, inherit); /* Schriftart aus Formulareinstellungen */
}
.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}

/* Pflichtfeld-Stern */
.ed-required {
  color: #d32f2f;
  font-weight: 600;
  margin-left: 2px;
}

.ed-submit, .ed-next{
  border:none;padding:12px 18px;background:var(--ed-color);color:#fff;border-radius:10px;cursor:pointer;font-size:inherit;font-family:var(--ed-font)
}
.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 Hover/Klick */
.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 */
.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
   ANGEPASST: Text UNTER dem Bild, Größe 230x150px, Bilder max 120x120px
   =========================== */

/* Flex-Container für Choice-Reihen */
.ed-form .ed-choices{
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  text-align: center;
  width: 100%;
}

/* Einzelne Choice-Karte - Wrapper für Karte + Label */
.ed-form .ed-choice-wrap{ 
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  max-width: 230px;
}

/* Die Karte selbst - 230x150px fixiert */
.ed-form .ed-choice{
  width: 230px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .03s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Rahmen bei Choice-Feldern entfernen (wenn Option aktiv) */
.ed-form.choice-no-border .ed-choice {
  border: none;
}

/* Hover: Rahmen #987733 IMMER anzeigen (auch bei choice-no-border) */
.ed-form .ed-choice:hover {
  border: 2px solid #987733;
  box-shadow: 0 4px 12px rgba(152, 119, 51, 0.15);
}

.ed-form.choice-no-border .ed-choice:hover {
  border: 2px solid #987733;
  box-shadow: 0 4px 12px rgba(152, 119, 51, 0.15);
}

/* Bild: max 120x120 */
.ed-form .ed-choice img{ 
  max-width: 120px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* FontAwesome Icon: 120x120px Größe begrenzt, zentriert */
.ed-form .ed-choice i{
  font-size: 100px;
  color: var(--ed-color);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 120px;
  max-height: 120px;
}

/* Text UNTER der Karte */
.ed-form .ed-choice-label {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.3;
  color: #111;
  text-align: center;
  word-wrap: break-word;
  max-width: 230px;
}

/* ===========================
   Fortschrittsbalken (nur Frontend)
   =========================== */

/* Container für Fortschrittsbalken - volle Breite, unabhängig vom Padding */
.ed-progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 50px;
  padding: 12px 24px; /* Eigenes Padding für den Fortschrittsbalken */
  width: 100%;
  box-sizing: border-box;
}

/* Responsive: Kleinerer Abstand auf mobilen Geräten */
@media (max-width: 768px) {
  .ed-progress-bar-container {
    margin-top: 30px;
  }
}

@media (max-width: 480px) {
  .ed-progress-bar-container {
    margin-top: 20px;
  }
}

/* Zurück-Button als Dreieck */
.ed-back-btn {
  background: none;
  border: none;
  color: #987733;
  width: auto;
  height: auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.05s;
  flex-shrink: 0;
}

.ed-back-btn:hover {
  opacity: 0.8;
}

.ed-back-btn:active {
  transform: translateX(-2px);
}

.ed-back-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Dreieck-Icon - nach links zeigend */
.ed-back-btn::before {
  content: "◀";
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  color: #987733;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fortschrittsbalken */
.ed-progress-bar {
  flex: 1;
  height: 12px;
  background: #e6e6e6;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.ed-progress-bar-fill {
  height: 100%;
  background: var(--ed-color);
  border-radius: 999px;
  transition: width 0.3s ease;
  position: relative;
}

/* Progress-Text (optional) */
.ed-progress-text {
  font-size: 13px;
  color: #666;
  font-weight: 500;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* Hover und Active */
.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 */
.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;
}

/* ===========================
   Formular-Animationen
   =========================== */

/* Container für animierte Schritte - muss overflow hidden haben und relative Positionierung */
.ed-form-animated .ed-steps {
  position: relative;
  overflow: hidden;
}

/* Schritte haben standardmäßig relative Positionierung */
.ed-form-animated .ed-step {
  position: relative;
  transition: transform 0.4s ease-in-out;
  opacity: 1; /* Immer sichtbar, nur Position ändert sich */
}

/* Während Animation: absolute Positionierung für beide Schritte */
.ed-form-animated .ed-step.animating {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 1; /* Während Animation immer sichtbar */
}

/* Slide nach links (Vorwärts) - Aktueller Schritt verschwindet */
.ed-form-animated .ed-step.slide-out-left {
  transform: translateX(-100%);
  z-index: 1;
}

/* Slide von rechts (Vorwärts) - Neuer Schritt erscheint */
.ed-form-animated .ed-step.slide-in-right {
  transform: translateX(0);
  z-index: 2;
}

/* Initial Position für Slide von rechts */
.ed-form-animated .ed-step.slide-in-right-initial {
  transform: translateX(100%);
  z-index: 2;
}

/* Slide nach rechts (Rückwärts) - Aktueller Schritt verschwindet */
.ed-form-animated .ed-step.slide-out-right {
  transform: translateX(100%);
  z-index: 1;
}

/* Slide von links (Rückwärts) - Vorheriger Schritt erscheint */
.ed-form-animated .ed-step.slide-in-left {
  transform: translateX(0);
  z-index: 2;
}

/* Initial Position für Slide von links */
.ed-form-animated .ed-step.slide-in-left-initial {
  transform: translateX(-100%);
  z-index: 2;
}
