<form method="post" action="actions.php" enctype="multipart/form-data"><?= csrf_field() ?><input type="hidden" name="action" value="save_banner"><input type="hidden" name="return_page" value="banners"><input type="hidden" name="id" value="<?= e($item['id']) ?>"><div class="form-grid"><div class="form-group"><label>Título</label><input class="input" name="title" value="<?= e($item['title']) ?>" required></div><div class="form-group"><label>Posição</label><select name="position"><option value="home"<?= selected($item['position'],'home') ?>>Página inicial</option><option value="dashboard"<?= selected($item['position'],'dashboard') ?>>Painel</option><option value="marketplace"<?= selected($item['position'],'marketplace') ?>>Marketplace</option></select></div><div class="form-group full"><label>Subtítulo</label><textarea name="subtitle"><?= e($item['subtitle']) ?></textarea></div><div class="form-group full"><label>Imagem do banner</label><div class="image-upload-row"><div class="image-preview image-preview-wide" data-image-preview><?php if($item['image']):?><img src="<?= e(media_url($item['image'])) ?>" alt="Banner atual"><?php else:?><span>✨</span><?php endif;?></div><div class="file-upload-copy"><label class="file-picker">Escolher imagem<input type="file" name="image_file" accept="image/jpeg,image/png,image/webp" data-image-input></label><small>JPG, PNG ou WebP até 8 MB. A imagem será limitada ao espaço do banner.</small><?php if(!empty($item['image'])):?><label class="check-line"><input type="checkbox" name="remove_image" value="1"> Remover imagem atual ao salvar</label><?php endif;?></div></div></div><div class="form-group"><label>Link</label><input class="input" name="link" value="<?= e($item['link']) ?>"></div><div class="form-group"><label>Ordem</label><input class="input" type="number" name="sort_order" value="<?= (int)$item['sort_order'] ?>"></div><div class="form-group"><label>Status</label><select name="status"><option value="active"<?= selected($item['status'],'active') ?>>Ativo</option><option value="inactive"<?= selected($item['status'],'inactive') ?>>Inativo</option></select></div></div><div class="form-actions"><button class="btn btn-primary">Salvar banner</button></div></form>