/* file-upload-preview.css — komponen preview + validasi upload file.
   Melengkapi kartu `.upload` di form.css (form pendaftaran & pinjaman).
   Elemen .up-preview / .up-remove / .up-error dibuat oleh
   javascript/file-upload-preview.js; tanpa JS, kartu tampil seperti semula. */

/* ── Preview (thumbnail gambar / ikon PDF) ─────────────────────────── */
/* Guard: attribute [hidden] harus selalu menang atas display kelas di bawah. */
.upload .up-preview[hidden],
.upload .up-thumb[hidden],
.upload .up-pdf[hidden]{display:none!important}

.upload .up-preview{display:none;position:relative;z-index:1}
.upload.has-file .up-preview{display:grid;place-items:center}
.upload.has-file .up-ic{display:none}

.upload .up-thumb{
  width:76px;height:76px;object-fit:cover;display:block;
  border-radius:12px;border:1px solid var(--line,#CBD3DB);background:#fff;
  box-shadow:0 2px 8px rgba(15,23,42,.10)
}
.upload .up-pdf{
  width:76px;height:56px;display:flex;align-items:center;justify-content:center;gap:6px;
  border-radius:12px;border:1px solid var(--line,#CBD3DB);background:#fff;color:#C0341D
}
.upload .up-pdf svg{width:22px;height:22px}
.upload .up-pdf b{font-family:"Sora",sans-serif;font-size:12px;font-weight:700;letter-spacing:.04em}

/* Nama + ukuran file (span .up-file bawaan tema, diisi oleh JS) */
.upload.has-file .up-file{color:var(--gold-700,#8A6A00)}

/* ── Tombol hapus (×) ──────────────────────────────────────────────── */
/* Input file overlay menutupi seluruh kartu (inset:0) — tombol harus di
   atasnya (z-index) agar klik tidak membuka dialog pilih file. */
.upload .up-remove{
  position:absolute;top:8px;right:8px;z-index:3;
  width:28px;height:28px;padding:0;display:flex;align-items:center;justify-content:center;
  border-radius:50%;border:1px solid var(--line,#CBD3DB);background:#fff;color:#C0341D;
  cursor:pointer;box-shadow:0 1px 4px rgba(15,23,42,.14);
  transition:background .15s,border-color .15s,transform .15s
}
.upload .up-remove svg{width:13px;height:13px}
.upload .up-remove:hover{background:#FEF6F4;border-color:#C0341D;transform:scale(1.06)}
.upload .up-remove:focus-visible{outline:none;box-shadow:0 0 0 4px rgba(192,52,29,.18);border-color:#C0341D}
.upload .up-remove[hidden]{display:none}

/* ── Keadaan error (file ditolak: tipe/ukuran tidak valid) ─────────── */
.upload.has-error{border-style:solid;border-color:#C0341D;background:#FEF6F4}
.upload .up-error{
  display:none;font-size:12.5px;font-weight:600;color:#C0341D;line-height:1.5;
  word-break:break-word
}
.upload.has-error .up-error{display:block}
