/* ===================================================
   Schriften
   =================================================== */

@font-face {
  font-family: "Lato";
  src: url("../fonts/Lato-Regular.ttf");
  font-weight: normal;
}

@font-face {
  font-family: "Lato";
  src: url("../fonts/Lato-Bold.ttf");
  font-weight: bold;
}

/* ===================================================
   Basis
   =================================================== */

* {
  box-sizing: border-box;
}

body {
  background-color: #788075;
  margin: 0;
  padding: 20px 10px;
  font-family: "Lato", Arial, sans-serif;
}

/* ===================================================
   Layout
   =================================================== */

.formular {
  background-color: white;
  max-width: 800px;
  margin: 20px auto;
  padding: 25px 18px;
  border-radius: 15px;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
}

/* ===================================================
   Header
   =================================================== */

header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  width: 60%;
  max-width: 260px;
  min-width: 150px;
  display: block;
  margin: 0 auto 40px auto;
  text-decoration: none;
}

.logo img {
  width: 100%;
  display: block;
}

/* ===================================================
   Typografie
   =================================================== */

h1 {
  font-weight: bold;
  color: #788075;
  font-size: 26px;
}

p {
  font-weight: normal;
}

/* ===================================================
   Formular-Elemente
   =================================================== */

.form-group {
  margin-bottom: 20px;
}

fieldset {
  border: 2px solid #788075;
  border-radius: 15px;
  margin-bottom: 25px;
  padding: 18px;
}

legend {
  font-weight: bold;
  font-size: 18px;
  color: #788075;
  padding: 0 10px;
}

label {
  display: block;
  font-weight: normal;
  margin-bottom: 8px;
}

/* Hinweis "optional" neben Feldbezeichnungen */
.optional {
  font-size: 12px;
  color: #979d91;
  font-weight: normal;
}

/* Gruppenüberschrift bei Checkboxes (kein <label>, damit kein Feld ausgelöst wird) */
.group-label {
  display: block;
  margin-bottom: 8px;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #94856d;
  border-radius: 8px;
  font-family: "Lato", Arial, sans-serif;
  font-size: 16px;
}

/* Radio- und Checkboxen brauchen keine volle Breite */
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  accent-color: #94856d;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* ===================================================
   Schaltflächen
   =================================================== */

button {
  background-color: #788075;
  color: white;
  border: none;
  padding: 14px 25px;
  border-radius: 8px;
  font-family: "Lato", Arial, sans-serif;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #94856d;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 25px;
}

.btn-back,
.btn-next,
.btn-submit {
  width: 100%;
  min-width: 140px;
}

.btn-back {
  background-color: #b0a99a;
}

.btn-back:hover {
  background-color: #c2bbb0;
}

/* "Absenden" wird per JS eingeblendet, wenn der letzte Schritt aktiv ist */
.btn-submit {
  display: none;
}

/* ===================================================
   Stepper & Fortschrittsbalken
   =================================================== */

.stepper-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 20px 0 10px 0;
}

.stepper-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  margin-bottom: 25px;
  color: #979d91; /* Salbeigrün für sekundäre Beschriftungen */
  font-size: 11px;
}

.step-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px; /* Abgerundetes Rechteck wie im Logo */
  border: 2px solid #788075;
  background-color: white;
  color: #788075;
  font-size: 14px;
  font-weight: bold;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-dot.active,
.step-dot.done {
  background-color: #788075;
  color: white;
}

/* Schritt mit Fehlern wird nach dem Absenden rot markiert */
.step-dot.has-error {
  background-color: #c0392b;
  border-color: #c0392b;
  color: white;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e1dbca;
  border-radius: 20px;
  margin-bottom: 30px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 25%;
  background-color: #94856d;
  border-radius: 20px;
  transition: width 0.3s ease;
}

/* Nur der aktive Schritt wird angezeigt */
.step-block {
  display: none;
}

.step-block.active {
  display: block;
}

/* ===================================================
   Rückmeldungen (Fehler, Erfolg, Zeichenzähler)
   =================================================== */

.error {
  color: #94856d;
  font-weight: bold;
  font-size: 14px;
  margin-top: 6px;
}

.char-counter {
  display: block;
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* Zeichenzähler wird rot, wenn 90 % des Limits erreicht sind */
.char-counter--limit {
  color: #c0392b;
  font-weight: bold;
}

.success {
  background-color: #e1dbca; /* Naturbraun aus CI */
  border: 2px solid #788075; /* Moosgrün aus CI */
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
}

.success h2 {
  margin-top: 0;
}

.success a {
  display: inline-block;
  margin-top: 1rem;
}

/* ===================================================
   Responsive — ab 600px (Tablet)
   =================================================== */

@media (min-width: 600px) {
  body {
    padding: 30px 15px;
  }

  .formular {
    padding: 35px 25px;
  }

  .logo {
    width: 40%;
  }

  h1 {
    font-size: 32px;
  }

  fieldset {
    padding: 25px;
  }

  .step-dot {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .stepper-labels {
    font-size: 13px;
  }

  /* Buttons nebeneinander statt untereinander */
  .btn-row {
    flex-direction: row;
    justify-content: space-between;
  }

  .btn-back,
  .btn-next,
  .btn-submit {
    width: auto;
  }
}

/* ===================================================
   Responsive — ab 768px (Desktop)
   =================================================== */

@media (min-width: 768px) {
  body {
    padding: 40px 20px;
  }

  .formular {
    padding: 50px;
  }

  .stepper-nav {
    margin: 30px 0 10px 0;
  }

  .step-dot {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  .stepper-labels {
    font-size: 15px;
  }
}
