/**
 * Reparaturformular Styles V2
 * S-TechSMD Repair Centre
 *
 * Modernes Multi-Step Formular mit Cards, Drag & Drop etc.
 */

/* ===== Form Wizard Container ===== */
.form-wizard {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    padding: 32px;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .form-wizard {
        padding: 20px;
    }
}

/* ===== Wizard Steps Progress ===== */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.3s;
}

.wizard-step.active .wizard-step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.wizard-step.completed .wizard-step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.wizard-step.completed .wizard-step-number::after {
    content: '\2713';
}

.wizard-step-title {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    text-align: center;
}

.wizard-step.active .wizard-step-title {
    color: var(--primary-color);
    font-weight: 600;
}

.wizard-step.completed .wizard-step-title {
    color: var(--success);
}

@media (max-width: 600px) {
    .wizard-step-title {
        display: none;
    }

    .wizard-steps::before {
        left: 30px;
        right: 30px;
    }
}

/* ===== Progress Bar ===== */
.wizard-progress {
    height: 4px;
    background: var(--light-bg);
    border-radius: 4px;
    margin-bottom: 32px;
    overflow: hidden;
}

.wizard-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #0099ff);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ===== Wizard Panels ===== */
.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 24px;
    text-align: center;
}

/* ===== Category Cards ===== */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.category-card {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card.selected {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.category-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

/* Category Card Image */
.category-card-image {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: var(--border-radius);
    background-color: #fff;
}

.category-card-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.category-card-img-default {
    max-width: 60px;
    max-height: 60px;
    opacity: 0.5;
}

.category-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.category-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== Unit Selection Fields ===== */
.unit-selection-group {
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.unit-selection-group.hidden {
    display: none;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 200px; }
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control,
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-help {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Error Codes ===== */
.error-codes-container {
    margin-bottom: 12px;
}

.error-code-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.error-code-row .form-select {
    flex: 2;
}

.error-code-row .form-control {
    flex: 1;
}

.error-code-row .btn-icon {
    flex-shrink: 0;
}

/* ===== File Upload Zone ===== */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--light-bg);
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

.file-upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.file-upload-text {
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.file-upload-browse {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.file-upload-hint {
    font-size: 12px;
    color: var(--text-light);
}

.file-input-hidden {
    display: none;
}

/* ===== File Preview List ===== */
.file-preview-list {
    margin-top: 16px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--light-bg);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
}

.file-preview-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-size {
    font-size: 12px;
    color: var(--text-light);
}

.file-preview-remove {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.file-preview-remove:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* ===== Checkbox & Radio ===== */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    padding: 8px 0;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* ===== Form Notice ===== */
.form-notice {
    background: rgba(0, 102, 204, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin-top: 24px;
}

.form-notice p {
    font-size: 14px;
    color: var(--text-dark);
    margin: 0;
}

.form-notice a {
    color: var(--primary-color);
}

/* ===== Wizard Actions ===== */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

#prevBtn {
    display: none;
}

#submitBtn {
    display: none;
}

/* ===== Success Container ===== */
.success-container {
    text-align: center;
    padding: 60px 20px;
}

.success-container.hidden {
    display: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
}

.success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.success-ticket {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.success-ticket strong {
    font-size: 24px;
    color: var(--primary-color);
    font-family: monospace;
    letter-spacing: 1px;
}

.success-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

.success-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ===== Button Styles ===== */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--light-bg);
}

.btn-icon.btn-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}
