/* ========================================
   File Upload Widget — inline form
   ======================================== */

.form.inline .file-upload-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* ---- Drop zone ---- */
.form.inline .file-upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 120px;
    padding: 24px 20px;
    border: 2px dashed var(--stroke_black, #e0e0e0);
    border-radius: 6px;
    background: var(--card_bg_black, #fafafa);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.form.inline .file-upload-zone:hover {
    border-color: var(--fill_dark_light_ccc, #bbb);
    background: var(--card_bg_hover_black, #f5f5f5);
}

.form.inline .file-upload-zone.drag-over {
    border-color: var(--primary_color, #005f86);
    background: rgba(0, 95, 134, 0.04);
}

.form.inline .file-upload-zone .upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--stroke_black, #e0e0e0);
    color: var(--white_text_black, #333);
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s;
}

.form.inline .file-upload-zone:hover .upload-icon {
    background: var(--fill_dark_light_ccc, #ccc);
}

.form.inline .file-upload-zone .upload-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--light_basic_text_black, #777);
    text-align: center;
}

.form.inline .file-upload-zone .upload-text strong {
    color: var(--primary_color, #005f86);
    font-weight: 600;
}

.form.inline .file-upload-zone .upload-hint {
    font-size: 11px;
    color: var(--light_basic_text_black, #999);
}

/* ---- Hidden native input ---- */
.form.inline .file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* ---- File list ---- */
.form.inline .file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    width: 100%;
}

.form.inline .file-list:empty {
    display: none;
}

.form.inline .file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--card_bg_hover_black, #f0f0f0);
    border: 1px solid var(--stroke_black, #e8e8e8);
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--white_text_black, #333);
    animation: fileItemIn 0.2s ease-out;
}

@keyframes fileItemIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form.inline .file-item .file-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--stroke_black, #ddd);
    color: var(--white_text_black, #555);
    font-size: 14px;
}

.form.inline .file-item .file-info {
    flex: 1;
    min-width: 0;
}

.form.inline .file-item .file-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.form.inline .file-item .file-size {
    display: block;
    font-size: 11px;
    color: var(--light_basic_text_black, #999);
    margin-top: 2px;
}

.form.inline .file-item .file-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--light_basic_text_black, #999);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.form.inline .file-item .file-remove:hover {
    background: var(--stroke_black, #e0e0e0);
    color: var(--white_text_black, #c00);
}

/* ---- Add more button ---- */
.form.inline .file-add-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 16px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--primary_color, #005f86);
    background: transparent;
    border: 1px solid var(--stroke_black, #ddd);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.form.inline .file-add-more:hover {
    background: var(--card_bg_hover_black, #f0f0f0);
    border-color: var(--fill_dark_light_ccc, #bbb);
}

.form.inline .file-add-more .plus-icon {
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* ---- File count badge ---- */
.form.inline .file-count-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--primary_color, #005f86);
    border-radius: 10px;
    vertical-align: middle;
}

/* ---- Error state ---- */
.form.inline .file-upload-zone.error {
    border-color: #e83333;
    background: rgba(232, 51, 51, 0.03);
}

/* ---- Hide leftover desc span from default markup ---- */
.form.inline .bx-input-file-desc {
    display: none !important;
}

/* ---- Form-control parent for file fields should not look like a text input ---- */
.form.inline .form-control:has(.file-upload-wrapper) {
    display: block;
    height: auto;
    border: none;
    background: none;
    padding: 0;
    box-shadow: none;
}

/* Error highlight on the wrapper (jQuery validate adds .error to parent) */
.form.inline .file-upload-wrapper.error .file-upload-zone {
    border-color: #e83333;
    background: rgba(232, 51, 51, 0.05);
}

/* ---- Required star next to label ---- */
.form.inline .form-control label .file-star {
    color: #e83333;
}

/* ---- Validation error message ---- */
.form.inline .form-control .file-upload-wrapper label.error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #e83333;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .form.inline .file-upload-zone {
        min-height: 100px;
        padding: 18px 14px;
    }
    .form.inline .file-upload-zone .upload-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .form.inline .file-upload-zone .upload-text {
        font-size: 12px;
    }
}