/* === Formular-Layout (links) ============================================ */
.form-grid {
  max-width: 560px;
  margin: 0;                  /* NICHT zentrieren */
  padding: 0;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr; /* mobil: 1 Spalte */
  gap: 16px;
}

/* Globale Meldungen */
.error {
  color: #7a4f00;             /* dunkles Braun für Text */
  background: #fff8e1;        /* sehr helles Gelb */
  border: 1px solid #f0c36d;  /* goldgelb, wie Hinweisbox */
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 4px;
  font-weight: 500;
}
.success {
  color: #2e7d32;
  background: #e6f4ea;
  border: 1px solid #2e7d32;
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 4px;
  font-weight: 500;
}

/* Ab Tablet: 2 Spalten */
@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
  }
}

/* Einzeleingaben-Reihe */
.form-row {
  display: flex;
  flex-direction: column;
}

/* Labels */
.form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Standard Inputs */
.form-control {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.4;
  color: #333;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Fokus */
.form-control:focus {
  border-color: #0073e6;
  box-shadow: 0 0 0 2px rgba(0,115,230,0.2);
  outline: none;
}

/* Fehlerzustand */
.form-control.is-invalid {
  border-color: #e63946;
  background-color: #ffeaea;
}

/* Fehlermeldung */
.error-msg {
  display: none;
  font-size: 0.85em;
  color: #e63946;
  margin-top: 4px;
}
.form-control.is-invalid + .error-msg {
  display: block;
}

/* Optional: falls du clientseitig validierst und dem Formular .was-submitted gibst */
.was-submitted .form-control:invalid {
  border-color: #e63946;
  background-color: #ffeaea;
}
.was-submitted .form-control:invalid + .error-msg {
  display: block;
}

/* Checkbox-Zeile: volle Breite, eingezogen */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 20px;
  padding-left: 4px;   /* kleiner Einzug, damit sie nicht am Rand klebt */
  grid-column: 1 / -1; /* volle Breite im Grid */
}
.check-row input[type="checkbox"] {
  margin-top: 3px; /* optisch mittig zur Textzeile */
}

/* Fehlerzustand für Checkbox */
.check-row input[aria-invalid="true"] + label {
  color: #e63946;
  font-weight: bold;
}

.form-actions {
  display: flex;
  flex-direction: column; /* mobil: untereinander */
  gap: 12px;              /* Abstand zwischen den Buttons */
}

/* Ab Tablet/Desktop */
@media (min-width: 768px) {
  .form-actions {
    flex-direction: row;       /* nebeneinander */
    justify-content: flex-start;
    gap: 16px;                 /* etwas mehr Abstand */
  }

  .form-actions .button,
  .form-actions .button-beech {
    width: auto;               /* nicht mehr 100% */
    flex: 0 0 auto;            /* passt sich an Textbreite an */
    margin: 0;                 /* kein extra Margin nötig */
  }
}

/* --- Spaltensteuerung --------------------------------------------------- */
/* Vorname und Name ab 768px nebeneinander */
@media (min-width: 768px) {
  .col-span-1 { grid-column: span 1; }
}

/* E-Mail über volle Breite */
.full-width {
  grid-column: 1 / -1;
}

/* Checkbox über volle Breite */
.check-row.full-width {
  grid-column: 1 / -1;
}

/* Button-Zeile über volle Breite */
.form-actions.full-width {
  grid-column: 1 / -1;
}