/* BIDSMART_GLOBAL_PRETTY_FILE_UPLOAD_V1
   Shared visual treatment for every <input type="file"> in BidSmart.
   Does not change upload names, accept rules, required state, or backend behavior. */

:root{
  --bs-upload-red:#cf1722;
  --bs-upload-red-dark:#af1019;
  --bs-upload-border:#d7dde4;
  --bs-upload-border-hover:#c7a4a8;
  --bs-upload-bg:#fbfcfd;
  --bs-upload-text:#1f252c;
  --bs-upload-muted:#737e89;
}

/* JS adds this class to every file field, including fields added later in modals. */
input[type="file"].bidsmart-pretty-file{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:54px!important;
  padding:7px!important;
  border:1px dashed var(--bs-upload-border)!important;
  border-radius:12px!important;
  background:var(--bs-upload-bg)!important;
  color:var(--bs-upload-muted)!important;
  font-family:inherit!important;
  font-size:11px!important;
  line-height:1.35!important;
  cursor:pointer!important;
  box-shadow:none!important;
  transition:
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease!important;
}

input[type="file"].bidsmart-pretty-file:hover{
  border-color:var(--bs-upload-border-hover)!important;
  background:#ffffff!important;
}

input[type="file"].bidsmart-pretty-file:focus,
input[type="file"].bidsmart-pretty-file:focus-visible{
  outline:none!important;
  border-color:rgba(207,23,34,.55)!important;
  box-shadow:0 0 0 3px rgba(207,23,34,.08)!important;
}

input[type="file"].bidsmart-pretty-file::file-selector-button{
  min-height:38px!important;
  margin:0 11px 0 0!important;
  padding:0 14px!important;
  border:1px solid #d8dee4!important;
  border-radius:9px!important;
  background:#ffffff!important;
  color:var(--bs-upload-text)!important;
  font-family:inherit!important;
  font-size:11px!important;
  font-weight:850!important;
  cursor:pointer!important;
  box-shadow:0 2px 7px rgba(15,23,42,.04)!important;
  transition:
    background .16s ease,
    color .16s ease,
    border-color .16s ease,
    transform .16s ease!important;
}

input[type="file"].bidsmart-pretty-file:hover::file-selector-button{
  border-color:var(--bs-upload-red)!important;
  background:#fff6f6!important;
  color:var(--bs-upload-red)!important;
}

input[type="file"].bidsmart-pretty-file.has-file{
  border-style:solid!important;
  border-color:#d9b6b9!important;
  background:#fffafa!important;
}

input[type="file"].bidsmart-pretty-file.has-file::file-selector-button{
  border-color:var(--bs-upload-red)!important;
  background:var(--bs-upload-red)!important;
  color:#ffffff!important;
  box-shadow:0 5px 12px rgba(207,23,34,.14)!important;
}

input[type="file"].bidsmart-pretty-file.has-file:hover::file-selector-button{
  background:var(--bs-upload-red-dark)!important;
  border-color:var(--bs-upload-red-dark)!important;
}

/* Chromium/WebKit fallback. */
input[type="file"].bidsmart-pretty-file::-webkit-file-upload-button{
  min-height:38px!important;
  margin:0 11px 0 0!important;
  padding:0 14px!important;
  border:1px solid #d8dee4!important;
  border-radius:9px!important;
  background:#ffffff!important;
  color:var(--bs-upload-text)!important;
  font-family:inherit!important;
  font-size:11px!important;
  font-weight:850!important;
  cursor:pointer!important;
}

input[type="file"].bidsmart-pretty-file.has-file::-webkit-file-upload-button{
  border-color:var(--bs-upload-red)!important;
  background:var(--bs-upload-red)!important;
  color:#ffffff!important;
}

/* Small filename/status line inserted by JS. */
.bidsmart-file-selected-name{
  display:none;
  margin:6px 2px 0!important;
  color:#707b86!important;
  font-family:inherit!important;
  font-size:10px!important;
  font-weight:750!important;
  line-height:1.4!important;
  word-break:break-word!important;
}

.bidsmart-file-selected-name.is-visible{
  display:block!important;
}

.bidsmart-file-selected-name::before{
  content:"Selected: ";
  color:#8b949e!important;
  font-weight:700!important;
}

.bidsmart-file-selected-name.is-error{
  color:#9d2028!important;
}

.bidsmart-file-selected-name.is-error::before{
  content:"";
}

/* Preserve compact profile-image uploads while giving them the same styling. */
.profile-image-form input[type="file"].bidsmart-pretty-file,
.admin-profile-form input[type="file"].bidsmart-pretty-file{
  max-width:100%!important;
}

/* A little extra breathing room when an existing label already wraps the field. */
label > input[type="file"].bidsmart-pretty-file{
  margin-top:7px!important;
}

@media(max-width:640px){
  input[type="file"].bidsmart-pretty-file{
    min-height:52px!important;
    padding:6px!important;
    font-size:10px!important;
  }

  input[type="file"].bidsmart-pretty-file::file-selector-button,
  input[type="file"].bidsmart-pretty-file::-webkit-file-upload-button{
    min-height:36px!important;
    padding:0 11px!important;
    margin-right:8px!important;
    font-size:10px!important;
  }
}
