.carley-form-wrapper {
    max-width: 600px;
    margin: auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.progress-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    height: 12px;
}

.progress-bar {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s ease-in-out;
}


.carley-form .form-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.carley-form .step-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #007bff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ai-search-container {
    grid-template-columns: 1fr;
}

.ai-search-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.ai-search-row input[type="text"] {
    flex: 1;
    min-width: 0;
}

.ai-search-btn-wrapper {
    position: relative;
    flex-shrink: 0;
}

.ai-search-row .btn-primary {
    flex-shrink: 0;
    white-space: nowrap;
}

.ai-search-tooltip {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.6rem);
    z-index: 20;
    width: min(320px, 85vw);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.ai-search-tooltip::after {
    content: "";
    position: absolute;
    right: 1.25rem;
    top: 100%;
    border: 7px solid transparent;
    border-top-color: #1a1a1a;
}

.ai-search-tooltip strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.ai-search-tooltip p {
    margin: 0 0 0.5rem;
}

.ai-search-tooltip p:last-child {
    margin-bottom: 0;
}

.ai-search-tooltip-example {
    color: #d9d9d9;
}

.ai-search-tooltip-fallback {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: #f0f0f0;
}

.ai-search-btn-wrapper:hover .ai-search-tooltip,
.ai-search-btn-wrapper:focus-within .ai-search-tooltip {
    display: block;
}

@media (max-width: 600px) {
    .ai-search-row {
        flex-direction: column;
    }

    .ai-search-row .btn-primary,
    .ai-search-btn-wrapper {
        width: 100%;
    }

    .ai-search-tooltip {
        right: auto;
        left: 0;
        width: 100%;
    }

    .ai-search-tooltip::after {
        right: auto;
        left: 1.25rem;
    }
}


.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

@media (max-width: 768px) {
  .checkbox-label {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
}


.checkbox-label:hover {
    background-color: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #007bff;
    flex-shrink: 0;
}

.checkbox-text {
    user-select: none;
    line-height: 1.4;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin: 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.radio-label:hover {
    background-color: #f8f9fa;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007bff;
    flex-shrink: 0;
    margin: 0;
}

.radio-label span {
    user-select: none;
    line-height: 1.4;
}

.form-fieldset {
    border: 1px solid #ccc;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 5rem;
}

.btn-primary,
.btn-secondary,
.btn-success {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-primary {
    background-color: #EE5B2A;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

@media (max-width: 600px) {
    .carley-form-wrapper {
        padding: 1rem;
    }

    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-success {
        width: 100%;
    }
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
    display: none;
}

.form-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

input.invalid,
select.invalid,
textarea.invalid {
    border: 2px solid #dc3545;
    background-color: #fff5f5;
}

input:focus.invalid,
select:focus.invalid,
textarea:focus.invalid {
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

/* Uploaded Files List Styles */
.uploaded-files-list {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem;
    background-color: #f8f9fa;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.uploaded-file-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.uploaded-file-item:last-child {
    margin-bottom: 0;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.file-name {
    font-size: 0.9rem;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.file-size {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

.delete-file-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.delete-file-btn:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

.delete-file-btn:active {
    transform: scale(0.95);
}

.file-preview {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.empty-state {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 1rem;
    font-size: 0.9rem;
}

select:invalid {
    color: black  !important;
}

/* Button Group Styles */
.button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.toggle-button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #ccc;
    background-color: #fff;
    color: #495057;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.toggle-button:hover {
    border-color: #EE5B2A;
    background-color: #EE5B2A;
    color: #007bff;
}

.toggle-button.active {
    background-color: #EE5B2A;
    border-color: #EE5B2A;
    color: #fff;
}

.toggle-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Custom Color Select Styles */
.custom-color-select-wrapper {
    position: relative;
}

.custom-color-select {
    position: relative;
    width: 100%;
}

.custom-color-select-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-color-select-trigger:hover {
    border-color: #EE5B2A;
}

.custom-color-select.active .custom-color-select-trigger {
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    flex-shrink: 0;
}

.selected-text {
    flex: 1;
}

.arrow {
    transition: transform 0.2s ease;
    color: #6c757d;
}

.custom-color-select.active .arrow {
    transform: rotate(180deg);
}

.custom-color-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
}

.custom-color-select.active .custom-color-select-options {
    display: grid;
}

.custom-color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0.375rem;
    text-align: center;
}

.custom-color-option:hover {
    background-color: #f8f9fa;
}

.custom-color-option.selected {
    background-color: #e7f3ff;
}

.option-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    flex-shrink: 0;
}

/* Custom Select Styles (ohne Farben) */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-trigger:hover {
    border-color: #007bff;
}

.custom-select.active .custom-select-trigger {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.custom-select .selected-text {
    flex: 1;
}

.custom-select .arrow {
    transition: transform 0.2s ease;
    color: #6c757d;
}

.custom-select.active .arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    padding: 0.25rem;
}

.custom-select.active .custom-select-options {
    display: flex;
}

.custom-select-option {
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0.375rem;
}

.custom-select-option:hover {
    background-color: #f8f9fa;
}

.custom-select-option.selected {
    background-color: #e7f3ff;
}

/* Von Muharrem ergänzt */
.ueberschrift-formular {
  font-size: 1.7em !important;
  color: #2c3e50;
  text-align: left;
  margin-bottom: 20px;
  line-height: 1.3em;
  font-weight: 600;
}

.text-formular {
  margin-bottom: 20px;
  font-size: 1.1em;
  line-height: 1.5;
  color: #444;
}

/* Tablet-Optimierung */
@media (max-width: 768px) {
  .ueberschrift-formular {
    font-size: 1.3em !important;
    text-align: center !important;   /* mittig auf kleineren Screens */
    line-height: 1.1em !important;
  }

  .text-formular {
    font-size: 0.95em;
    text-align: center;
    margin-bottom: 15px;
  }
}

/* Smartphone-Optimierung */
@media (max-width: 480px) {
  .ueberschrift-formular {
    font-size: 1.5em !important;
    line-height: 1.1em !important;
    margin-bottom: 15px !important;
  }

  .text-formular {
    font-size: 1.1em !important;
    line-height: 1.4em;
    margin-bottom: 20px !important;
  }
}

