/* Shared upload field (public/js/upload-field.js). One look for every file input. */
.upf {
    position: relative; display: flex; align-items: center; gap: .85rem; box-sizing: border-box;
    width: 100%; min-height: 64px; padding: .75rem 1rem;
    border: 1.5px dashed #B7B9BE; border-radius: 12px; background: #F7F8F9;
    color: #292A2E; font-size: 14px; line-height: 1.4; text-align: start; cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.upf > input[type="file"] {
    position: absolute !important; inset: 0 !important; z-index: 1;
    width: 100% !important; height: 100% !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important;
    font-size: 0; cursor: pointer;
}
.upf:hover, .upf.is-over { border-color: #1544F5; background: #EEF3FF; }
.upf:focus-within { outline: 2px solid #1544F5; outline-offset: 2px; }

.upf-icon {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px #DCE6FF;
    color: #1544F5; font-size: 20px;
}
.upf-body { display: grid; gap: 2px; min-width: 0; }
.upf-body[hidden] { display: none; }
.upf-title { font-size: 14px; color: #505258; }
.upf-title b { font-weight: 600; color: #1544F5; }
.upf-hint { font-size: 12.5px; color: #6B6E76; }
.upf-error { font-size: 12.5px; font-weight: 500; color: #B42318; }
.upf-error[hidden] { display: none; }

/* Chosen file(s). */
.upf-list { flex: 1; min-width: 0; display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.upf-list[hidden] { display: none; }
.upf-file { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.upf-file > i { flex: none; font-size: 18px; color: #505258; }
.upf-file > i.bi-file-earmark-pdf { color: #B42318; }
.upf-file > i.bi-file-earmark-word { color: #1544F5; }
.upf-file > i.bi-file-earmark-image { color: #24632F; }
.upf-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #292A2E; }
.upf-size { flex: none; font-size: 12.5px; color: #6B6E76; }
.upf-x {
    position: relative; z-index: 2; flex: none; display: grid; place-items: center;
    width: 30px; height: 30px; margin-inline-start: auto; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: #505258; font-size: 13px; cursor: pointer;
}
.upf-x:hover { background: #FBEBE9; color: #B42318; }
.upf-x:focus-visible { outline: 2px solid #1544F5; outline-offset: 1px; }

/* States. */
.upf.has-file { border-style: solid; border-color: #BFE3C8; background: #F3FAF5; }
.upf.has-file .upf-icon { color: #24632F; box-shadow: inset 0 0 0 1px #BFE3C8; }
.upf.has-file:hover { border-color: #1544F5; }
.upf.is-invalid, .upf.is-error { border-color: #D92D20; background: #FDF4F3; }
.upf.is-error .upf-icon { color: #B42318; box-shadow: inset 0 0 0 1px #F5C2BD; }
.upf.is-disabled { opacity: .6; cursor: not-allowed; }
.upf.is-disabled > input { cursor: not-allowed; }

@media (max-width: 480px) {
    .upf { gap: .7rem; padding: .7rem .8rem; }
    .upf-icon { width: 36px; height: 36px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .upf { transition: none; } }
