/* ================================================
   Modernes Kontaktformular – Stylesheet
   Kompatibel mit Contao ce_form / formbody Struktur
   ================================================ */

/* ---------- Formular-Container ---------- */
.ce_form {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
}

.ce_form form {
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ---------- Widget-Wrapper ---------- */
.formbody .widget {
  margin-bottom: 1.25rem;
}

/* ---------- Labels ---------- */
.formbody .form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

/* Pflichtfeld-Stern */
.formbody .form-label .mandatory {
  color: #d85a30;
  margin-left: 2px;
}

/* Screenreader-Text verstecken */
.formbody .form-label .invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Text- und E-Mail-Inputs ---------- */
.formbody .form-control {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  background: #f7f8f9;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.formbody .form-control:hover {
  border-color: #bbb;
}

.formbody .form-control:focus {
  border-color: #378add;
  box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.15);
  background: #ffffff;
}

.formbody .form-control::placeholder {
  color: #aaa;
}

/* ---------- Hinweis-/Erklärungstext ---------- */
.formbody .widget-explanation {
  font-size: 13px;
  color: #666;
  background: #f0f7ff;
  border-left: 3px solid #378add;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin-bottom: 1.25rem;
}

.formbody .widget-explanation p {
  margin: 0;
  line-height: 1.5;
}

.formbody .widget-explanation a {
  color: #185fa5;
  text-decoration: none;
}

.formbody .widget-explanation a:hover {
  text-decoration: underline;
}

/* ---------- Checkbox ---------- */
.formbody .widget-checkbox .checkbox_container {
  border: none;
  padding: 0;
  margin: 0;
}

.formbody .widget-checkbox .checkbox_container span {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.formbody .widget-checkbox .checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #378add;
  cursor: pointer;
}

.formbody .widget-checkbox label {
  font-size: 14px;
  color: #333;
  cursor: pointer;
  line-height: 1.4;
}

/* ---------- Absenden-Button ---------- */
.formbody .widget-submit {
  margin-top: 1.75rem;
}

.formbody .widget-submit .submit {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 1.5rem;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: #ffffff;
  background: #378add;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  letter-spacing: 0.01em;
}

.formbody .widget-submit .submit:hover {
  background: #185fa5;
}

.formbody .widget-submit .submit:active {
  transform: scale(0.98);
}

.formbody .widget-submit .submit:focus-visible {
  outline: 3px solid rgba(55, 138, 221, 0.4);
  outline-offset: 2px;
}

/* ---------- Captcha (versteckt per JS, trotzdem gestylt) ---------- */
.formbody .widget-captcha label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.formbody .widget-captcha .captcha {
  height: 44px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a1a;
  background: #f7f8f9;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.formbody .widget-captcha .captcha:focus {
  border-color: #378add;
  box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.15);
  background: #ffffff;
}

.formbody .widget-captcha .captcha_text {
  display: block;
  font-size: 13px;
  color: #888;
  margin-top: 6px;
}

/* ---------- Textarea (Problembeschreibung) ---------- */
.formbody .form-control.textarea {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

/* ---------- Labels ohne .form-label Klasse (z. B. bei Textarea) ---------- */
.formbody .widget > label:not(.form-label) {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.formbody .widget > label:not(.form-label) .mandatory {
  color: #d85a30;
  margin-left: 2px;
}

.formbody .widget > label:not(.form-label) .invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- FineUploader (Datei-Upload) ---------- */
.formbody .widget-fineuploader > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.formbody .fineuploader-wrapper {
  border: 1px dashed #d0d4d9;
  border-radius: 8px;
  background: #f7f8f9;
  padding: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.formbody .fineuploader-wrapper:hover {
  border-color: #378add;
  background: #f0f7ff;
}

/* Upload-Button */
.formbody .qq-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.formbody .qq-upload-button:hover {
  border-color: #378add;
  background: #f0f7ff;
  color: #185fa5;
}

/* Drop-Zone Text */
.formbody .qq-upload-drop-area {
  padding: 1rem;
  text-align: center;
  color: #888;
  font-size: 14px;
}

/* Upload-Liste */
.formbody .qq-upload-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.formbody .qq-upload-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 0.5px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  color: #444;
  margin-bottom: 6px;
}

.formbody .qq-upload-file {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formbody .qq-upload-size {
  color: #999;
  font-size: 12px;
  flex-shrink: 0;
}

/* Upload-Aktions-Buttons */
.formbody .qq-btn {
  padding: 3px 8px;
  font-size: 12px;
  font-family: inherit;
  border-radius: 4px;
  border: 1px solid #d8d8d8;
  background: transparent;
  cursor: pointer;
  color: #555;
  transition: background 0.12s ease;
  flex-shrink: 0;
}

.formbody .qq-btn:hover {
  background: #f0f0f0;
}

.formbody .qq-upload-cancel,
.formbody .qq-upload-delete {
  color: #c0392b;
  border-color: #f0c0bc;
}

.formbody .qq-upload-cancel:hover,
.formbody .qq-upload-delete:hover {
  background: #fdf0ef;
}

.formbody .qq-upload-retry {
  color: #185fa5;
  border-color: #b5d4f4;
}

.formbody .qq-upload-retry:hover {
  background: #f0f7ff;
}

/* Fortschrittsbalken */
.formbody .qq-progress-bar-container {
  width: 100%;
  height: 4px;
  background: #e8e8e8;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.formbody .qq-progress-bar {
  height: 100%;
  background: #378add;
  border-radius: 2px;
  transition: width 0.2s ease;
}

.formbody .qq-total-progress-bar-container {
  width: 100%;
  height: 4px;
  background: #e8e8e8;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.formbody .qq-total-progress-bar {
  height: 100%;
  background: #378add;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Status-Text */
.formbody .qq-upload-status-text {
  font-size: 12px;
  color: #888;
}

/* Upload-Spinner */
.formbody .qq-upload-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #d0d4d9;
  border-top-color: #378add;
  border-radius: 50%;
  animation: qq-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes qq-spin {
  to { transform: rotate(360deg); }
}

/* Dialoge */
.formbody .fineuploader-wrapper dialog {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  max-width: 320px;
  font-size: 14px;
  color: #333;
  font-family: inherit;
}

.formbody .fineuploader-wrapper .qq-dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1rem;
}

.formbody .fineuploader-wrapper .qq-dialog-buttons button {
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  border-radius: 6px;
  border: 1px solid #d8d8d8;
  background: #f7f8f9;
  cursor: pointer;
  color: #333;
  transition: background 0.12s ease;
}

.formbody .fineuploader-wrapper .qq-ok-button-selector {
  background: #378add;
  color: #ffffff;
  border-color: #378add;
}

.formbody .fineuploader-wrapper .qq-ok-button-selector:hover {
  background: #185fa5;
}

/* ================================================
   Responsive – Tablet (max-width: 640px)
   ================================================ */
@media (max-width: 640px) {
  .ce_form {
    padding: 0 0.5rem;
  }

  .ce_form form {
    padding: 1.5rem 1.25rem;
    border-radius: 10px;
    box-shadow: none;
  }

  .formbody .form-control {
    font-size: 16px; /* verhindert Auto-Zoom auf iOS */
  }

  .formbody .widget-submit .submit {
    font-size: 16px;
  }
  .formbody .form-control.textarea {
    font-size: 16px;
  }

  .formbody .fineuploader-wrapper {
    padding: 0.75rem;
  }
}

/* ================================================
   Responsive – Mobil (max-width: 400px)
   ================================================ */
@media (max-width: 400px) {
  .ce_form form {
    padding: 1.25rem 1rem;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .formbody .form-control {
    height: 48px;
  }

  .formbody .widget-submit .submit {
    height: 50px;
  }
}
