/******************
    User custom CSS
    ---------------

    In this file you can add your own custom CSS
    It will be loaded last, so you can override any other property.
    Also, it will never be updated. So if you inheritate a core template and just add here some CSS, you'll still benefit of all the updates
*/

/* Responsive Layout für Fragen mit CSS-Klasse "enger-code" */

.enger-code .answer-item {
  margin-left: clamp(0.5rem, 5vw, 5rem);
  margin-bottom: 0.3rem;
  max-width: 100%;
}

/* Label-Spalte der Teilfrage */
.enger-code .answer-item .control-label,
.enger-code .answer-item .ls-label-question,
.enger-code .answer-item label {
  display: inline-block !important;
  width: clamp(220px, 45vw, 700px) !important;
  min-width: 220px !important;
  max-width: 700px !important;
  margin: 0 0.75rem 0 0 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  line-height: 2.2rem !important;
  transform: translateY(1px);
}

/* Eingabefeld */
.enger-code .answer-item input[type="text"] {
  display: inline-block !important;
  width: 6em !important;
  max-width: 6em !important;
  margin: 0 !important;
  vertical-align: middle !important;
}

/* Ab dieser Fensterbreite auf kompaktes Layout umstellen */
@media (max-width: 1200px) {
  .enger-code .answer-item {
    margin-left: clamp(0.5rem, 5vw, 5rem);
  }

  .enger-code .answer-item .control-label,
  .enger-code .answer-item .ls-label-question,
  .enger-code .answer-item label {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 2.2rem !important;
    transform: translateY(1px);
  }

  .enger-code .answer-item input[type="text"] {
    display: block !important;
    width: 6em !important;
    max-width: 6em !important;
    margin-top: 0.25rem !important;
  }
}

.code-validierung input.code-invalid {
  border: 2px solid #dc3545 !important;
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25) !important;
}

.code-validierung input.form-control.code-invalid,
.code-validierung input[type="text"].code-invalid,
.code-validierung .form-control.code-invalid {
  border: 2px solid #dc3545 !important;
  outline: 2px solid #dc3545 !important;
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25) !important;
}

.code-validierung input[type="text"] {
  text-align: center !important;
}

.code-validierung-gesamt input.code-invalid,
.code-validierung-gesamt input.form-control.code-invalid {
  border: 2px solid #dc3545 !important;
  box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, 0.25) !important;
}

.code-validierung-gesamt input.code-valid,
.code-validierung-gesamt input.form-control.code-valid {
  border: 1px solid #ced4da !important;
  box-shadow: none !important;
}
